Prepare the server locally
Run this once before adding it to Claude Code.
git clone https://github.com/software-engineer-mj/github-mcp.git
cd github-mcp
uv syncRegister it in Claude Code
claude mcp add -e "GITHUB_TOKEN=${GITHUB_TOKEN}" github-mcp -- uv run --directory /path/to/github-mcp python -m github_mcpReplace any placeholder paths in the command with the real path on your machine.
GITHUB_TOKENMake your agent remember this setup
github-mcp's config, env vars, and the gotchas you hit — recalled in every future Claude Code, Cursor, and Codex session.
npx conare@latestFree · one command · indexes the sessions already on disk. Set up in the browser instead →
What it does
- Comprehensive access to 87 GitHub API tools across 25 categories.
- Manage repositories, issues, pull requests, and project boards.
- Automate GitHub Actions workflows and release management.
- Support for branch protection rules and repository webhooks.
- Built with Python and the official Model Context Protocol SDK.
Tools 9
list_repositoriesList repositories for a user or organizationget_repositoryGet detailed repository informationcreate_repositoryCreate a new repositoryfork_repositoryFork a repositorylist_commitsList commits with optional filtersget_commitGet commit details including stats and changed filesget_file_contentsGet file contents or directory listinglist_issuesList issues with filtersget_issueGet detailed issue informationEnvironment Variables
GITHUB_TOKENrequiredGitHub Personal Access Token with required scopesTry it
Original README from software-engineer-mj/github-mcp
GitHub MCP Server
A comprehensive Model Context Protocol (MCP) server for the GitHub API, built with Python and the official MCP SDK.
This server exposes 87 tools across 25 categories, enabling AI agents like Claude to interact with GitHub repositories, issues, pull requests, discussions, projects, and more.
Features
| Category | Tools | Description |
|---|---|---|
| Repositories | 7 | List, get, create, fork repos; list commits; get commit details; get file contents |
| Issues | 6 | List, get, create, update issues; manage comments |
| Pull Requests | 8 | List, get, create, update, merge PRs; view files/commits; update branch |
| Search | 4 | Search repositories, code, issues, and users |
| Actions | 4 | List workflows/runs, trigger workflows, cancel runs |
| Releases | 4 | List, get latest, create releases; get release by tag |
| Tags | 2 | List tags, get annotated tag details |
| Git | 2 | Get repository tree, push multiple files in a single commit |
| Organizations | 3 | List orgs, get details, list members |
| Branches | 3 | List, create, delete branches |
| Branch Protection | 3 | Get, update, delete branch protection rules |
| Webhooks | 3 | List, create, delete repository webhooks |
| Files | 2 | Create/update and delete files via the Contents API |
| PR Reviews | 2 | Create and list pull request reviews |
| Review Comments | 3 | List, create, reply to PR review comments |
| Commit Statuses | 4 | List/create commit statuses; list/get check runs |
| Labels | 3 | List, create, delete repository labels |
| Gists | 4 | List, get, create, update gists |
| Stars | 3 | List starred repos, star/unstar repositories |
| Users | 2 | Get authenticated user info, get any user's profile |
| Notifications | 3 | List notifications, mark as read |
| Collaborators | 3 | List, add, remove repository collaborators |
| Discussions | 4 | List, get discussions; view comments; list categories (GraphQL) |
| Projects (Classic) | 2 | List repository and organization projects |
| Projects V2 | 3 | List, get projects; list project items (GraphQL) |
Requirements
- Python >= 3.10
- uv (recommended) or pip
- GitHub Personal Access Token
Installation
git clone https://github.com/software-engineer-mj/github-mcp.git
cd github-mcp
uv sync
Configuration
cp .env.example .env
Edit the .env file:
GITHUB_TOKEN=ghp_your_token_here
Token Permissions
Depending on which tools you use, your token needs these scopes:
| Scope | Required For |
|---|---|
repo |
Repositories, issues, PRs, branches, webhooks, collaborators, files, tags, git |
read:org |
Organizations, org members, org projects |
gist |
Gists |
notifications |
Notifications |
user |
Authenticated user info, starring |
workflow |
GitHub Actions (trigger, cancel) |
read:discussion |
Discussions |
project |
Projects (Classic), Projects V2 |
Usage
stdio (default)
uv run python -m github_mcp
Docker
docker build -t github-mcp .
docker run -e GITHUB_TOKEN=ghp_your_token github-mcp
MCP Client Configuration
Claude Desktop
Add to claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"github": {
"command": "uv",
"args": ["run", "--directory", "/path/to/github-mcp", "python", "-m", "github_mcp"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}
Claude Code
Add to .mcp.json:
{
"mcpServers": {
"github": {
"command": "uv",
"args": ["run", "--directory", "/path/to/github-mcp", "python", "-m", "github_mcp"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}
Development
# Install with dev dependencies
uv sync --dev
# Run tests
uv run pytest tests/ -v
# Lint
uv run ruff check src/ tests/
# Format
uv run ruff format src/ tests/
# Type check
uv run mypy src/
Tool Reference
Repositories
| Tool | Description |
|---|---|
list_repositories |
List repositories for a user or organization |
get_repository |
Get detailed repository information |
create_repository |
Create a new repository |
fork_repository |
Fork a repository |
list_commits |
List commits with optional filters (author, date range) |
get_commit |
Get commit details including stats and changed files |
get_file_contents |
Get file contents or directory listing |
Issues
| Tool | Description |
|---|---|
list_issues |
List issues with filters (state, labels, assignee) |
get_issue |
Get detailed issue informatio |