mcpField
C
Claude Code Explorer MCP

Claude Code Explorer MCP

ローカル
github.com/codeaashu開発ツール3.4k2 週間前に更新

Claude Code Explorer MCP について

Claude Code Explorer MCP は、MCP クライアントから Claude Code CLI のソースコードを閲覧できる独立した MCP サーバーです。Claude Code のツール、コマンド、アーキテクチャを調べたい開発者を対象とし、STDIO、Streamable HTTP、SSE の各トランスポートに対応しています。

主な機能

  1. 01エージェントツールとスラッシュコマンドの一覧表示
  2. 02ツールとコマンドの実装ソースの読み取り
  3. 03ソースツリーを対象とした正規表現検索
  4. 04アーキテクチャ概要とディレクトリ内容の表示
  5. 05ツールやサブシステムを解説するプロンプトテンプレート
  6. 06任意の Bearer トークンによる認証

活用シーン

  1. 01Claude Code 内の特定ツールの実装方法の調査
  2. 02権限チェックなどサブシステムのコード位置の特定
  3. 03MCP クライアントからの Claude Code アーキテクチャの把握

MCP 対応

本プロジェクトは MCP サーバーであり、Claude Code のソースコードを閲覧するための 8 つのツール、3 つのリソース、5 つのプロンプトを MCP クライアントに公開します。

設定

ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。

mcp.json · 共通設定
{
"mcpServers": {
"divu2025-codemaster": {
"command": "npx",
"args": [
"-y",
"@divyesh2000/codemaster"
]
}
}
}
起動コマンドnpx -y @divyesh2000/codemaster

ローカルサーバーにはマシン上の実行環境(Node.js 18 以上など)が必要です。設定ファイルの場所はクライアントごとに異なります。

パッケージ
npm@divyesh2000/codemaster1.1.0

ツール

ツール一覧はまだ取得されていません

ローカルサーバーのツールはマシン上で起動して初めて取得できます。メンテナーはまだツール一覧を提供していません。

詳細

warrioraashuu Codemaster — MCP サーバー

あらゆる MCP 対応クライアントが Claude Code のソースコードを調べられる、スタンドアロンのModel Context Protocol(MCP)サーバーです。warrioraashuuによってブランド名を変更し、公開されています。STDIO、Streamable HTTP、SSEのトランスポートに対応しています。

概要

約1,900ファイル、512K行超の Claude Code コードベースを調べるための8つのツール、3つのリソース、5つのプロンプトを公開します。これは公式の npm パッケージです:warrioraashuu-codemaster。

トランスポート
トランスポートエンドポイント最適な用途
STDIOnode dist/index.jsClaude Desktop、ローカルの Claude Code、VS Code
Streamable HTTPPOST/GET /mcp最新の MCP クライアント、リモートホスティング
Legacy SSEGET /sse + POST /messages古い MCP クライアント
ツール
ツール説明
list_tools40以上のエージェントツール(BashTool、FileEditTool など)を一覧表示します
list_commands50以上のスラッシュコマンド(/commit、/review など)を一覧表示します
get_tool_source特定のツールの実装を読み込みます
get_command_source特定のコマンドの実装を読み込みます
read_source_file相対パスを指定して、src/内の任意のファイルを読み込みます
search_sourceソースツリー全体を正規表現で検索します
list_directorysrc/配下の任意のディレクトリの内容を一覧表示します
get_architectureアーキテクチャの全体像を取得します
リソース
URI説明
claude-code://architectureREADME/アーキテクチャの概要
claude-code://toolsツールレジストリ(JSON)
claude-code://commandsコマンドレジストリ(JSON)
claude-code://source/{path}任意のソースファイル(テンプレート)
プロンプト
プロンプト説明
explain_tool特定のツールの目的、スキーマ、権限、処理フローを詳しく説明します
explain_command特定のスラッシュコマンドの動作と実装を説明します
architecture_overviewClaude Code のアーキテクチャ全体を順に紹介します
how_does_it_work機能やサブシステム(権限、MCP、ブリッジなど)の仕組みを説明します
compare_tools2つのツールを並べて比較します

セットアップ

cd mcp-server
npm install
npm run build
ローカルで実行(STDIO)
npm start
# or with custom source path:
CLAUDE_CODE_SRC_ROOT=/path/to/src npm start
ローカルで実行(HTTP)
npm run start:http
# Streamable HTTP at http://localhost:3000/mcp
# Legacy SSE at http://localhost:3000/sse
# Health check at http://localhost:3000/health
認証を使用する場合
MCP_API_KEY=your-secret-token npm run start:http
# Clients must include: Authorization: Bearer your-secret-token

設定

Claude Desktop

~/Library/Application Support/Claude/claude_desktop_config.json(macOS)または %APPDATA%\Claude\claude_desktop_config.json(Windows)に追加します:

{
  "mcpServers": {
    "warrioraashuu-codemaster": {
      "command": "node",
      "args": ["/absolute/path/to/claude-code/mcp-server/dist/index.js"],
      "env": {
        "CLAUDE_CODE_SRC_ROOT": "/absolute/path/to/claude-code/src"
      }
    }
  }
}
VS Code(GitHub Copilot)

