Skip to main content
Glama

GithubMCP

本番運用に耐えるパーソナル開発者アシスタント MCP サーバー

License: MIT Python: 3.11+ Managed by: uv MCP Compatible Code style: ruff Type checked with: mypy

AI モデル(Claude、Cursor など)を GitHub のワークフロー、CI/CD パイプライン、ローカルワークスペースのコンテキスト、コード分析ツールにシームレスに接続します。


概要

GithubMCP は、開発者向けに設計された Model Context Protocol(MCP)サーバーです。AI アシスタントを開発環境に直接橋渡しし、以下を可能にします。

  • GitHub リポジトリ、プルリクエスト、イシュー、コミット、コードを、公開・非公開を問わず調査できます。

  • 会話を通じて、リポジトリのプライバシーと公開状態(public/private)を直接管理できます。

  • CI/CD ワークフローの実行を監視し、失敗した GitHub Actions のビルドステップを解析できます。

  • ユーザーが定義した許可パス内で、ローカルファイルシステムのワークスペースを安全に調査できます。

  • コード品質の分析、複雑度のメトリクス算出、TODO の検出、潜在的なセキュリティの兆候(ハードコードされたシークレット)の検出を実行できます。

STDIO(Claude Desktop、Cursor)と SSE(Web クライアント向け Server-Sent Events)の両方の転送モードに対応しています。


Related MCP server: GitHub MCP Server

ツールスイート リファレンス

GithubMCP は 13 の専門ツールを提供します。

カテゴリ

ツール名

説明

GitHub

search_repos

言語・ソートフィルタ付きで、公開/非公開のユーザー・組織リポジトリを検索します。

GitHub

inspect_pr

PR の詳細、変更ファイル、追加・削除の統計、レビューコメントを取得します。

GitHub

inspect_issue

イシューの状態、アサインされた担当者、関連する PR、ラベル、最新コメントを確認します。

GitHub

search_code

拡張子フィルタ付きで、リポジトリ横断のコードパターンを検索します。

GitHub

recent_commits

差分統計と作成者を含む直近のコミット履歴を取得します。

GitHub

update_repo_visibility

リポジトリの公開状態を 非公開公開 の間で変更します。

CI/CD

check_ci_status

GitHub Actions のステータス(成功/失敗/進行中)と失敗したステップのログを監視します。

ファイルシステム

read_file

MIME タイプの判定とサイズ検証による、ローカルファイルの安全な読み取りを実現します。

ファイルシステム

list_directory

ファイルサイズ、mtime、glob フィルタを含むディレクトリツリー構造を一覧表示します。

ファイルシステム

search_local_files

正規表現やパターンを、周辺の行コンテキスト付きで非同期に grep 検索します。

ファイルシステム

get_project_context

プロジェクトの技術スタック(Node、Python、Rust、Go、Docker)と開発コマンドを検出します。

分析

generate_change_summary

git 参照を比較し、コミットを新機能・修正・破壊的変更などにマッ依頼します。

分析

analyze_code_quality

コード行数、複雑度の見積もり、TODO コメント、シークレットの匂い(ハードコード)を算出します。


クイックスタート

1. 前提環境

  • Python 3.11+

  • uv (高速な Python パッケージマネージャ)

uv がまだインストールされていない場合は、インストールします。

# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

2. クローンとセットアップ

git clone https://github.com/Dhananjayrbiraris/github-mcp.git
cd github-mcp

# Install dependencies and sync virtual environment
uv sync

3. 環境設定

テンプレート .env.example.env にコピーします。

cp .env.example .env

GitHub の Personal Access Token を登録して、.env を編集します。

# GitHub Personal Access Token (Classic PAT with 'repo', 'workflow', 'read:user' scopes)
GITHUB_TOKEN=ghp_your_github_token_here

# Default GitHub Username (Optional)
GITHUB_USERNAME=your_username

# Sandboxed directories allowed for local filesystem operations
ALLOWED_PATHS=["~/projects", "~/workspace", "."]

# Max file size limit in MB for reading files
MAX_FILE_SIZE_MB=10

# Default Transport mode: "stdio" or "sse"
TRANSPORT=stdio

