概要
- claudeCodeにMCPサーバーの設定を導入する
- MCPサーバーにはローカルのgitリポジトリを使う
知見メモ
- claudeには
claudeCode(CLI)とclaudeDesktopが存在するが、これらの設定はお互いに独立している - 本記事では基本的に
claudeDesktopについてのみ言及する
claudeDesktop設定
A.前準備:uv(python環境管理ツール)を入れる
(追記:npxを使うようにしたのでuvは入れなくて良い)
-
uv --versionでコマンド入っていないこと確認(入っていれば後続の作業不要) -
uv公式githubどおりのインストール手順実行
curl -LsSf https://astral.sh/uv/install.sh | sh - 設定読み込み
source $HOME/.local/bin/env -
uv --versionが表示されればOK
B.設定編集
- 設定ファイル存在確認
ls ~/Library/Application\ Support/Claude/claude_desktop_config.json - 編集
vimでも良いし、左下の設定>開発者>設定を編集で下記の"mcpServers"の内容を追記 - jsonの中身
{ "preferences": { "coworkWebSearchEnabled": true, "coworkScheduledTasksEnabled": true, "ccdScheduledTasksEnabled": true }, "mcpServers": { "fluentd_practice": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "/Users/{{ユーザー名}}/git/fluentd_practice" ] } } } - アプリ再起動して
fluentd_practiceのディレクトリ構成見せてで中身回答もらえればOK
C.MCPサーバーの追加
1.コンフル追加
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
"mcpServers"内の要素として下記を追加
"atlassian": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mcp.atlassian.com/v1/mcp/authv2"
]
}