github-mcp
Provides GitHub API integration for retrieving repository information and creating issues.
Allows triggering repository_dispatch events to invoke GitHub Actions workflows.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@github-mcpget info about the nht-x/github-mcp repository"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🚀 GitHub MCP サーバー
Model Context Protocol (MCP) による GitHub API 統合
Claude Desktop & GPT-4 との連携で、GitHub を AI アシスタントから直接操作できます。
📋 クイックスタート
1️⃣ インストール
# リポジトリをクローン
git clone https://github.com/nht-x/github-mcp.git
cd github-mcp
# Poetry で依存関係をインストール
poetry install2️⃣ 環境設定
# .env.example をコピー
cp .env.example .env
# 暗号化キーを生成
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
# .env を編集(GitHub PAT と暗号化キーを設定)
nano .env3️⃣ ローカルサーバー起動
# MCP サーバー起動(stdio トランスポート)
poetry run python -m github_mcp.core.server📖 詳細は DEVELOPMENT.md を参照
Related MCP server: GitHub MCP Server
✨ 機能
利用可能なツール(3 個)
ツール | 説明 | パラメータ |
get_repository_info | リポジトリ情報を取得 | owner, repo |
create_issue | Issue を作成 | owner, repo, title, body |
trigger_repository_dispatch | repository_dispatch イベントを発火 | owner, repo, event_type, payload_json |
🏗️ プロジェクト構造
github-mcp/
├── 📁 src/github_mcp/
│ ├── 📄 config.py # 設定管理
│ ├── 📁 api/
│ │ ├── client.py # GitHub API クライアント
│ │ ├── exceptions.py # API 例外定義
│ │ └── __init__.py
│ ├── 📁 core/
│ │ ├── server.py # MCP サーバー本体
│ │ ├── cli.py # CLI エントリーポイント
│ │ └── __init__.py
│ ├── 📁 tools/
│ │ ├── handlers.py # MCP ツールハンドラー
│ │ └── __init__.py
│ ├── 📁 utils/
│ │ ├── encryption.py # トークン暗号化(Fernet)
│ │ ├── logging.py # ログ & トークンマスキング
│ │ └── __init__.py
│ └── 📁 services/
│ └── __init__.py # GitHub サービスラッパー
├── 📁 tests/
│ ├── unit/ # ユニットテスト
│ └── integration/ # 統合テスト
├── .env.example # 環境テンプレート
├── pyproject.toml # 依存関係
├── DEVELOPMENT.md # 開発ガイド
├── README.md # このファイル
└── LICENSE # MIT License🔐 セキュリティ機能
PAT 管理
環境変数 —
GITHUB_PATは環境変数から読み込み暗号化 — Fernet 対称鍵暗号化で本番環境対応
ログとマスキング
自動マスキング — API キーは自動的に
***REDACTED***に隠蔽JSON ログ — 本番環境では JSON 形式で構造化ログ出力
テキストログ — 開発環境では読みやすいテキスト形式
📖 セットアップ詳細
環境変数(.env)
# 必須
GITHUB_PAT=ghp_... # GitHub Personal Access Token
ENCRYPTION_KEY=your_fernet_key # python -c で生成
# オプション
LOG_LEVEL=INFO # DEBUG, INFO, WARNING, ERROR
LOG_FORMAT=text # text または json
MCP_SERVER_HOST=127.0.0.1
MCP_SERVER_PORT=8000GitHub PAT スコープ
以下のスコープが必要です:
repo— リポジトリ読み取り・書き込みworkflow— GitHub Actions 操作(repository_dispatch 用)issues— Issue の作成・読み取り
PAT 生成方法
GitHub Settings > Developer settings > Personal access tokens > Tokens (classic)
「Generate new token (classic)」をクリック
スコープを上記から選択
トークンをコピーして
.envに設定
🖥️ Claude Desktop 接続
設定ファイル
Claude Desktop に以下を設定します:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
設定例
{
"mcpServers": {
"github": {
"command": "poetry",
"args": ["run", "python", "-m", "github_mcp.core.server"],
"cwd": "/absolute/path/to/github-mcp",
"env": {
"GITHUB_PAT": "ghp_...",
"ENCRYPTION_KEY": "your_fernet_key"
}
}
}
}接続確認
Claude Desktop を再起動し、以下のように聞いてください:
「GitHub でリポジトリ情報を取得してくれる?」
🤖 GPT Custom GPT 接続
OpenAI Actions 設定
「Create new GPT」をクリック
以下の設定を追加:
スキーマ(OpenAPI)
openapi: 3.0.0
info:
title: GitHub MCP API
version: 1.0.0
servers:
- url: http://localhost:8000
paths:
/dispatch:
post:
summary: repository_dispatch をトリガー
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
owner:
type: string
repo:
type: string
event_type:
type: string
payload_json:
type: string
/issue:
post:
summary: Issue を作成
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
owner:
type: string
repo:
type: string
title:
type: string
body:
type: string
/repository:
post:
summary: リポジトリ情報を取得
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
owner:
type: string
repo:
type: string🧪 テスト
# すべてのテストを実行
poetry run pytest
# カバレッジ付きで実行
poetry run pytest --cov=src/github_mcp
# 特定のテストファイルのみ実行
poetry run pytest tests/unit/test_config.py -v🛠️ 開発
詳細な開発ガイドは DEVELOPMENT.md を参照
コード品質チェック
# フォーマッティング
poetry run black src/
# リント
poetry run ruff check src/
# 型チェック
poetry run mypy src/🚀 本番環境デプロイ
GCP Secret Manager 統合
暗号化キーやトークンを GCP Secret Manager で管理する場合:
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json詳細は DEVELOPMENT.md の「本番環境設定」を参照
📝 ライセンス
MIT License — LICENSE を参照
💡 トラブルシューティング
エラー: GITHUB_PAT not configured
# .env に GITHUB_PAT が設定されているか確認
cat .env | grep GITHUB_PAT
# 環境変数で直接設定
export GITHUB_PAT=ghp_...エラー: Failed to initialize MCP server
# 依存関係を再インストール
poetry install --no-cache
# 暗号化キーが正しい Fernet キーか確認
python -c "from cryptography.fernet import Fernet; Fernet('your_key')"エラー: rate limit exceeded
GitHub API のレート制限に達した場合、待機してから再度実行してください。
📬 サポート
問題が発生した場合、GitHub Issues で報告してください。
Made with ❤️ by the Hermes crew
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to manage GitHub repositories, branches, issues, pull requests, releases, and actions through natural language.1185MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI assistants to perform GitHub operations such as creating repositories, issues, pull requests, and more through natural language.
- FlicenseCqualityBmaintenanceEnables AI assistants to interact with GitHub repositories via the REST API, supporting repository listing, detail retrieval, and issue management.2
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to interact with GitHub via natural language, supporting repository management, issue tracking, file commits, and more.
Related MCP Connectors
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Git-backed platform for skills, tools, and context for AI agents
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nht-x/github-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server