gh-mcp
Provides tools for creating and editing GitHub issues and pull requests, with safe handling of Markdown body content via temporary files to avoid shell escaping issues.
Click on "Deploy 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., "@gh-mcp create an issue in owner/repo titled 'Bug fix' with body 'Fixed typo'"
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.
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 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)。
Available Tools
4 toolsgh_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
Scored across 4 tools
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.
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.
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.
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
Related MCP Connectors
MCP server for siGit (sigit.si): browse repos, search code, manage PRs/issues, web search.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Create, deploy, and operate MCP servers directly from your GitHub repositories.
MCP Server for Slima - AI Writing IDE for Novel Authors with AI Beta Reader.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn 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 npm1ISC
- AlicenseBqualityFmaintenanceMCP server for interacting with Gitea, enabling issue and PR management, repository browsing, file reading, and safe git command execution.11117 npm1MIT
- FlicenseNot gradedqualityAmaintenanceA 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.-
- AlicenseBqualityBmaintenanceA 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.61MIT