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.

Remote or local: which to pick

Remote and local GitHub MCP server, per the README
AttributeRemote serverLocal server
Where it runsHosted 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 authenticateOAuth where your host app supports it, or a personal access token (PAT) in an Authorization headerOAuth on github.com (browser flow), or a PAT in GITHUB_PERSONAL_ACCESS_TOKEN, which takes precedence over OAuth
Needs DockerNo (README does not list it)Yes for the container route; the README also has a build-from-source section
Needs a recent clientA host with remote-server support, such as VS Code 1.101 or newer, Claude Desktop, Cursor or WindsurfA host that can start a local command (our reading of the README)
Works offlineNot verifiedNot verified
GitHub EnterpriseEnterprise Cloud with data residency (ghe.com) can use the remote server; Enterprise Server does not support remote hostingEnterprise Server and ghe.com need your own OAuth app or GitHub App for login; see the README's enterprise section
EvidenceReportedReported

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.

Remote server (from the Claude Code docs)
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:

Local server in Docker (from the README)
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

Then 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

Setup by client, per the README
ClientTransportWhere to lookSource and dateRun by us?
Claude Code (remote)HTTPThe claude mcp add --transport http command aboveClaude Code MCP docs, read 2026-10-26No
Claude Code (local, Docker)stdioThe claude mcp add ... docker run command aboveREADME, read 2026-10-26No
VS CodeHTTP (remote) or Docker (local)Install buttons in the README; the README says remote needs VS Code 1.101 or newerREADME, read 2026-10-26No
Cursor, Claude Desktop, Windsurf, Zed, Codex, OpenCode, othersVariesPer-host installation guides linked from the README's "Install in other MCP hosts" listREADME, read 2026-10-26No

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 an Authorization: Bearer header (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) and read: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 .env files 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

Access controls, per the README
ControlFlag or settingEffect per the READMERun by us?
Read-only mode--read-only, or GITHUB_READ_ONLY=1 with DockerOffers only read-only tools, preventing modifications to repositories, issues and pull requestsNo
Toolsets--toolsets repos,issues,... or the GITHUB_TOOLSETS variableEnables only the groups you list; the variable wins if both are set; with none specified, the default toolsets are usedNo
Individual toolsA tools allow-list (see the README's Specifying Individual Tools section)Enables named tools, and can be combined with toolsetsNo
Lockdown mode--lockdown-mode, or GITHUB_LOCKDOWN_MODE=1A 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 writeNo
Token scopesSee the section aboveLimits what the credential can do on GitHubNo

Source: README, read 2026-10-26. We have not tested whether these flags change the tools offered.

Check it works and fix common failures

GitHub MCP server problems and fixes
SymptomLikely causeFixSource
claude mcp add succeeds but the server fails laterclaude mcp add saves the configuration without checking credentials, so a placeholder token is acceptedRun /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 headerClaude Code reports a connection as failed when the server rejects a header you configured, rather than falling back to OAuthCheck 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 imageThe image is public; an expired token for the registry can cause errors on pullRun docker logout ghcr.io and pull again.README, read 2026-10-26
A host app cannot read the token from an environment variableEnvironment variable support varies by host app; the README says some apps, such as Windsurf, need the token in the config fileCheck 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.
Evidence by section
SectionEvidenceSource
Remote or localReportedREADME, read 2026-10-26
Claude Code commandsReportedClaude Code MCP docs and the README, read 2026-10-26
Authentication and scopesReportedREADME, read 2026-10-26
Access controlsReportedREADME, read 2026-10-26
  • 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

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