GitHub MCP Server
Published · Updated
At a glance
- Category
- Code & Git
- GitHub repository
- github/github-mcp-server
- Watch out for
- Turning on every toolset adds a lot of tools, which costs context and makes tool selection less reliable. Start small.
This is GitHub's own MCP server, written in Go and maintained in the github/github-mcp-server repository. It replaced the early reference implementation that lived in the modelcontextprotocol/servers repo, so if you followed an older tutorial that used an npm package for GitHub, that package is no longer the one to install.
The server gives an agent access to the GitHub API through a set of grouped tools: reading code and files, searching repositories, opening and commenting on issues, creating and reviewing pull requests, checking Actions runs, and reading security alerts. Most people never need all of it. The useful idea in this server is toolsets: you switch on only the groups you need, which keeps the tool list short and the model less likely to pick the wrong tool.
You can run it in one of two ways. GitHub hosts a remote version at api.githubcopilot.com/mcp, which handles OAuth for clients that support it and is the least work to set up. Or you run the binary or Docker image yourself with a personal access token. The local route is the only option for GitHub Enterprise Server, which the hosted endpoint does not support.
How it connects
Your AI app
An assistant or agent that supports MCP
GitHub MCP Server
Runs as
- Docker
- Remote (HTTP)
Gives the agent
- Toolsets you can switch on and off
- Pull request work
- Actions and CI insight
- Read-only mode
- Lockdown mode
GitHub
Signs in with
- OAuth / browser sign-in
- Token
What it can do
- Toolsets you can switch on and off
- Tools are grouped into toolsets such as repos, issues, pull_requests, actions, code_security, dependabot, discussions, notifications and projects. With no configuration you get the default set: context, repos, issues, pull_requests and users. Set GITHUB_TOOLSETS to change that, or use "all" if you really want everything.
- Pull request work
- The agent can read diffs, list changed files, leave review comments, create pull requests and update branches. This is where most people get value: asking for a summary of a large PR, or having the agent open a PR after it finishes a change.
- Actions and CI insight
- With the actions toolset enabled, the agent can list workflows and workflow runs and read job logs, including only the failed jobs. Pointing it at a red build and asking why it failed saves a lot of clicking through log pages.
- Read-only mode
- The --read-only flag drops every write tool, even ones you request explicitly. It is the sensible default for exploring a codebase or answering questions about issues.
- Lockdown mode
- Lockdown mode withholds content written by users who do not have push access to the repository, with an exception for trusted bots, currently github-actions[bot] and copilot. GitHub describes it as a best-effort filter, not a security boundary. It exists to reduce prompt injection through issue and comment text on public repositories.
Setting it up
Remote (simplest): add an HTTP server pointing at https://api.githubcopilot.com/mcp/. In VS Code 1.101 or later this works with OAuth; in other clients you can send a personal access token as an Authorization: Bearer header. Local: run the Docker image ghcr.io/github/github-mcp-server with GITHUB_PERSONAL_ACCESS_TOKEN set, for example with Claude Code: claude mcp add github -e GITHUB_PERSONAL_ACCESS_TOKEN=$GITHUB_PAT -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server. Use a fine-grained token scoped to the repositories you actually want the agent to touch, and add GITHUB_TOOLSETS to limit the tool list.
Where each client keeps its MCP config file, and the JSON it expects (cheat sheet)
Where it helps
- Getting a plain-English summary of a long pull request before you review it line by line
- Asking why the latest Actions run failed and getting the relevant log lines back
- Triaging new issues: labelling, asking for missing reproduction steps, linking duplicates
- Having a coding agent open a pull request when it has finished a change locally
- Reviewing open Dependabot and code scanning alerts across a repository
Limitations and things to watch
- Turning on every toolset adds a lot of tools, which costs context and makes tool selection less reliable. Start small.
- The token is the real permission boundary. A classic token with broad repo scope lets the agent push, merge and close anything it can see.
- GitHub Enterprise Server users must run the local server; the hosted endpoint only covers github.com and GitHub Enterprise Cloud.
- Issue and PR text on public repositories is untrusted input. Lockdown mode helps, but read-only mode is the safer choice for public projects.
Sources
Written from the project's own documentation, checked November 2026.
- github.com /github/github-mcp-server
- github.com /github/github-mcp-server/blob/main/docs/server-configuration.md
- docs.github.com /en/copilot/how-tos/provide-context/use-mcp/use-the-github-mcp-server
How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.
Video
From our YouTube channel. The player loads from YouTube only when you press play.