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 不要)。

提供ツール(事故が多い 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)。

F
license - not found
-
quality - not tested
C
maintenance

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

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/yukkie/gh-mcp'

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