GitHub MCP(モデルコンテキストプロトコル)サーバー
こんにちは!これは、 ClaudeなどのMCP 互換LLM が私の MCP サーバー、ひいては GitHub API と対話できるようにする、私の最初の GitHub MCP サーバーです。
要件
TypeScript(プログラミング言語)
Octokit(GitHubへのAPIリクエストを行うため)
モデルコンテキストプロトコルSDK
プロジェクトをローカルに設定する
リポジトリをクローンする
npm install
実行する.env.example
ファイルで提供されているサンプルを参考にして.env
ファイルを追加します。TypeScriptファイルをJavascriptにビルドするには、
npx tsc
を実行します。最後にプロジェクトを実行するには、
node build/index.js
を実行します。
テスト方法
MCP サーバーは 2 つの方法でテストできます。
MCP検査官
クロードデスクトップ
MCPインスペクターを使用したテスト
ターミナルで
npx @modelcontextprotocol/inspector node build/index.js
実行するだけです。http://localhost:5173にアクセスします。
MCP インスペクターとテストが表示されるようになりました。
Claude Desktopを使用したテスト
ここからClaude Desktopをダウンロードしてインストールします
ファイル > 設定... > 開発者 > 設定の編集に移動します
claude_desktop_config.json ファイルの場所が開くはずです。
コード エディターでそのファイルを開き、次のコードを追加します。
{ "mcpServers": { "gh": { "command": "node", "args": ["absolute\\path\\to\\your\\index.js\\file"], "env": { "GITHUB_TOKEN": "your-github-personal-access-token" } } } }Claudeデスクトップを終了して再度開きます
機能
MCP は主に次の2 つの機能をサポートします。
ツール (4)
create-issue
: GitHubリポジトリに新しい問題を作成するget-repo-info
: 特定の GitHub リポジトリに関する情報を取得するlist-issues
: GitHub リポジトリ内の問題を一覧表示するsearch-repos
: GitHubリポジトリを検索する
プロンプト (5)
create-issue-description
: GitHub の問題の説明を生成するcreate-pull-request-description
: GitHub プルリクエストの説明を生成するsearch-repos-prompt
: GitHubリポジトリを検索するためのクエリを生成するcreate-issue-prompt
: GitHub の問題を作成するためのパラメータを生成するenhance-github-response
: 生の GitHub API レスポンスデータをフォーマットして強化する
独自のプロンプトを作成することも、Claude デスクトップの MCP の「統合を選択」オプションのドロップダウンから適切なプロンプトを選択することもできます。
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Claude やその他の MCP 互換 LLM が GitHub API と対話できるようにし、問題の作成、リポジトリ情報の取得、問題の一覧表示、リポジトリの検索などの機能をサポートする MCP サーバーです。
Related MCP Servers
- AsecurityAlicenseAqualityMCP Server for the GitHub API, enabling file operations, repository management, search functionality, and more.Last updated -22,57368,255MIT License
- AsecurityFlicenseAqualityMCP Server for the GitHub API, providing features for file operations, repository management, and advanced search, with automatic branch creation and comprehensive error handling.Last updated -1804
- AsecurityFlicenseAqualityAn MCP server that enables Claude and other compatible LLMs to interact with the GitHub API, supporting features like creating issues, retrieving repository information, listing issues, and searching repositories.Last updated -4
- -securityAlicense-qualityAn MCP server that wraps around the GitHub CLI tool, allowing AI assistants to interact with GitHub repositories through commands for pull requests, issues, and repository operations.Last updated -5MIT License