Type: FastMCP Server Transport: stdio Python: 3.8+
GitHub repository operations via PyGithub with gh CLI fallback for merge operations. Creates and manages issues, pull requests, comments, labels, and runs full merge cycles with optional build validation gates.
server.py
Run via python server.py — communicates over stdio using the MCP protocol.
github_create_issue— Create a GitHub issue with title, body, labels, assigneesgithub_close_issue— Close an issue with a closing commentgithub_add_comment— Add a comment to an issue or PRgithub_create_pr— Create a pull request from a branch with title and bodygithub_merge_pr— Merge a PR (squash/merge/rebase strategies supported)github_list_issues— List open/closed issues with filtersgithub_get_pr_status— Get PR status: checks, reviews, mergabilitygithub_create_issue_branch— Create a branch named from an issue numbergithub_auto_commit_and_pr— Commit staged changes and open a PR automaticallygithub_validate_build— Wait for CI checks to pass before proceedinggithub_label_issue— Add or remove labels from an issuegithub_create_label— Create a new label in a GitHub repository with idempotent behavior (returns existing if label already exists)github_create_milestone— Create a new Milestone (Sprint container) in a GitHub repository with idempotent behaviorgithub_full_merge_cycle— Full cycle: build validate -> merge PR -> close issue -> cleanup
base/— Shared MCP infrastructure package (response builder, decorators, persistence, clients)mcp_errors.py— Structured error response helpersinput_validator.py— Null-byte strip, length limits, prompt injection detectionrate_limiter.py— Token bucket rate limiter (enable via ENABLE_RATE_LIMITING=1)idempotency.py— Atomic (O_CREAT|O_EXCL) idempotency memo backing the optionalidempotency_keyparameter on non-idempotent create/trigger tools
GITHUB_TOKEN— GitHub personal access token (required)GITHUB_REPO— Default repo in owner/repo format (optional)
# Install deps
pip install -r requirements.txt
# Run the MCP server (stdio mode)
python server.pyimport subprocess, json
proc = subprocess.Popen(
["python", "server.py"],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
)
# Send MCP initialize + tool call via stdinmcp-github-api/
+-- server.py # Main FastMCP server (entry point)
+-- base/ # Shared base package (response, decorators, persistence, clients)
+-- mcp_errors.py # Error helpers
+-- input_validator.py # Input validation
+-- rate_limiter.py # Rate limiting
+-- requirements.txt
+-- .gitignore
+-- README.md
+-- CLAUDE.md
- Do NOT edit
base/directly — it is a copy frommcp-baserepo - To update shared utilities, edit in
mcp-baseand re-copy - Keep
server.pyas the single entry point - All tool handlers must use
@mcp_tool_handlerdecorator for consistent error handling - All responses must use
success()/error()/MCPResponsebuilder frombase.response
Last Updated: 2026-03-31