GitHub MCP Server
Lets an agent read code, manage issues and pull requests, and check Actions runs and security alerts in your GitHub repositories.
Install
-
Claude Code (remote, GitHub-hosted)
claude mcp add-json github '{"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{"Authorization":"Bearer YOUR_GITHUB_PAT"}}'For Claude Code 2.1.1 and newer. For read-only tools, use https://api.githubcopilot.com/mcp/readonly instead.
-
Claude Code (local, Docker)
claude mcp add github -e GITHUB_OAUTH_CALLBACK_PORT=8085 -- docker run -i --rm -p 127.0.0.1:8085:8085 -e GITHUB_OAUTH_CALLBACK_PORT ghcr.io/github/github-mcp-serverSigns in with OAuth in the browser on first use and keeps the token in memory.
GitHub’s own MCP server. It gives an agent the GitHub API as tools: browse and search code, open and review pull requests, triage issues, read Actions logs and look at Dependabot and code-scanning alerts. GitHub hosts one version for you, and you can also run it locally in Docker or as a binary.
When to use it
- You want an agent to open a PR, answer review comments, or work out why a CI run failed.
- You triage issues across several repos and want them summarized or labeled.
- You want code search across repos you can access, not only the one that’s checked out.
Before you install
- The server can do anything your token can do. Use a fine-grained token scoped to the repos
you need, or the
/readonlyURL (there’s one for each toolset). - Enable only the toolsets you need (
--toolsetslocally,/x/<toolset>URLs remotely). Fewer tools means less context used and fewer ways to go wrong. - Issue and PR text from public repos can contain prompt injection.
--lockdown-modehides content from authors without push access. GitHub says it is a best-effort filter, not a security boundary.
- Publisher
- GitHub
- Works with
- Claude Code, Claude apps, Cursor, Codex, Any agent
- Categories
- DevOps & observability, Backend & APIs, MCP & integrations
- License
- MIT
- Cost
- Free