Skip to main content
Glama

gh-mcp

gh(GitHub CLI)の body を持つ操作だけを薄くラップする stdio MCP サーバ。

なぜ

issue / PR の長文 Markdown body をシェル経由で gh に渡すと、PowerShell の here-string(@'...'@)・stop-parsing トークン(--%)・クォートエスケープで 繰り返し事故る。このサーバは body を JSON 引数で受け取り、一時ファイルに書いて gh ... --body-file <tmp> を shell=False で実行する。シェルが body 文字列を 一切見ないので、事故が構造的に消える。

公式 GitHub MCP(HTTP)が接続不安定なための代替でもある。認証は既存の gh auth ログインをそのまま使う(PAT 不要)。

Related MCP server: mcp-gitea

提供ツール(事故が多い body 持ち系のみ)

ツール

引数

実行する gh

gh_issue_create

repo, title, body, labels?

gh issue create --repo R --title T --body-file <tmp> [--label ...]

gh_issue_comment

repo, number, body

gh issue comment N --repo R --body-file <tmp>

gh_issue_edit

repo, number, body

gh issue edit N --repo R --body-file <tmp>

gh_pr_create

base, title, body, repo?, draft?

gh pr create --base B --title T --body-file <tmp> [--repo R] [--draft]

読み取り系(gh issue view / gh pr list 等)は body を持たず事故らないため ラップしない。従来どおり gh を直接呼ぶこと。

返り値: { ok, url, stdout, stderr, exit_code }。url は gh が出力する 作成済み issue/PR の URL(stdout の先頭 http 行)。

登録

uv で依存(fastmcp)を隔離実行する。グローバル Python を汚さない。

claude mcp add gh-mcp -- uv run --project "C:\Users\ynaga\.claude\mcp\gh-mcp" python server.py

登録後、claude mcp list で接続を確認できる。

動作確認(手動)

uv run --project "C:\Users\ynaga\.claude\mcp\gh-mcp" python -c "import server; print([t for t in dir(server) if t.startswith('gh_')])"

前提

  • gh 2.x がインストール済みで gh auth status が通っていること。

  • gh は PATH から解決。見つからなければ C:\Program Files\GitHub CLI\gh.exe に フォールバックする(server.py の _resolve_gh)。

Available Tools

4 tools
gh_issue_commentA

Add a comment to an issue (or PR). Body is passed via a temp file.

Inputs: body (required), repo (required), number (required). Returns: object

gh_issue_createA

Create a GitHub issue. Body is passed via a temp file (no shell quoting).

Inputs: body (required), repo (required), title (required), labels. Returns: object

gh_issue_editA

Replace an issue's body. Body is passed via a temp file.

Inputs: body (required), repo (required), number (required). Returns: object

gh_pr_createA

Create a pull request. Body is passed via a temp file (no shell quoting).

The current branch must already be pushed to the remote; this wraps gh pr create only, not the push.

Inputs: base (required), body (required), title (required), repo, +1 more. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool targets a distinct resource-action pair: create issue, comment on issue/PR, edit issue body, create PR. No two tools overlap in purpose, making selection unambiguous.

    Naming Consistency5/5

    All tools follow the consistent `gh_<resource>_<action>` pattern (gh_issue_create, gh_issue_comment, gh_issue_edit, gh_pr_create), making the function of each tool predictable.

    Tool Count5/5

    The four tools form a focused, well-scoped set for GitHub issue and PR creation and editing. The count is within the ideal 3-15 range and each tool earns its place.

    Completeness2/5

    The set lacks read operations (list/get issues or PRs) and PR lifecycle management (merge, close). An agent cannot discover existing resources or manage them beyond creation and editing, leaving significant functional gaps.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that wraps the GitHub CLI to provide comprehensive access to repository management, pull requests, issues, and workflows. It enables users to perform complex GitHub operations and interact with the GitHub API through a standardized interface.
      267 npm
      1
      ISC
    • F
      license
      Not graded
      quality
      A
      maintenance
      A GitHub MCP server that wraps the gh CLI to expose GitHub operations like issues, pull requests, branches, labels, repositories, CI actions, and Projects V2 as tools for MCP clients.
      -
    • A
      license
      B
      quality
      B
      maintenance
      A Python MCP server that wraps the GitHub CLI (gh) to provide structured tools for searching, reading, and managing GitHub resources like repos, issues, PRs, releases, and workflows, with write commands disabled by default.
      61
      MIT