🚀
GitHub Repos Manager MCP Server
このツールは、GitHubの個人アクセストークンを使用して、Model Context Protocol (MCP) クライアント(Claude Desktop、Roo Code、Cline、Cursor、Windsurfなど)がGitHubリポジトリとやり取りできるようにする包括的なMCPサーバーです。トークンベースのアクセスにより、設定が簡単で、Dockerを使用せずに直接APIを統合することで、高速かつ効果的なGitHubリポジトリ管理を実現します。
🚀 クイックスタート
前提条件
- Node.js (バージョン18以上)
- GitHub Personal Access Token (PAT)
- GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic) または Fine-grained tokensにアクセスし、新しいトークンを生成します。
- 少なくとも以下のスコープが必要です:
repo (プライベートリポジトリの完全なコントロール)
user:read または user:email (ユーザープロファイルデータの読み取り)
read:org (組織情報にアクセスする場合)
セットアップ方法
npxを使用する場合(最も簡単、インストール不要)
Node.jsがインストールされていることを確認し、以下のコマンドでサーバーを直接実行します。
npx -y github-repos-manager-mcp
macOS/Linuxの場合
{
"mcpServers": {
"github-repos-manager": {
"command": "npx",
"args": [
"-y",
"github-repos-manager-mcp"
],
"env": {
"GH_TOKEN": "ghp_YOUR_ACTUAL_TOKEN_HERE"
}
}
}
}
Windowsの場合(場合によってはnpx.cmdを使用する必要があります)
{
"mcpServers": {
"github-repos-manager": {
"command": "npx.cmd",
"args": [
"-y",
"github-repos-manager-mcp"
],
"env": {
"GH_TOKEN": "ghp_YOUR_ACTUAL_TOKEN_HERE"
}
}
}
}
ローカルにクローンして実行する場合
git clone https://github.com/kurdin/github-repos-manager.git
cd github-repos-manager
npm install
その後、MCPクライアントを構成して、server.cjs への完全なパスを指定します。
{
"mcpServers": {
"github-repos-manager": {
"command": "node",
"args": ["/full/path/to/your/project/github-repos-manager-mcp/server.cjs"],
"env": {
"GH_TOKEN": "ghp_YOUR_ACTUAL_TOKEN_HERE"
}
}
}
}
サーバーのテスト
MCPクライアントが server.cjs への正しいパスと GH_TOKEN で構成されると、クライアントがツールを使用しようとするとサーバーが自動的に起動します。
直接サーバースクリプトをテストすることもできますが、この場合はシェルで一時的に GH_TOKEN 環境変数を設定する必要があります。
export GH_TOKEN="ghp_YOUR_TEMPORARY_TEST_TOKEN"
node server.cjs
unset GH_TOKEN
成功すると、「GitHub API authentication successful」と「GitHub Repos Manager MCP Server running on stdio」が表示されます。
✨ 主な機能
他のGitHub自動化MCPサーバーに対する主要な利点
🎯 シンプルさ:トークンベースのアクセスにより、複雑さを排除します。
🌿 効率性:Dockerを使用しないため、軽量で最適なパフォーマンスを実現します。
💪 強力さ:89のツールが直接APIと統合され、比類のない柔軟性を提供します。
🔒 柔軟性:構成可能なツールにより、細かいコントロールが可能です。
簡単なセットアップと操作
✅ Docker不要 - どこでも実行できるシンプルなNode.jsサーバー
✅ 1つのトークンセットアップ - GitHub Personal Access Tokenのみで動作します
✅ 直接API統合 - gh CLIに依存せず、より高速かつ信頼性が高い
✅ ゼロコンフィグレーション - トークンだけですぐに使えます
高度なセキュリティとコントロール
✅ 許可されたリポジトリ - 特定のリポジトリまたはオーナーに操作を制限できます
✅ ツール管理 - 特定のツールを有効/無効にして、細かいコントロールができます
✅ デフォルトリポジトリ - ワークフローを合理化するためにデフォルトリポジトリを設定できます
✅ 柔軟なパーミッション - サーバーがアクセスできる内容を正確に構成できます
強力な機能
✅ 包括的なツールキット - 完全なGitHubワークフローのための89の強力なツール
✅ ブランチとコミット管理 - ブランチの作成、履歴の探索、変更の比較ができます
✅ 画像アップロードサポート - イシューに直接画像をアップロードして埋め込むことができます
✅ 高度なフィルタリング - 複数の条件でソート、フィルタリング、検索ができます
✅ レート制限対応 - 組み込みのGitHub APIレート制限管理
📦 インストール
前提条件
- Node.js (バージョン18以上)
- GitHub Personal Access Token (PAT)
セットアップ手順
- npxを使用する場合
- Node.jsがインストールされていることを確認します。
GH_TOKEN 環境変数をエクスポートするか、MCPクライアントの構成に含めます。
- 以下のコマンドでサーバーを直接実行します。
npx -y github-repos-manager-mcp
- ローカルにクローンして実行する場合
- リポジトリをクローンし、依存関係をインストールします。
git clone https://github.com/kurdin/github-repos-manager.git
cd github-repos-manager
npm install
- MCPクライアントを構成して、`server.cjs` への完全なパスを指定します。
💻 使用例
リポジトリの探索と管理
- "List my GitHub repositories, sort by creation date and show only private repos."
- "Set default repository to
octocat/Spoon-Knife for easier workflow."
- "Get detailed information about the
microsoft/vscode repository."
- "Show me the contents of the
src/main.js file in microsoft/vscode on the develop branch."
- "Show me the contents of the
src/main.js file in the default repository on the develop branch." (requires default repo set)
- "List all collaborators for
my-org/my-repo who have admin permissions."
- "Search for repositories matching 'tensorflow examples language:python' and sort by stars."
高度なイシュー管理
- "Create an issue in
my-org/my-repo with title 'Urgent: UI Bug' and body 'The login button is broken on mobile.' Assign it to user1 and user2 and add the bug label."
- "Create an issue with title 'Feature Request' and add the
enhancement label." (requires default repo set)
- "Upload a screenshot from
/Users/me/screenshots/bug_report.png to issue #42 in microsoft/vscode."
- "Upload a screenshot from
/Users/me/screenshots/bug_report.png to issue #42 in the default repository." (requires default repo set)
- "Edit issue #15: change title to 'Feature Request: Dark Mode', add the
enhancement label, and close it."
- "Lock issue #23 with reason 'resolved' to prevent further discussion."
- "Get complete details for issue #7 including all metadata and current state."
- "Remove
old-assignee from issue #12 and add new-assignee instead."
イシューディスカッション管理
- "List all comments on issue #7 from the last week."
- "Add a comment 'This looks great! Ready for merge.' to issue #15."
- "Edit comment ID 123456 to say 'Updated: This needs more testing before merge.'"
- "Delete comment ID 789012 from issue #20."
ラベルとマイルストーン管理
- "List all labels in
my-org/my-repo to see current organization system."
- "List all labels in the default repository to see current organization system." (requires default repo set)
- "Create a new label called 'urgent' with red color (#ff0000) and description 'Requires immediate attention'."
- "Edit the 'bug' label to change its color to orange (#FFA500) and update the description."
- "Delete the outdated 'legacy' label from the repository."
- "List all open milestones in
my-org/project-x sorted by due date."
- "Create a milestone 'v2.0 Release' with due date '2025-12-31T23:59:59Z' and description 'Major version release'."
- "Edit milestone #3 to change the title to 'Q2 Goals' and extend the due date."
- "Delete milestone #5 as it's no longer relevant to the project."
プルリクエストとコラボレーション
- "List all open pull requests for
microsoft/vscode."
- "List all open pull requests for the default repository." (requires default repo set)
- "Show me closed pull requests from the last month for
my-org/project-x."
- "Get my GitHub user profile information."
- "Get user profile details for
github_username."
ブランチとコミット管理
- "List all branches in
my-org/my-repo and show their protection status."
- "List all branches in the default repository and show their protection status." (requires default repo set)
- "Show only protected branches in
my-org/secure-repo."
- "Create a new feature branch called
feature/dark-mode from the develop branch."
- "List the last 10 commits on the
main branch."
- "Show me all commits by
john-doe from the last week."
- "Get detailed information about commit
abc123def including all file changes."
- "Compare the
main branch with feature/new-ui to see what's different."
- "Show me the commit history between
v1.0.0 and v2.0.0 tags."
ワークフロー自動化の例
- "Set
my-org/main-project as default, then list all open issues assigned to me."
- "Create a bug report issue with title 'Login Error', upload the error screenshot from
/path/to/error.png, assign to dev-team, and add labels bug and high-priority."
- "For issue #50: add assignee
reviewer1, lock it with reason 'resolved', and add a final comment 'Issue resolved in PR #51'."
📚 ドキュメント
設定オプション
デフォルトリポジトリの設定
ワークフローを合理化し、各コマンドで owner と repo を指定する必要をなくすために、デフォルトのリポジトリを設定できます。設定方法は3つあります。
- 環境変数(MCPクライアントに推奨)
{
"mcpServers": {
"github-repos-manager": {
"command": "npx",
"args": ["-y", "github-repos-manager-mcp"],
"env": {
"GH_TOKEN": "ghp_YOUR_ACTUAL_TOKEN_HERE",
"GH_DEFAULT_OWNER": "octocat",
"GH_DEFAULT_REPO": "Hello-World"
}
}
}
}
- コマンドライン引数
- サーバーを直接実行するときに、デフォルトのリポジトリ設定を渡すことができます。
node server.cjs --default-owner octocat --default-repo Hello-World
- ランタイムツール呼び出し
- 会話中に
set_default_repo ツールを使用して、デフォルトのリポジトリを設定または変更できます。
- "Set default repository to
microsoft/vscode"
- "Change the default to my own repo
username/my-project"
リポジトリアクセス制御
GH_ALLOWED_REPOS 環境変数または --allowed-repos コマンドライン引数を使用して、サーバーがアクセスできるリポジトリを制限できます。これは、サーバーが承認されたリポジトリでのみ操作できるようにするセキュリティ機能です。
ツールアクセス制御
- 特定のツールを無効にする:
GH_DISABLED_TOOLS 環境変数または --disabled-tools コマンドライン引数を設定して、使用したくないツールを無効にできます。
- 特定のツールのみを許可する:最大限のセキュリティのために、
GH_ALLOWED_TOOLS 環境変数または --allowed-tools コマンドライン引数を設定して、サーバーが許可する特定のツールを制限できます。
完全なツールリファレンス
このサーバーは、完全なGitHubワークフロー管理のための89の包括的なツールを提供します。具体的なツールの説明は省略しますが、リポジトリ管理、イシュー管理、プルリクエスト管理、ブランチとコミット管理、コラボレーションとユーザー管理など、様々な機能をカバーしています。
🔧 技術詳細
APIレート制限とパフォーマンス
- 標準レート制限:認証済みユーザーの場合、GitHub APIは1時間あたり5,000リクエストを許可します。
- 組み込み対応:サーバーにはレート制限応答の包括的なエラーハンドリングが含まれています。
- パフォーマンス最適化:直接HTTPリクエストを使用することで、CLIツールと比較して応答時間が短縮されます。
- キャッシュ推奨:頻繁にアクセスするデータに対してキャッシュ戦略を実装することを検討してください。
セキュリティのベストプラクティス
- トークンセキュリティ:
GH_TOKEN をバージョン管理にコミットしたり、公開して共有したりしないでください。
- 最小限のパーミッション:使用ケースに必要な最小限のスコープのトークンを使用してください。
- 環境変数:常にMCPクライアントの構成の
env ブロックを介してトークンを提供してください。
- トークンのローテーション:セキュリティを強化するために、定期的にGitHubトークンをローテーションしてください。
- 安全な保管:システムの資格情報管理を使用してトークンを安全に保管してください。
📄 ライセンス
このMCPサーバーはMITライセンスの下で提供されています。自由に使用、変更、配布することができます。