GitHub Repository MCP Server
GitHub リポジトリ MCP サーバー
このモデルコンテキストプロトコル(MCP)サーバーは、AIモデルがGitHubリポジトリのコンテンツをコンテキストとしてアクセスできるようにします。ファイルの内容、リポジトリ構造、そしてリポジトリ全体を取得し、AIインタラクションのコンテキストとして使用するためのツールを提供します。
特徴
リポジトリの内容全体をコンテキストとして取得する
リポジトリから特定のファイルの内容を取得する
リポジトリ構造を取得する(ファイルリスト)
拡張子でファイルをフィルタリングする
特定のパスを除外する
返されるファイルの数を制限する
Related MCP server: GitHub Repo Explainer MCP
インストール
# clone the repository
git clone https://github.com/shanksxz/github-mcp.git
cd github-mcp
# install dependencies
npm install
# build the project
npm run build使用法
GitHub認証の設定
サーバーは認証なしでパブリックリポジトリを操作できますが、GitHub API は認証されていないリクエストに対して厳格なレート制限(60 リクエスト/時間)を設けています。この制限を 5000 リクエスト/時間に引き上げるには、 GITHUB_TOKEN環境変数を設定します。
# create a file called gh.sh and add the following line:
export GITHUB_TOKEN=your_github_personal_access_token
# make the file executable
chmod +x gh.sh
# run the file
./gh.shGitHub 開発者設定で個人アクセス トークンを作成できます。
カーソルの使用
このサーバーを Cursor で使用するには、次の手順に従います。
カーソル設定を開く
「MCP」を検索
「新しいMCPサーバーを追加」をクリックします。
次の情報を入力してください。
名前: github-repo-context (または任意の名前)
タイプ: コマンド
コマンド: /path/to/your-local-repo-setup/gh.sh
「保存」をクリック
サーバー名の横にあるトグルをクリックしてサーバーを有効にします
これでプロジェクトでサーバーが使えるようになるはずです
サーバーは、MCP プロトコルに従って stdin/stdout を介して通信します。
利用可能なツール
サーバーは次のツールを提供します。
get-repo-context : コンテキストとして使用する GitHub リポジトリからすべてのファイルを取得する
パラメータ:
owner: GitHubリポジトリの所有者/組織名repo: GitHubリポジトリ名maxFiles(オプション): 含めるファイルの最大数 (デフォルト: 50)fileExtensions(オプション): 含めるファイル拡張子 (例: ['js', 'ts', 'md'])excludePaths(オプション): 除外するパス (デフォルト: ['node_modules', 'dist', 'build'])
get-file-content : GitHub リポジトリから特定のファイルの内容を取得する
パラメータ:
owner: GitHubリポジトリの所有者/組織名repo: GitHubリポジトリ名path: リポジトリ内のファイルへのパス
get-repo-structure : GitHubリポジトリの構造を取得する
パラメータ:
owner: GitHubリポジトリの所有者/組織名repo: GitHubリポジトリ名
例
MCP をサポートする AI モデルと統合すると、次のようなコマンドを使用できます。
Get the structure of the repository tensorflow/tensorflow次に、AI はget-repo-structureツールを使用してリポジトリ構造を取得して表示します。
Available Tools
3 toolsget-file-contentC
Get content of a specific file from a GitHub repository
Inputs: owner (required), repo (required), path (required).
get-repo-contextC
Get all files from a GitHub repository to use as context
Inputs: owner (required), repo (required), maxFiles, fileExtensions, +1 more.
get-repo-structureC
Get the structure of a GitHub repository
Inputs: owner (required), repo (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The tools have overlapping purposes that could cause confusion. get-repo-context and get-repo-structure both retrieve repository information, with get-repo-context getting all files and get-repo-structure getting the structure, making their boundaries unclear. get-file-content is more distinct but still part of the same domain.
All tool names follow a consistent verb_noun pattern with hyphens (get-file-content, get-repo-context, get-repo-structure). The naming is predictable and readable throughout the set.
With only 3 tools, the server feels thin for a GitHub repository domain. It lacks essential operations like create, update, delete, or search, which are typical for such a purpose, making the scope incomplete and underpowered.
The tool surface is severely incomplete for a GitHub repository server. It only provides read-only file and structure retrieval, missing core CRUD operations (e.g., create/update files, manage issues/pull requests) and other common GitHub functionalities, leading to significant gaps that will hinder agent workflows.
Maintenance
Related MCP Connectors
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Operate GitHub from your AI assistant: repos, PRs, issues, Actions. Previews and read-only mode.
Access the GitHub API, enabling file operations, repository management, search functionality, and…
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to analyze GitHub repository structures and read file contents with features like directory traversal, file type analysis, syntax highlighting, and code pattern detection. Supports both public and private repositories through GitHub API integration.8 npmApache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to access live GitHub repository data without cloning, supporting repo summarization, file explanation, recent changes, and dependency analysis.12 PyPIMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to analyze GitHub repositories, including fetching repository details, searching, and retrieving README content.2MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to inspect local Git repositories and interact with the GitHub API for reading commits, diffs, files, issues, comments, pull requests, and project boards.10ISC