GitHub MCP Server
GitHub MCP Server
Python MCP (Model Context Protocol) server for GitHub operations, providing native tool integration with Claude Code and other MCP clients.
Features
16 GitHub Tools: Issues, PRs, CI status, milestones, and batch operations
Native MCP Integration: Works seamlessly with Claude Code
Structured Responses: Type-safe, well-formatted tool outputs
Batch Operations: Parallel execution for bulk operations
Environment-Based Config: Configure default repository via environment variables
Installation
From PyPI
pip install github-mcp-server
# or with uv
uvx github-mcp-serverFrom Source
git clone https://github.com/rriesco/github-mcp-server.git
cd github-mcp-server
uv syncConfiguration
Environment Variables
Variable | Required | Description |
| Yes | GitHub Personal Access Token with |
| No | Default repository owner for all operations |
| No | Default repository name for all operations |
Claude Code Configuration
Add to your MCP configuration (~/.config/claude-code/mcp-config.json):
{
"mcpServers": {
"github-manager": {
"type": "stdio",
"command": "uvx",
"args": ["github-mcp-server"],
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}",
"GITHUB_OWNER": "your-username",
"GITHUB_REPO": "your-repo"
}
}
}
}Getting a GitHub Token
Click "Generate new token (classic)"
Select scope:
repo(full repository access)Copy the generated token
Available Tools
Issue Operations
Tool | Description |
| Create one or more issues (parallel execution for multiple) |
| Get full issue details including body |
| Query issues with filtering (state, labels, milestone, assignee) |
| Close an issue with optional comment |
Pull Request Operations
Tool | Description |
| Create PR with structured content (problem, solution, changes) |
| Get PR details including mergeable status |
| Update PR title, body, base branch, or state |
| Merge PR with method selection (squash/merge/rebase) |
CI/CD Operations
Tool | Description |
| Check workflow run status for a branch |
| Get CI logs for debugging failed jobs |
Batch Operations
Tool | Description |
| Update multiple issues in parallel |
| Add labels to multiple issues |
| Link issues to GitHub Project (v2) |
Milestone Operations
Tool | Description |
| Create a milestone with optional due date |
| List milestones with filtering |
Usage Examples
Create an Issue
result = create_issues(
issues=[{
"title": "Implement feature X",
"body": "## Description\n\nDetails here...",
"labels": ["enhancement"],
"milestone": 1
}],
owner="your-username",
repo="your-repo"
)Check CI Status
result = check_ci_status(
branch="feature-branch",
owner="your-username",
repo="your-repo"
)Create a PR
result = create_pr_with_content(
title="feat: add new feature",
problem="Current behavior lacks X functionality",
solution="Implement X using approach Y",
key_changes="- Added X component\n- Updated Y module",
issue=42, # Optional: links to issue #42
owner="your-username",
repo="your-repo"
)Development
Prerequisites
Python >= 3.10
uv (recommended) or pip
GitHub Personal Access Token
Setup
git clone https://github.com/rriesco/github-mcp-server.git
cd github-mcp-server
uv syncRunning Tests
# Unit tests only (fast)
uv run pytest -m "not integration" -v
# Integration tests (requires GITHUB_TOKEN, TEST_OWNER, TEST_REPO)
uv run pytest -m integration -v
# All tests with coverage
uv run pytest --cov=src --cov-report=term-missingType Checking
uv run mypy src/github_mcp_server --strictArchitecture
Claude Code / MCP Client
|
| MCP Protocol (stdio)
v
┌─────────────────────────────┐
│ Python FastMCP Server │
│ - Tool Registry │
│ - PyGithub Client │
│ - Error Handling │
│ - Type Validation │
└─────────────┬───────────────┘
|
| PyGithub REST API
v
GitHub APIProject Structure
github-mcp-server/
├── src/github_mcp_server/
│ ├── server.py # Server entry point
│ ├── tools/
│ │ ├── issues.py # Issue operations
│ │ ├── pulls.py # PR operations
│ │ ├── ci.py # CI operations
│ │ ├── milestones.py # Milestone operations
│ │ └── batch_operations.py # Batch operations
│ ├── utils/
│ │ ├── github_client.py # Singleton PyGithub client
│ │ ├── errors.py # Structured error handling
│ │ └── types.py # Type definitions
│ └── config/
│ └── defaults.py # Environment-based defaults
└── tests/
├── test_*.py # Unit tests
└── integration/ # Integration testsLicense
MIT License - see LICENSE for details.
Links
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/rriesco/github-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server