GitHub Explorer MCP について
GitHub Explorer MCPは、MCPクライアント向けにリポジトリの構成、ファイル内容、概要、メタデータを取得するサーバーです。キャッシュや任意のローカルクローン、テキストまたはJSON形式の出力にも対応します。
主な機能
- 01リポジトリの概要とメタデータ
- 02ASCII形式のディレクトリツリー
- 03指定したリポジトリファイルの読み取り
- 04キャッシュと任意のローカルクローン
- 05テキストまたは構造化JSON出力
- 06進捗通知と自動補完
活用シーン
- 01リポジトリの構成確認
- 02ファイルとリポジトリメタデータの取得
- 03MCPクライアントでのリポジトリ情報の利用
MCP 対応
リポジトリ概要、ディレクトリ構成、指定ファイルの内容を取得するMCPツールを提供します。stdioまたはHTTP/SSEで実行できます。
設定
ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。
ツール
ローカルサーバーのツールはマシン上で起動して初めて取得できます。メンテナーはまだツール一覧を提供していません。
詳細
GitHub Explorer MCP
Claude Desktop、Cursor などの MCP クライアント向けに、ファイルの内容、ディレクトリ構造、その他のメタデータを含む GitHub リポジトリ情報を提供する MCP サーバーです。
機能
- リポジトリの概要:GitHub リポジトリに関する包括的な情報を取得します
- ディレクトリ構造:見やすい ASCII ツリー表示で、任意のリポジトリの完全なファイル構造を確認できます
- ファイルの内容:特定のファイルの内容にアクセスできます
- メタデータの拡充:スター数、フォーク数、説明、最終更新情報を取得します
- ローカルリポジトリのクローン:処理を高速化し、より完全なデータを取得するために、リポジトリをローカルにクローンします
- キャッシュシステム:リポジトリのデータを効率的にキャッシュし、API 呼び出しを削減します
- 進捗通知:時間のかかる処理の進捗を更新します
- 形式の選択肢:テキストまたは構造化された JSON 形式でデータを取得します
- 自動補完:リポジトリのオーナーや名前の候補を提示します
- Web インターフェース:HTTP モードで実行する際に、基本的なステータスページと情報を提供します
インストール
NPM を使用する
# Install from npm
npm install @trishchuk/github-explorer-mcp -g
# Run the server (stdio mode for MCP clients)
github-explorer-mcp
# Or run in HTTP/SSE mode
github-explorer-mcp-sse
Docker を使用する
# Build Docker image
docker build -t github-explorer-mcp .
# Run container
docker run -p 3000:3000 github-explorer-mcp
MCP クライアントでの使用方法
Claude Desktop
Claude Desktop の設定に追加します:
{
"mcpServers": {
"github-explorer": {
"command": "npx",
"args": ["-y", "@trishchuk/github-explorer-mcp"]
}
}
}
Cursor
Cursor の設定に追加します:
{
"mcpServers": {
"github-explorer": {
"command": "npx",
"args": ["-y", "@trishchuk/github-explorer-mcp"]
}
}
}
API リファレンス
MCP サーバーは以下のツールを提供します:
github_repository_summary
GitHub リポジトリの概要を取得します。
{
owner: string; // GitHub organization or username
repo: string; // Repository name
branch?: string; // Optional branch name
includeMetadata?: boolean; // Include stars, forks, etc.
}
github_directory_structure
GitHub リポジトリのツリー構造を取得します。
{
owner: string; // GitHub organization or username
repo: string; // Repository name
branch?: string; // Optional branch name
}
github_read_important_files
GitHub リポジトリから特定のファイルの内容を取得します。
{
owner: string; // GitHub organization or username
repo: string; // Repository name
filePaths: string[]; // List of paths to files
branch?: string; // Optional branch name
format?: 'text' | 'json'; // Output format
}
git_search(近日公開)
GitHub リポジトリ内のコンテンツを検索します。
{
owner: string; // GitHub organization or username
repo: string; // Repository name
query: string; // Search query
branch?: string; // Optional branch name
maxResults?: number; // Maximum results to return
}
git_diff(近日公開)
2 つのブランチまたはコミット間の差分を取得します。
{
owner: string; // GitHub organization or username
repo: string; // Repository name
base: string; // Base branch/commit
head: string; // Head branch/commit
}
開発
# Clone the repository
git clone https://github.com/x51xxx/github-explorer-mcp.git
cd github-explorer-mcp
# Install dependencies
npm install
# IMPORTANT: This project requires Node.js 18 or later
# If using nvm, run:
nvm use
# Build the project
npm run build
# Run the built server
npm start
# or
npm run start:sse
トラブルシューティング
Node.js のバージョンに関する問題
このプロジェクトでは、ReadableStream などの最新の Web API を使用するため、Node.js 18 以降が必要です。次のようなエラーが発生した場合:
ReferenceError: ReadableStream is not defined
以下を行ってください:
- Node.js をバージョン 18 以降に更新します
- nvm を使用している場合は、プロジェクトディレクトリで
nvm useを実行します - 必要なポリフィルが含まれた、変更済みのスクリプトを使用していることを確認します
貢献
貢献を歓迎します!お気軽に Pull Request を送信してください。
ライセンス
MIT
コメント
AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。