GitHub Token の生成方法: GitHub の GitHub Settings -> Developer Settings -> Personal Access Token (classic) にアクセスし、repoworkflowread:user のスコープを持つ Token を生成します。


クライアント設定ガイド

A. Claude Desktop

1. Claude Desktop の設定ファイルを開く

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Linux: ~/.config/Claude/claude_desktop_config.json

2. github-mcp サーバーを追加します

{
  "mcpServers": {
    "github-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/github-mcp",
        "run",
        "python",
        "-m",
        "github_mcp.main",
        "--transport",
        "stdio"
      ],
      "env": {
        "GITHUB_TOKEN": "ghp_your_personal_access_token_here"
      }
    }
  }
}

(Windows ではバックスラッシュを使用します。例: C:\\Users\\yourname\\path\\to\\github-mcp。またはフォワードスラッシュを使用します。)

3. Claude Desktop を再起動します

Claude Desktop を開くと、プロンプトボックスの右下にあるツールアイコンをクリックすると、接続されているすべての GithubMCP ツールを確認できます。


B. Cursor IDE

Cursor では次の手順を行います。

  1. カーソル設定画面を開きます: Cursor SettingsFeaturesMCP

  2. + Add New MCP Server をクリックします。

  3. フォームを入力します:

    • Name: github-mcp

    • Type: command

    • Command: uv --directory /path/to/github-mcp run python -m github_mcp.main --transport stdio


C. Server-Sent Events (SSE) モード / Web クライアント

HTTP 経由で MCP サーバーを起動する場合:

uv run python -m github_mcp.main --transport sse --host 0.0.0.0 --port 8000

SSE エンドポイントは http://localhost:8000/sse からアクセスできます。


セキュリティとサンドボックス

  1. パスサンドボックス: ローカルファイルシステムツール(read_filelist_directorysearch_local_filesget_project_context)は、ALLOWED_PATHS に対してパストラバーサラル検証を厳密に適用します。許可リスト外のパスにアクセスすると、SecurityError が発生します。

  2. シークレット管理: トークンやクレデンシャルがログに記録されたり、公開されたりすることはありません。

  3. レートリミット耐性: GitHub API のレート制限によるスロットリングに対して、自動で指数バックオフのリトライを実行します。


開発とテスト

以下でテストと品質チェックを含むスイート全体を実行できます。

# Run pytest unit tests
uv run pytest

# Run linter
uv run ruff check .

# Check code formatting
uv run ruff format --check .

# Run strict type checking
uv run mypy src/

リポジトリ構造

github-mcp/
├── .github/workflows/ci.yml # GitHub Actions CI workflow
├── src/github_mcp/
│   ├── __init__.py
│   ├── main.py              # Server entrypoint & MCP tool registrations
│   ├── config.py            # Pydantic Settings model
│   ├── github_tools.py      # GitHub API integrations & visibility controls
│   ├── file_tools.py        # Sandboxed local filesystem operations
│   ├── ci_tools.py          # GitHub Actions CI/CD monitoring
│   ├── analysis_tools.py    # Diff categorization & code quality analyzer
│   └── utils.py             # Path safety, error handling, rate limiting
├── tests/
│   ├── conftest.py          # Pytest fixtures and mocks
│   ├── test_github.py       # GitHub tools unit tests
│   ├── test_files.py        # Filesystem tools unit tests
│   └── test_ci.py           # CI status tools unit tests
├── docs/
│   ├── architecture.md      # System architecture & data flow
│   └── tools_reference.md   # Complete API schemas for all 13 tools
├── pyproject.toml           # Project dependencies & tool configurations
├── .env.example             # Environment variable template
├── CONTRIBUTING.md          # Open-source contribution guidelines
├── SECURITY.md              # Security policy & vulnerability reporting
└── LICENSE                  # MIT License

ライセンス

このプロジェクトは MIT License の下で提供されています。個人用途・商用用途ともに無料です。


Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

View all related MCP servers

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…

  • Screens public GitHub repos and PRs to generate risk maps, findings, and merge-readiness signals.

View all MCP Connectors

Latest Blog Posts

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/Dhananjayrbiraris/github-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server