GitHub Prod MCP
This server provides a production-ready MCP and REST API for comprehensive GitHub repository and workflow management.
User & Repository Management
Get authenticated user info
Create repositories (with options for privacy, license, gitignore, etc.)
Get repository metadata and enriched details (including branches, root files, and README)
Branches & Commits
List branches and get specific branch details
Get a specific commit by ref
Compare two commits or branches
File Operations
List repository files/directory contents at any path and ref
Get file content metadata
Create, update, append to, or delete files
Search
Search repositories, code, and issues/pull requests
Issues
List, get, create, and update issues
Create comments on issues
Pull Requests
List, get, create, and merge pull requests (with configurable merge method)
Workflows & Automation
Create repository dispatch events with custom payloads
Trigger GitHub Actions workflow dispatches with optional inputs
List workflow runs with filtering by actor, branch, event, and status
Provides tools for interacting with GitHub's API, enabling AI agents to manage repositories, issues, pull requests, and other GitHub resources.
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., "@GitHub Prod MCP show me the open pull requests for octocat/Hello-World"
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.
GitHub Prod MCP
Production-ready GitHub MCP server implemented in Python, based on the official GitHub REST API documentation at https://docs.github.com/en/rest.
Features
MCP stdio server for GitHub operations
REST API wrapper exposing the same tools
POST-only tool endpoints
Request-body-only inputs for tool APIs
Centralized validation with Pydantic models
GitHub API version header support
Timeout handling and normalized API errors
Shared service layer for MCP and REST parity
Related MCP server: git-mcp
Implemented tools
get_authenticated_usercreate_repositoryget_repositoryget_repository_detailslist_branchesget_branchlist_repository_filesget_file_contentsearch_repositoriessearch_codesearch_issueslist_issuesget_issuecreate_issueupdate_issuecreate_issue_commentlist_pull_requestsget_pull_requestcreate_pull_requestmerge_pull_requestget_commitcompare_commitscreate_or_update_fileappend_to_filedelete_filecreate_repository_dispatchtrigger_workflow_dispatchlist_workflow_runs
Project structure
src/github_prod_mcp/main.py- MCP stdio serversrc/github_prod_mcp/rest_api.py- REST API wrappersrc/github_prod_mcp/github_api.py- GitHub REST clientsrc/github_prod_mcp/service.py- shared business layersrc/github_prod_mcp/models.py- request and response schemassrc/github_prod_mcp/config.py- environment-driven settings
Requirements
Python 3.10+
A GitHub token with the scopes required for the operations you plan to use
Setup
1. Create a virtual environment
PowerShell:
python -m venv .venv
.venv\Scripts\Activate.ps12. Install dependencies
python -m pip install --upgrade pip
python -m pip install -e .3. Configure environment
Copy .env.example to .env and set your token:
GITHUB_TOKEN=ghp_your_token_here
GITHUB_API_BASE_URL=https://api.github.com
GITHUB_API_VERSION=2022-11-28
GITHUB_USER_AGENT=github-prod-mcp/0.1.0
GITHUB_TIMEOUT_SECONDS=30
REST_HOST=127.0.0.1
REST_PORT=8080
LOG_LEVEL=INFORun the MCP server
python -m github_prod_mcp.mainRun the REST API
python -m github_prod_mcp.rest_apiREST docs will be available at:
http://127.0.0.1:8080/docshttp://127.0.0.1:8080/openapi.json
REST API design rule
All tool endpoints are exposed as POST endpoints under /tools/....
For tool execution:
no path variables
no query variables
inputs are passed in the JSON request body only
Examples:
Get repository
POST /tools/get_repository
Content-Type: application/json
{
"owner": "octocat",
"repo": "Hello-World"
}Get repository details
POST /tools/get_repository_details
Content-Type: application/json
{
"owner": "octocat",
"repo": "Hello-World",
"include_branches": true,
"include_root_files": true,
"include_readme": false
}List repository files
POST /tools/list_repository_files
Content-Type: application/json
{
"owner": "octocat",
"repo": "Hello-World",
"path": "",
"ref": "main"
}Get file content metadata
POST /tools/get_file_content
Content-Type: application/json
{
"owner": "octocat",
"repo": "Hello-World",
"path": "README.md",
"ref": "main"
}Create issue
POST /tools/create_issue
Content-Type: application/json
{
"owner": "octocat",
"repo": "Hello-World",
"title": "Bug report",
"body": "Something is broken"
}Trigger workflow dispatch
POST /tools/trigger_workflow_dispatch
Content-Type: application/json
{
"owner": "octocat",
"repo": "Hello-World",
"workflow_id": "ci.yml",
"ref": "main",
"inputs": {
"environment": "prod"
}
}Append to file
POST /tools/append_to_file
Content-Type: application/json
{
"owner": "octocat",
"repo": "Hello-World",
"path": "README.md",
"content": "\n\n## New Section\n\nThis content will be appended to the file.",
"message": "Append new section to README"
}MCP registration
Update .bob/mcp.json so Bob can launch the stdio server.
Example configuration:
{
"mcpServers": {
"github-prod-mcp": {
"command": "python",
"args": [
"-m",
"github_prod_mcp.main"
],
"cwd": "c:/Users/abdenourChenouf/Documents/MCP-Github/github-prod-mcp",
"env": {
"GITHUB_TOKEN": "YOUR_GITHUB_TOKEN",
"GITHUB_API_BASE_URL": "https://api.github.com",
"GITHUB_API_VERSION": "2022-11-28",
"GITHUB_USER_AGENT": "github-prod-mcp/0.1.0",
"GITHUB_TIMEOUT_SECONDS": "30",
"LOG_LEVEL": "INFO"
},
"disabled": false,
"alwaysAllow": [],
"disabledTools": []
}
}
}Production notes
Use a fine-grained GitHub token with least privilege
Rotate tokens regularly
Keep
.envout of source controlRun the REST API behind a reverse proxy for TLS and access control
Add request authentication in front of the REST API before internet exposure
Tune timeout and logging for your environment
Add tests before deploying to shared environments
Official API basis
This implementation follows GitHub REST API conventions including:
Accept: application/vnd.github+jsonAuthorization: Bearer <token>X-GitHub-Api-Version: 2022-11-28
Reference:
https://docs.github.com/en/rest
Available Tools
27 toolscompare_commitsD
Compare commits
Inputs: owner (required), repo (required), basehead (required).
create_issueD
Create an issue
Inputs: owner (required), repo (required), title (required), body, +3 more.
create_issue_commentC
Create an issue comment
Inputs: owner (required), repo (required), issue_number (required), body (required).
create_or_update_fileC
Create or update a repository file
Inputs: owner (required), repo (required), path (required), message (required), +5 more.
create_pull_requestC
Create a pull request
Inputs: owner (required), repo (required), title (required), head (required), +4 more.
create_repositoryC
Create a repository for the authenticated user
Inputs: name (required), description, homepage, private, +6 more.
create_repository_dispatchC
Create a repository dispatch event
Inputs: owner (required), repo (required), event_type (required), client_payload.
delete_fileC
Delete a repository file
Inputs: owner (required), repo (required), path (required), message (required), +4 more.
get_authenticated_userA
Get the authenticated GitHub user
Inputs: no named parameters.
get_branchC
Get a branch by name
Inputs: owner (required), repo (required), branch (required).
get_commitC
Get a commit
Inputs: owner (required), repo (required), ref (required).
get_file_contentC
Get repository file content metadata
Inputs: owner (required), repo (required), path (required), ref.
get_issueD
Get an issue
Inputs: owner (required), repo (required), issue_number (required).
get_pull_requestC
Get a pull request
Inputs: owner (required), repo (required), pull_number (required).
get_repositoryC
Get repository metadata
Inputs: owner (required), repo (required).
get_repository_detailsC
Get repository details including optional branches, root files, and README metadata
Inputs: owner (required), repo (required), include_branches, include_root_files, +1 more.
list_branchesC
List repository branches
Inputs: owner (required), repo (required).
list_issuesC
List repository issues
Inputs: owner (required), repo (required).
list_pull_requestsC
List pull requests
Inputs: owner (required), repo (required).
list_repository_filesC
List repository files or directory contents
Inputs: owner (required), repo (required), path, ref.
list_workflow_runsC
List workflow runs
Inputs: owner (required), repo (required), actor, branch, +4 more.
merge_pull_requestC
Merge a pull request
Inputs: owner (required), repo (required), pull_number (required), commit_title, +2 more.
search_codeD
Search code
Inputs: query (required), sort, order, per_page, +1 more.
search_issuesC
Search issues and pull requests
Inputs: query (required), sort, order, per_page, +1 more.
search_repositoriesD
Search repositories
Inputs: query (required), sort, order, per_page, +1 more.
trigger_workflow_dispatchD
Trigger a workflow dispatch
Inputs: owner (required), repo (required), workflow_id (required), ref (required), +1 more.
update_issueC
Update an issue
Inputs: owner (required), repo (required), issue_number (required), title, +6 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 27 tools
Most tools have distinct purposes, but get_repository and get_repository_details overlap with similar descriptions, and list_issues vs search_issues could cause confusion.
All tools follow verb_noun snake_case (e.g., create_issue, list_branches) with no mixing of conventions.
27 tools exceed the 25+ threshold for 'too many', making the surface heavier than ideal for most agents.
Covers core repository, issue, PR, and workflow operations, but lacks update_pull_request, create_branch, and detailed workflow management.
Maintenance
Related MCP Connectors
Create, deploy, and operate MCP servers directly from your GitHub repositories.
A MCP server built for developers enabling Git based project management with project and personal…
An MCP server that gives your AI access to the source code and docs of all public github repos
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
1
Related MCP Servers
- -licenseNot gradedqualityBmaintenanceMCP Server for the GitHub API, enabling file operations, repository management, search functionality, and more.127,455 npm91,952MIT
- FlicenseNot gradedqualityDmaintenanceStandalone MCP server for GitHub that enables repository management, branch operations, pull request handling, and commit retrieval via tools listed in the README.1-
- AlicenseBqualityBmaintenanceA secure MCP server for interacting with GitHub issues, pull requests, repository files, and search, supporting both github.com and GitHub Enterprise Server.26AGPL 3.0
- AlicenseNot gradedqualityBmaintenanceMCP server providing maximum practical control over GitHub via REST and GraphQL APIs, exposing 22 tools for repository management, file operations, issues, PRs, Actions, and more.MIT