ワークスペースの.vscode/mcp.jsonに追加します:

{
  "servers": {
    "claude-code-explorer": {
      "type": "stdio",
      "command": "node",
      "args": ["${workspaceFolder}/mcp-server/dist/index.js"],
      "env": {
        "CLAUDE_CODE_SRC_ROOT": "${workspaceFolder}/src"
      }
    }
  }
}
Cursor

~/.cursor/mcp.jsonに追加します:

{
  "mcpServers": {
    "claude-code-explorer": {
      "command": "node",
      "args": ["/absolute/path/to/claude-code/mcp-server/dist/index.js"],
      "env": {
        "CLAUDE_CODE_SRC_ROOT": "/absolute/path/to/claude-code/src"
      }
    }
  }
}

環境変数

変数デフォルト説明
CLAUDE_CODE_SRC_ROOT../src(dist/からの相対パス)Claude Code のsrc/ディレクトリへのパス
PORT3000HTTP サーバーのポート(HTTP モードのみ)
MCP_API_KEY(なし)HTTP 認証用のベアラートークン(任意)

リモート HTTP クライアントの設定

リモートサーバーに接続する Claude Desktop の場合:

{
  "mcpServers": {
    "claude-code-explorer": {
      "url": "https://your-deployment.railway.app/mcp",
      "headers": {
        "Authorization": "Bearer your-secret-key"
      }
    }
  }
}

デプロイ

Railway
  1. GitHub リポジトリをRailwayに接続します
  2. Railway がmcp-server/Dockerfileを自動的に検出します
  3. Railway ダッシュボードで環境変数を設定します:
    • MCP_API_KEY — シークレットのベアラートークン
    • PORTは Railway によって自動設定されます
  4. デプロイすると、your-app.railway.appで利用できます

または CLI で実行します:

railway init
railway up
Vercel
npx vercel

Vercel ダッシュボードで環境変数を設定します:

  • CLAUDE_CODE_SRC_ROOT — src/ファイルがバンドルされている場所へのパス
  • MCP_API_KEY — ベアラートークン

Note:Vercel の関数はステートレスで、実行時間に制限があります(ホビー:10秒/Pro:60秒)。シンプルなツール呼び出しに最適です。永続的な SSE ストリームには、Railway または Docker を使用してください。

Docker
# From repo root
docker build -f mcp-server/Dockerfile -t claude-code-mcp .
docker run -p 3000:3000 -e MCP_API_KEY=your-secret claude-code-mcp

Fly.io、Render、AWS ECS、Google Cloud Run など、あらゆる Docker ホストで動作します。

プロンプト

サーバーは、ガイド付きの探索に使えるプロンプトテンプレートも公開しています。

プロンプト説明
explain_tool特定のツールを詳しく解説します(入力スキーマ、権限、実行フロー)
explain_commandスラッシュコマンドの仕組みを説明します
architecture_overviewClaude Code のアーキテクチャ全体をガイド付きで紹介します
how_does_it_work機能やサブシステム(例:「権限システム」、「MCP クライアント」、「クエリエンジン」)の仕組みを説明します
compare_tools2 つのツールを並べて比較します

使用例

接続すると、AI アシスタントに次のような質問をできます。

  • 「Claude Code のツールをすべて一覧表示して」
  • 「BashTool の実装を見せて」
  • 「権限の確認方法を検索して」
  • 「bridge ディレクトリにはどのファイルがある?」
  • 「QueryEngine.ts の1〜100行目を読んで」
  • 「MCP クライアントの接続はどのように動作する?」
  • explain_tool プロンプトに「FileEditTool」を指定して、詳細な解説を取得する
  • how_does_it_work に「bridge」を指定して、IDE との連携を理解する

MCP Registry への公開

このサーバーは GitHub Actions を通じて MCP Registry に公開されています。タグ付きリリース(v*)では、ワークフローが次の処理を行います。

  1. npm パッケージを npmjs.org に公開します
  2. GitHub OIDC を使用して MCP Registry に認証します
  3. server.json メタデータをレジストリに公開します

手動で公開するには:

# Install the MCP Publisher CLI
curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher

# Authenticate (GitHub OAuth)
./mcp-publisher login github

# Publish
cd mcp-server
../mcp-publisher publish

レジストリ名:warrioraashuu-codemaster

開発

npm install
npm run dev    # Watch mode TypeScript compilation
npm run build  # Compile TypeScript to dist/
npm start      # Run STDIO server
npm run start:http  # Run HTTP server

アーキテクチャ

mcp-server/
├── src/
│   ├── server.ts    — Shared MCP server (tools, resources, prompts) — transport-agnostic
│   ├── index.ts     — STDIO entrypoint (local)
│   └── http.ts      — HTTP + SSE entrypoint (remote)
├── api/
│   ├── index.ts     — Vercel serverless function
│   └── vercelApp.ts — Express app for Vercel
├── Dockerfile       — Docker build (Railway, Fly.io, etc.)
├── railway.json     — Railway deployment config
├── package.json
└── tsconfig.json

コメント

MCP は初めてですか?

プロトコルの概要から最初のサーバーの導入まで、よくある疑問にまとめて答えます。

AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。