GitHub MCP server: how to set it up
The GitHub MCP Server is GitHub's official MCP server. It lets an AI agent work with repositories, issues and pull requests, and it runs as a server hosted by GitHub or as a local one. We have not run it against a GitHub account; these steps come from its README and Claude Code's docs, read 2026-10-26.
Checked by Agentic Weekly's editorial process: vendor docs re-read.
Last verified: 2026-10-26 (America/Chicago) · Versions covered: github-mcp-server 2.0.3 (released 2026-10-21); README on the default branch and Claude Code MCP docs, both read 2026-10-26 · Evidence: Reported (see “What we tested”)
What the GitHub MCP server does
This page is about GitHub's own server, github/github-mcp-server. If you want an agent to work on a repository on your own disk instead, see Git MCP server: setup and what we tested, which is a different, reference server.
The README (read 2026-10-26) says the server connects AI tools to GitHub's platform so they can read repositories and code files, manage issues and pull requests, analyze code and automate workflows. Its tools are grouped into toolsets, and the README says enabling only the toolsets you need can help the model choose tools and reduce context size. Our tool page lists the license as MIT (checked 2026-10-25); the README's License section says the same. For the basics, read What is an MCP server?.
We have not run it. We have not used it with a GitHub account, a token or any client, so everything below is Reported.
Get the weekly brief: which AI tools to update, try or skip. Free.
Free. Unsubscribe anytime. No spam. We email a confirmation link first. Privacy
Remote or local: which to pick
| Attribute | Remote server | Local server |
|---|---|---|
| Where it runs | Hosted by GitHub, at the URL https://api.githubcopilot.com/mcp/ (the address Claude Code's docs use) | On your machine, in Docker (image ghcr.io/github/github-mcp-server) or built from source |
| How you authenticate | OAuth where your host app supports it, or a personal access token (PAT) in an Authorization header | OAuth on github.com (browser flow), or a PAT in GITHUB_PERSONAL_ACCESS_TOKEN, which takes precedence over OAuth |
| Needs Docker | No (README does not list it) | Yes for the container route; the README also has a build-from-source section |
| Needs a recent client | A host with remote-server support, such as VS Code 1.101 or newer, Claude Desktop, Cursor or Windsurf | A host that can start a local command (our reading of the README) |
| Works offline | Not verified | Not verified |
| GitHub Enterprise | Enterprise Cloud with data residency (ghe.com) can use the remote server; Enterprise Server does not support remote hosting | Enterprise Server and ghe.com need your own OAuth app or GitHub App for login; see the README's enterprise section |
| Evidence | Reported | Reported |
Source: README and Claude Code MCP docs, read 2026-10-26. The README says that if your host does not support remote servers, you can use the local server instead.
Set it up in Claude Code
Claude Code's docs (read 2026-10-26) show the remote server added with a PAT header. Replace YOUR_GITHUB_PAT with your own token and never paste a real token into a shared file or a chat. The docs suggest a fine-grained token with access to only the repositories you want Claude to work with.
claude mcp add --transport http github https://api.githubcopilot.com/mcp/ \
--header "Authorization: Bearer YOUR_GITHUB_PAT"For the local Docker server, the README's token-handling section shows this command, where GITHUB_PAT is an environment variable you have set to your token:
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-serverThen run /mcp inside Claude Code and check that the github row shows a checkmark. For the general commands and scopes, see Add an MCP server to Claude Code.
Evidence: Reported. We did not run either command. Source: README and Claude Code MCP docs, read 2026-10-26.
Set it up in VS Code, Cursor and other clients
| Client | Transport | Where to look | Source and date | Run by us? |
|---|---|---|---|---|
| Claude Code (remote) | HTTP | The claude mcp add --transport http command above | Claude Code MCP docs, read 2026-10-26 | No |
| Claude Code (local, Docker) | stdio | The claude mcp add ... docker run command above | README, read 2026-10-26 | No |
| VS Code | HTTP (remote) or Docker (local) | Install buttons in the README; the README says remote needs VS Code 1.101 or newer | README, read 2026-10-26 | No |
| Cursor, Claude Desktop, Windsurf, Zed, Codex, OpenCode, others | Varies | Per-host installation guides linked from the README's "Install in other MCP hosts" list | README, read 2026-10-26 | No |
The README adds that each host needs to configure an OAuth or GitHub App to support OAuth, that any host with remote-server support should work with PAT authentication, and that support levels vary, so read your host's own documentation.
Authenticate: OAuth or a personal access token
- OAuth: on github.com the local server's one-click install logs you in in a browser on first use, and the README says the token is kept in memory only (README, read 2026-10-26).
- Personal access token: set
GITHUB_PERSONAL_ACCESS_TOKEN(local) or send anAuthorization: Bearerheader (remote). The README says it takes precedence over OAuth on the local server. - Token scopes: the README's token-security list names
repo(repository operations),read:packages(Docker image access) andread:org(organization team access) and says to grant only what is necessary. We do not add scopes the README does not list; GitHub's own token documentation covers fine-grained permissions and we have not verified them. - Handling: the README suggests storing the token in an environment variable, keeping
.envfiles out of version control, using separate tokens per project, rotating them, and restricting permissions on config files that hold tokens.
Limit what the agent can do
| Control | Flag or setting | Effect per the README | Run by us? |
|---|---|---|---|
| Read-only mode | --read-only, or GITHUB_READ_ONLY=1 with Docker | Offers only read-only tools, preventing modifications to repositories, issues and pull requests | No |
| Toolsets | --toolsets repos,issues,... or the GITHUB_TOOLSETS variable | Enables only the groups you list; the variable wins if both are set; with none specified, the default toolsets are used | No |
| Individual tools | A tools allow-list (see the README's Specifying Individual Tools section) | Enables named tools, and can be combined with toolsets | No |
| Lockdown mode | --lockdown-mode, or GITHUB_LOCKDOWN_MODE=1 | A content filter for public repositories, meant to reduce prompt-injection risk (the README calls it a partial measure). The README says it is not an authorization boundary and does not change what your credential can read or write | No |
| Token scopes | See the section above | Limits what the credential can do on GitHub | No |
Source: README, read 2026-10-26. We have not tested whether these flags change the tools offered.
Check it works and fix common failures
| Symptom | Likely cause | Fix | Source |
|---|---|---|---|
claude mcp add succeeds but the server fails later | claude mcp add saves the configuration without checking credentials, so a placeholder token is accepted | Run /mcp; a checkmark means connected, an X shows the failure and its HTTP status. Replace the token and add the server again. | Claude Code MCP docs, read 2026-10-26 |
The server is marked failed after you set an Authorization header | Claude Code reports a connection as failed when the server rejects a header you configured, rather than falling back to OAuth | Check the token is valid for the MCP endpoint, or remove the header to use OAuth if the server supports it. | Claude Code MCP docs, read 2026-10-26 |
| Docker cannot pull the image | The image is public; an expired token for the registry can cause errors on pull | Run docker logout ghcr.io and pull again. | README, read 2026-10-26 |
| A host app cannot read the token from an environment variable | Environment variable support varies by host app; the README says some apps, such as Windsurf, need the token in the config file | Check your host's documentation; if you must put a token in a file, restrict that file's permissions. | README, read 2026-10-26 |
What we tested
Evidence: Reported (not run by us). We have not run the GitHub MCP server for this guide.
- What we ran: nothing. No server start, no tool listing and no GitHub account or token was used.
- Reported, from the README and Claude Code docs: every command and setting on this page.
- Not tested: remote and local server behaviour, OAuth login, token permissions, read-only and toolset flags, tool counts, and whether any client can use the tools.
| Section | Evidence | Source |
|---|---|---|
| Remote or local | Reported | README, read 2026-10-26 |
| Claude Code commands | Reported | Claude Code MCP docs and the README, read 2026-10-26 |
| Authentication and scopes | Reported | README, read 2026-10-26 |
| Access controls | Reported | README, read 2026-10-26 |
Related tools
- GitHub MCP Server: GitHub's official MCP server for repos, issues and pull requests. Tested (smoke test, 2026-10-26, no LLM involved).
- Claude Code: Update now if you use the sandbox or run Claude Code on a cloud provider; skip if you wanted flashy new features, this is a hardening release. Tested (smoke test, 2026-10-25, local Qwen2.5-3B-Instruct, not vendor models).
FAQ
How do I set up the GitHub MCP server in Claude Code?
Claude Code's docs (read 2026-10-26) give claude mcp add --transport http github https://api.githubcopilot.com/mcp/ --header "Authorization: Bearer YOUR_GITHUB_PAT". Replace the placeholder with your own token. We have not run this command.
Do I need a personal access token for the GitHub MCP server?
Not always. The README says the local server can log in with OAuth on github.com, and that a token in GITHUB_PERSONAL_ACCESS_TOKEN takes precedence. Claude Code's docs example for the remote server uses a token header. We have not tested either.
What is the difference between the remote and local GitHub MCP server?
The remote server is hosted by GitHub and needs a host that supports remote servers. The local server runs on your machine, normally in Docker, and works with hosts that can start a local command. Both are Reported here, not run by us.
Is the GitHub MCP server free?
The server is open source under the MIT license (README, read 2026-10-26). Whether the GitHub features you reach need a paid plan is a separate question that we have not checked, so we do not state prices here.
Can I make the GitHub MCP server read-only?
Per the README, yes: start it with --read-only, or set GITHUB_READ_ONLY=1 when using Docker, and it offers only read-only tools. This is from the README, read 2026-10-26; we have not run it.
Have you tested the GitHub MCP server?
No. We have not run the GitHub MCP server against any account, so this guide is Reported from its README and Claude Code's docs, read 2026-10-26. We do not claim any behaviour we have not seen.
Sources
- GitHub MCP Server README (github/github-mcp-server) (fetched 2026-10-26)
- Claude Code MCP docs: connect to GitHub for code reviews (fetched 2026-10-26)
Related
Page history
- : First published. README and Claude Code docs read on this date; nothing was run.
Markdown version for agents: /guides/github-mcp-server.md
Free · weekly · about six minutes
Get The Weekly Verdict, free
What shipped this week, what is worth switching to, and what to ignore. We run what we can and label what we only read.
- One email a week. Each release gets one call: update now, worth a look, or skip.
- Every claim shows its evidence. Reported means we read the sources; Tested means we ran it, with the exact scope and the failures left in.
- A free AI Tools Cheat Sheet (web page and printable PDF) lands in your inbox when you confirm.
Free. Unsubscribe anytime. No spam. We email a confirmation link first and add you only after you click it. We use your email only to send this newsletter and never sell it. Privacy