Direct answer
The GitHub MCP server is GitHub's official MCP server. It lets an AI agent such as Claude Code, Cursor or Codex read code and manage issues, pull requests and Actions workflows in your repositories. It is free on every GitHub plan. Add the hosted URL https://api.githubcopilot.com/mcp/ with a personal access token.
Published 29 November 2026, written and reviewed by the Better Design team. Sources: GitHub's docs, the github-mcp-server README, install guides and release notes, its most discussed issues, and our own test of the hosted server.
Summary
- What it is
- An MCP server that GitHub builds and maintains, open source under the MIT license.
- Price
- Free on every GitHub plan. Tools for paid features, such as Copilot cloud agent or code scanning, still need that plan.
- Two ways to run it
- Hosted by GitHub at https://api.githubcopilot.com/mcp/, or locally with Docker or the Go binary.
- Sign-in
- VS Code and other Copilot editors use OAuth. Claude Code, Cursor, Codex and Windsurf need a personal access token for the hosted server.
- Size
- The default set gave our agent 46 tools; all toolsets gave 116. Pick toolsets to keep the list short.
- Safety
- Add /readonly to the URL to block writes, and turn on lockdown mode for public repositories.
What is the GitHub MCP server?
MCP, the Model Context Protocol, is a standard way for an AI agent to call outside tools. The GitHub MCP server is GitHub's own server for that protocol. Once it is connected, you can ask your agent to find a function in a repo or open an issue. It can also review a pull request or explain why a workflow run failed. The agent calls the GitHub API with your permissions.
The search "github mcp" can also mean the GitHub MCP Registry at github.com/mcp. That is a directory of MCP servers from many vendors, not the server itself. This guide covers the server.
Is GitHub MCP free?
Yes. GitHub's docs say the server is available to all GitHub users regardless of plan type. You pay nothing for the server itself. Some tools reach features that cost money: Copilot cloud agent needs a paid Copilot plan, and code scanning on private repositories needs GitHub Advanced Security. Calls also count toward your GitHub API rate limit, which is 5,000 requests per hour for a user token.
Some organizations pay for Copilot Business or Copilot Enterprise. There, an admin must turn on the "MCP servers in Copilot" policy before members can use it in Copilot editors. That policy is off by default. It does not govern third-party tools such as Claude Code or Cursor.
Should you use the remote or the local server?
Use the remote GitHub MCP server unless you have a reason not to. GitHub hosts it, keeps it updated, and it needs no Docker. It also has tools the local server lacks, such as handing a task to Copilot cloud agent and searching GitHub's support docs.
- Pick remote for github.com and GitHub Enterprise Cloud, including ghe.com data residency.
- Pick local for GitHub Enterprise Server, which cannot use the hosted server, or when your host has no remote MCP support.
- Pick local to sign in with OAuth from a host that cannot do OAuth with the hosted server. The official Docker image opens a browser login on first use and keeps the token in memory only.
How do you set up authentication for the GitHub MCP server?
Copilot editors handle authentication with OAuth. Every other host needs a personal access token. To create one:
- Open github.com/settings/personal-access-tokens/new.
- Choose a fine-grained token, name it, and set an expiry date.
- Under Repository access, pick only the repositories the agent should see.
- Grant read access to Contents, Issues, Pull requests and Metadata. Add write access only for actions you want the agent to take.
- Generate the token and store it in an environment variable, such as GITHUB_PAT, not in a file you commit.
A classic token works too. The README lists repo, read:org and read:packages as the usual scopes. With a classic token, the server hides tools your scopes cannot use. With a fine-grained token, it shows every tool, and GitHub refuses calls you lack permission for.
How does GitHub MCP server setup work in each tool?
Every host below connects to the same hosted URL. Only the sign-in and the config files differ. Commands come from GitHub's install guides, read 29 November 2026.
VS Code and Copilot
Use VS Code 1.101 or later. Click Install Server in the README, or add a server with "type": "http" and the URL https://api.githubcopilot.com/mcp/ to your MCP settings. VS Code signs you in with OAuth, so no token is needed. Switch Copilot Chat to Agent mode and the tools appear. In Copilot CLI the server is built in.
Claude Code
Run this in your terminal, not inside a Claude Code session: claude mcp add-json github '{"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{"Authorization":"Bearer YOUR_GITHUB_PAT"}}'. Add --scope user to use it in every project. Restart Claude Code and check it with claude mcp list. On Claude Code 2.1.0 or earlier, use claude mcp add --transport http with the same URL and an -H header instead.
Cursor
Add a github entry under mcpServers in ~/.cursor/mcp.json with "url": "https://api.githubcopilot.com/mcp/" and a headers object holding "Authorization": "Bearer YOUR_GITHUB_PAT". Cursor 0.48.0 or later is needed. GitHub's guide says Cursor cannot use OAuth with this server yet, so the token is required. Restart Cursor after you save.
Codex
Run codex mcp add github --url https://api.githubcopilot.com/mcp/ --bearer-token-env-var GITHUB_PAT_TOKEN, then export GITHUB_PAT_TOKEN in your shell. The same entry lands in ~/.codex/config.toml, which the Codex CLI and the IDE extension share.
Any host, locally with Docker
Point the host at the command docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server and pass your token in the GITHUB_PERSONAL_ACCESS_TOKEN variable. Leave the token out to use the browser login instead; publish port 127.0.0.1:8085 so the login can return.
What tools does the GitHub MCP server have?
With nothing configured, the server loads five toolsets: context, repos, issues, pull_requests and users. On 29 November 2026 we connected to the hosted server and listed its tools. We used a token with the repo, read:org, gist and workflow scopes.
- Default URL, /mcp/
- 46 tools, 127 KB of tool definitions.
- Read-only default, /mcp/readonly
- 28 tools, 75 KB.
- Repos only, /mcp/x/repos
- 19 tools, 41 KB.
- Issues only, /mcp/x/issues
- 10 tools, 35 KB.
- Actions only, /mcp/x/actions
- 4 tools, 12 KB.
- Everything, /mcp/x/all
- 116 tools, 330 KB.
Your agent reads those definitions before it starts work. Assume a rough 4 characters a token; we did not measure tokens. Then the default set costs about 32,000 tokens of context, and the full set about 80,000. The other toolsets cover Actions, code security, Dependabot, discussions, gists, labels, notifications, organizations, projects, secret protection and more.
How do you choose GitHub MCP toolsets or make it read-only?
On the hosted server, each toolset has its own URL: https://api.githubcopilot.com/mcp/x/issues loads only issue tools. Add /readonly to any URL to drop every write tool. Headers do the same job. Send X-MCP-Toolsets with a list such as repos,issues, or X-MCP-Tools for single tools. Send X-MCP-Readonly: true for read-only.
To configure the local server, set GITHUB_TOOLSETS="repos,issues,pull_requests" or pass --toolsets. Use default,actions to keep the defaults and add one. Set GITHUB_READ_ONLY=1 and read-only mode is enabled; it wins even over a write tool you list by name.
Is the GitHub MCP server safe to use?
The server can do anything your token can do, so the token is the real limit. Give it only the repositories and permissions the job needs, and use read-only mode when the agent only has to look.
The bigger risk is prompt injection. An issue or comment on a public repository can contain text written to steer your agent. Lockdown mode reduces this: it hides content from authors without push access to the repository. GitHub calls it a best-effort filter, not a security boundary. Turn it on with GITHUB_LOCKDOWN_MODE=1 locally or the X-MCP-Lockdown header on the hosted server.
For public repositories, and private ones with GitHub Advanced Security, push protection also blocks secrets in what the agent writes through the server.
Why won't the GitHub MCP server connect?
These are the problems people raise most on the github-mcp-server issue tracker, with the fix for each.
- "Does not support dynamic client registration" in Claude Code
- The hosted server cannot do OAuth with Claude Code. Use a personal access token in the Authorization header.
- claude.ai custom connector fails or loads few tools
- Its form has no field for a token or a toolset header. Use Claude Code or Claude Desktop with a token instead.
- Private organization repositories are missing
- With OAuth, an organization admin may need to approve the app. With a fine-grained token, set the organization as the resource owner.
- "Invalid input" from claude mcp add-json on Windows
- Use the claude mcp add --transport http form.
- Docker pull errors
- The image is public. Run docker logout ghcr.io to clear an expired login.
- The agent picks the wrong tool
- You loaded too many. Switch to the toolsets you need.
Read the issue on Claude Code and dynamic client registration.
What changed in the GitHub MCP server in November 2026?
- 2.1.0, 3 November
- Dependency updates and fixes.
- 2.2.0, 16 November
- Workflow skills, such as pull request review and workflow failure triage, can replace the server instructions. They are off by default; turn them on with --features=skills.
- 2.3.0, 24 November
- Tools to update Dependabot, code scanning and secret scanning alerts, and experimental pull request artifact tools.
What are the alternatives to the GitHub MCP server?
- The gh CLI
- Agents that run shell commands, such as Claude Code and Codex, can call gh directly. It loads no tool list, so it costs no context until it runs.
- Docker MCP Toolkit
- Runs the GitHub server and others from one gateway on your machine.
- Built-in Git tools
- Every coding agent can commit, branch and diff locally without any MCP server. You need the GitHub server for issues, pull requests, Actions and code search across repos.
Frequently asked questions
No. It talks only to GitHub: github.com, GitHub Enterprise Cloud and, locally, GitHub Enterprise Server.
No. Any MCP host with a GitHub account works. You need Copilot only for the Copilot tools, such as assigning an issue to Copilot cloud agent.
No. It gives the agent your code and tickets, not design rules. We make Better Design, an MCP server for Claude Code, Cursor and Codex that adds design systems, design guides and review checks. Pick it if your agent builds product UI; skip it for backend-only repositories.
See how to add Better Design to Claude Code.
Read what MCP is and how it works.
Read our guide to MCP security.
Prices, setup commands, toolsets and release dates were checked 29 November 2026 against GitHub's docs and the github-mcp-server repository. Tool counts were measured that day on the hosted server and change as GitHub adds tools, so recheck before you rely on them.
