GitHub MCP, read PRs, issues, code from any repo
Official GitHub MCP server gives Claude direct access to PRs, issues, code search, and review workflows. Hosted remote (api.githubcopilot.com/mcp) or local Docker. 19 toolsets.
GitHub MCP
The official github/github-mcp-server is the most polished MCP server for any third-party service. It exposes 19 toolsets organized by area: repositories, issues, pull_requests, actions, code_security, context, copilot, dependabot, discussions, gists, git, labels, notifications, organizations, projects, secret_protection, security_advisories, stargazers, users. Each toolset can be enabled or disabled with the --toolsets flag.
There are two ways to install it. The hosted remote (api.githubcopilot.com/mcp/) works with Claude Code, Cursor, and VS Code 1.101+. The local Docker image (ghcr.io/github/github-mcp-server) is needed for Claude Desktop, which does not yet support OAuth connectors for GitHub MCP.
The hosted remote URL is free with any GitHub account, the "copilot" in the domain name does not mean you need a Copilot subscription.
Schritt 1: Create a GitHub Personal Access Token
Go to https://github.com/settings/tokens?type=beta (fine-grained tokens). Create a token with:
- Repository access: the repos you want Claude to see (or "All repositories" if you trust your client)
- Permissions: Contents (Read), Issues (Read/Write), Pull requests (Read/Write), Metadata (Read)
Copy the token (it starts with github_pat_). You only see it once.
For more access (private orgs, etc.) use a classic PAT with repo scope.
Step 2a: Install via hosted remote (Claude Code, fastest path)
No Docker, no images to keep up-to-date. One command:
claude mcp add --transport http github https://api.githubcopilot.com/mcp \
--header "Authorization: Bearer github_pat_xxxxxxxxxxxxxxx"
This is the official syntax from code.claude.com/docs/en/mcp. Works with both fine-grained PATs (github_pat_*) and classic PATs (ghp_*).
Step 2b: Install via Docker (Claude Desktop or local-only)
If you are on Claude Desktop, or you want everything to run locally, use the Docker image:
claude mcp add github -s user \
-e GITHUB_PERSONAL_ACCESS_TOKEN=github_pat_xxxxxxxxxxxxxxx \
-- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server
The -e flag in claude mcp add passes the env var to the docker container.
For Claude Desktop directly, edit claude_desktop_config.json (Mac: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\, Linux: ~/.config/Claude/):
{
"mcpServers": {
"github": {
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "github_pat_xxxxxxxxxxxxxxx"
}
}
}
}
Schritt 2: Codex equivalent
In ~/.codex/config.toml:
[mcp_servers.github]
command = "docker"
args = ["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"]
[mcp_servers.github.env]
GITHUB_PERSONAL_ACCESS_TOKEN = "github_pat_xxxxxxxxxxxxxxx"
Schritt 3: Verify
Run academy_validate_step, checks for github in claude mcp list. Then prove it works:
In a fresh Claude Code session:
"list the open issues in anthropics/claude-code"
Claude calls list_issues on the GitHub MCP server. You get the latest 30 issues with titles, authors, labels.
Schritt 4: Three killer workflows
Now that GitHub is wired up, three workflows pay off immediately:
1. Triage your inbox of PR notifications:
"what PRs from <my-org> need my review and what are they about?"
Claude calls list_pull_requests filtered to the user, then pull_request_read on each, then summarizes.
2. Search code across repos you can read:
"show me how the studiomeyer-io org handles MCP server OAuth"
Claude calls search_code, much faster than git clone + grep.
3. Auto-draft PR descriptions from a diff:
"draft a PR description from the diff of feature-x → main, focused on the why"
Claude reads the diff via get_commit and the writing-voice rules from your CLAUDE.md.
Schritt 5: Avoid the rate-limit footgun
The GitHub API has tight rate limits per token. If Claude does 30 sequential API calls in one prompt you can hit the wall. Two mitigations:
- Use
minimal_output: trueparameter forlist_*tools, strips out boilerplate fields. - Use
search_*overlist_*+ filter, search returns ranked results in one call instead of paginating.
Add to CLAUDE.md:
## GitHub MCP usage
When using the github MCP server, prefer search_* over list_* + manual filter,
and use minimal_output: true for broad queries. Each tool call counts against
the PAT's rate limit (5000/hour for fine-grained, less for some endpoints).
You now have all five core MCP servers: First MCP, Memory, Web Research, Code Intel, GitHub. Phase 3 onwards uses them, basic workflows in Phase 3, deep memory tricks in Phase 4, daily rituals in Phase 5.
claude mcp list 2>&1 | grep -i "github" | head -3