What Does the GitHub MCP Server Do and How Do You Set It Up?
The GitHub MCP server connects AI tools directly to GitHub’s platform through the Model Context Protocol (MCP). GitHub maintains this server. It replaced the archived Anthropic reference implementation in 2025. The server exposes repositories, issues, pull requests, file contents, branches, commits, and code search to any MCP-compatible client. Claude Desktop, Cursor, VS Code, Windsurf, Claude Code, and GitHub Copilot CLI all support it.
This guide covers what the GitHub MCP server exposes, which personal access token scopes to set for your specific workflow, how to configure it in Claude Desktop, Cursor, and VS Code, the tradeoff between the local Docker version and the remote hosted version, and the token cost realities that GitHub’s own documentation does not mention.
Full MCP server directory · All developer-tool MCP servers
What Does the GitHub MCP Server Expose?
The GitHub MCP server exposes repository operations to any MCP-compatible AI application: issues, pull requests, file contents, branches, commits, and code search across both public and private repositories.
The server registers 93 tool definitions organized into modular toolsets (Piotr Hajdas, dev.to, 2026). Each toolset covers a specific area of GitHub’s API surface:
- Repository intelligence exposes file reading, directory listing, commit history, and code search. The model can read any file at any ref (branch, tag, or commit SHA) and explore a repository’s full directory structure without cloning.
- Issue operations expose searching, creating, updating, closing, and labeling issues. The search supports GitHub’s full issue search syntax: filter by label, assignee, milestone, state, repository, and date.
- Pull request operations expose creating, reviewing, commenting on, and merging pull requests. The model can read diffs, examine changed files, and submit structured review comments.
- Branch and commit operations expose branch creation, commit listing, and diff viewing.
The server exposes these through MCP tools (actions the model can execute). It does not currently expose MCP resources (read-only data streams) or MCP prompts (reusable templates). All interaction happens through tool calls.
What Is the Difference Between the Archived Anthropic Version and the Current GitHub-Maintained Version?
Anthropic published the original GitHub MCP server as a reference implementation in November 2024. GitHub replaced it with a vendor-maintained version in 2025, and the Anthropic version was archived with no further security updates.
The archived server is at modelcontextprotocol/servers under the servers-archived directory. The current server is at github/github-mcp-server. Tutorials written in early 2025 still link to the archived version. The archived server connects to current clients without errors but has not been updated for the November 2025 or later specification changes. Install github/github-mcp-server. Do not install the archived reference.
What Personal Access Token Scopes Does the GitHub MCP Server Need?
The GitHub MCP server needs a personal access token scoped to the minimum permissions your workflow requires: public_repo for read access to open source, repo for private repository access, and no broader scopes unless the server genuinely needs write access.
The over-scoping mistake is common. A developer creates a token with full repo access for a server that only reads public repositories. That token can now push code, delete branches, merge pull requests, and access every private repository the developer has access to. The MCP server can do anything the token permits. Scope it to what the workflow actually needs.
For read-only access to public repositories: Create a fine-grained personal access token. Grant public_repo read access. Grant no other scopes. This is sufficient for code search, file reading, issue browsing, and PR review on public repositories.
For read access to private repositories: Create a fine-grained personal access token. Grant repo read access. Restrict the token to specific repositories when possible. GitHub’s fine-grained tokens let you select individual repositories instead of granting access to every repository in your account.
For write access (creating issues, PRs, or comments): Grant repo with write access to the specific repositories the workflow touches. Do not grant admin:org, delete_repo, or admin:repo_hook unless the workflow explicitly requires them. No standard MCP workflow requires these scopes.
For the remote hosted version: The remote hosted server uses OAuth instead of a personal access token. GitHub handles the scoping through the OAuth consent flow. You approve specific permissions during setup. This is more secure than a PAT because tokens are time-limited and revocable without visiting GitHub’s token settings page.
The token sits in your MCP client’s config file in plain text. Anyone who can read the config file can read the token. Protect that file. On macOS, the Claude Desktop config is at ~/Library/Application Support/Claude/claude_desktop_config.json. On Windows, it is at %APPDATA%\Claude\claude_desktop_config.json.
How Do You Set Up the GitHub MCP Server?
Add the GitHub MCP server to your client’s configuration file with the server command, your personal access token, and the GitHub user or organization you want to connect to, then fully quit and reopen the client.
The setup differs slightly by client. All three use the same server binary. The differences are config file location, JSON format, and restart behavior.
How Do You Set It Up in Claude Desktop?
Open the config file at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS or %APPDATA%\Claude\claude_desktop_config.json on Windows. Add the server entry:
{
"mcpServers": {
"github": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<your-token>"
}
}
}
}
Fully quit Claude Desktop (not just close the window) and reopen it. Verify the server appears in the MCP server list. A window close does not restart the MCP connection. The application must fully quit and relaunch.
Docker must be running before you open Claude Desktop. The server runs as a Docker container. No Docker means the server will not start.
How Do You Set It Up in Cursor?
Open Cursor Settings. Navigate to Features, then MCP. Add a new server with the same Docker command and arguments as above. Cursor manages its own MCP config independently from Claude Desktop. Restart Cursor after adding the server.
How Do You Set It Up in VS Code?
VS Code supports MCP through GitHub Copilot Chat. For the remote hosted version, open the command palette (Cmd+Shift+P on macOS, Ctrl+Shift+P on Windows), search for “MCP: Add Server,” and select “GitHub” from the list. The remote hosted version authenticates through OAuth. No Docker and no personal access token required. VS Code handles the OAuth flow automatically.
For the local Docker version, add the server to your .vscode/mcp.json file with the Docker command and PAT environment variable.
Claude Desktop setup walkthrough
What Is the Difference Between the Local and Remote Hosted Versions?
The local version runs as a Docker container on your machine through stdio transport, authenticates with a personal access token, and requires Docker installed. The remote hosted version runs on GitHub’s infrastructure through streamable HTTP, authenticates through OAuth, and requires no Docker.
| Local Docker | Remote Hosted | |
|---|---|---|
| Transport | stdio (local process) | Streamable HTTP (remote) |
| Auth | Personal access token (plain text in config) | OAuth (scoped, time-limited, revocable) |
| Infrastructure | Docker required on your machine | No Docker. GitHub hosts the server. |
| URL | None (local process) | https://api.githubcopilot.com/mcp/ |
| Updates | Manual. Pull new Docker image. | Automatic. GitHub pushes updates. |
| Toolset control | Full. Flag to disable toolsets. | Full. Same flags. |
| Enterprise | Supported (GitHub Enterprise Server and Cloud) | Supported (GitHub Enterprise Cloud) |
The remote hosted version is simpler to set up and maintain. No Docker management. No token rotation. No manual updates. The tradeoff: you trust GitHub to host and run the server. For most developers, that tradeoff is straightforward. GitHub already hosts the repositories the server connects to.
The local Docker version gives you full control. The server runs on your machine. No data leaves your network except through GitHub’s API calls. Use the local version when your security policy requires it or when you need to run the server in an air-gapped or restricted network.
The GitHub blog describes the hosted version as the recommended path for most developers (Andrea Griffiths, “A practical guide on how to use the GitHub MCP server,” July 2025).
How Many Tokens Does the GitHub MCP Server Consume?
The GitHub MCP server registers between 17,600 and 55,000 tokens of tool definitions when it connects, depending on which toolsets are enabled, consuming context window space before any tool calls happen.
The numbers come from independent community measurements. StackOne measured 17,600 tokens for core tool definitions (StackOne, “MCP Token Optimization,” March 2026). Nebulagg measured 42,000 tokens in a full-toolset configuration (dev.to, 2026). Piotr Hajdas measured 55,000 tokens across all 93 tool definitions (dev.to, 2026). The variation reflects toolset growth over time and whether all toolsets are enabled.
The practical impact depends on your model’s context window. A model with a 200,000-token window loses 8 to 27% of its capacity to GitHub MCP tool definitions alone. A model with a 32,000-token window cannot run the full GitHub MCP toolset and still have room for a meaningful conversation.
Three mitigations reduce the cost:
1. Disable unused toolsets. The GitHub MCP server supports flags to disable toolsets you do not use. A developer who only needs issue operations can disable PR, branch, and code search toolsets. This reduces the registered definitions from 93 to a fraction.
2. Use tool-search subagents. Claude Code 2.0 introduced a tool-search subagent that loads tool definitions on demand instead of registering all 93 at session start. Joe Njenga measured a 46.9% reduction in main-thread token consumption with this approach.
3. Use the GitHub CLI for simple operations. For single operations like listing issues or checking PR status, the gh CLI is 4 to 32 times cheaper per operation than the equivalent MCP tool call (OnlyCLI benchmark, March 2026). Use MCP for workflows where the model needs to chain multiple GitHub operations together. Use gh for one-off commands.
GitHub itself has adopted these mitigations internally, cutting token costs in agentic CI workflows by up to 62% through tool pruning and selective MCP-to-CLI replacement (InfoQ, “GitHub Slashes Agent Workflow Token Spend,” May 2026).
The server is connected and your token is scoped. Before your first workflow, know what it does well and where it stops.
What Can You Actually Build with the GitHub MCP Server?
The GitHub MCP server delivers the clearest productivity gains in code review, issue triage, repository exploration, and pull request automation.
Code review: Ask the model to review a PR’s diff, identify potential bugs, check for security issues, and post structured review comments. The model reads the changed files, compares them against the repository’s patterns, and leaves comments on specific lines.
Issue triage: Ask the model to search for open issues matching specific criteria (label, assignee, age, activity), summarize them, and apply labels or reassign them. A single prompt can triage a backlog that would take an hour manually.
Repository exploration: Ask the model to explore an unfamiliar codebase. It reads files, traverses the directory tree, searches code, and explains architecture. Useful before integrating a third-party library or onboarding onto a new project.
Pull request creation: Ask the model to create a PR with a title, description, and target branch after making changes through other tools (Filesystem, a code editor MCP, or direct file operations).
What the server cannot do. The GitHub MCP server does not trigger CI/CD pipelines. It does not manage GitHub Actions workflows. It does not create or manage webhooks. It does not deploy to GitHub Pages. These operations require direct API integration or the gh CLI. Code review, issue triage, and repository search are the workflows where this server delivers value. Workflows that require CI/CD management or deployment automation belong to other tools.
GitHub MCP Server Questions
Does GitHub Provide an MCP Server?
Yes. GitHub maintains its own MCP server at github.com/github/github-mcp-server. It entered public preview in April 2025 and is available as both a local Docker image and a remote hosted endpoint.
Is the GitHub MCP Server Free to Use?
Yes. The GitHub MCP server is free and open-source under the MIT license. The only associated cost is the token consumption within your AI model’s context window. The server itself has no licensing fees or usage charges.
Does GitHub Have a Remote MCP Server?
Yes. The remote hosted version runs at https://api.githubcopilot.com/mcp/ and authenticates through OAuth. No Docker installation needed. GitHub handles hosting, updates, and infrastructure. Requires a GitHub Copilot seat.
Is GitHub MCP Useful?
Yes, for specific workflows. Code review, issue triage, repository exploration, and pull request automation are the use cases where the GitHub MCP server delivers measurable productivity gains. The 42,000 to 55,000 token registration cost means it should be connected only when you need it, not left running permanently alongside five other servers. Connect it for GitHub-heavy workflows. Disconnect it when the task changes.