gh-mcp
A thin MCP server wrapping GitHub CLI body operations to avoid shell escaping issues, enabling creation and editing of issues and pull requests.
README
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_')])"
前提
gh2.x がインストール済みでgh auth statusが通っていること。ghは PATH から解決。見つからなければC:\Program Files\GitHub CLI\gh.exeに フォールバックする(server.pyの_resolve_gh)。
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.