GitHub MCP Server: What It Does, How to Set It Up, and Whether It's Worth It
GitHub's official MCP server lets AI agents read code and work on issues and pull requests. Setup, cost and risks.

You connect the GitHub MCP Server to Cursor or Claude Code, ask for a summary of the open pull requests, and the agent reads issues, diffs and CI logs in plain language. The GitHub MCP Server is GitHub's own bridge between AI agents and your repositories, and it's worth running when the agent deciding what to call is the point.
The catch is cost and risk: tool schemas take context before you type, and an agent with write access can be steered by text it reads. Below: setup per client, and how to keep it cheap and safe.
What is the GitHub MCP Server?
The GitHub MCP Server is GitHub's official MCP server, built and maintained by GitHub in the open at github/github-mcp-server, where it had 32,200 stars in October 2026. It's official, not a community project; the old npm package @modelcontextprotocol/server-github stopped being supported in April 2025.
It speaks the Model Context Protocol (MCP), the open standard AI assistants use to call outside tools, so any MCP host can point at it. GitHub says the server "is available to all GitHub users regardless of plan type" (GitHub Docs).
The README lists 92 tools in 22 toolsets as of October 2026, from repos, issues and pull_requests to actions, code_security, dependabot, discussions and projects. With no configuration, the server loads five default toolsets: context, repos, issues, pull_requests and users.
What can the GitHub MCP Server do?
It reads and writes most of what you'd do on github.com, from code and pull requests to Actions workflows.
| Area | Read tools (examples) | Write tools (examples) |
|---|---|---|
| Code and repos | get_file_contents, search_code, search_repositories, list_commits |
create_branch, create_or_update_file, push_files, fork_repository, delete_file |
| Issues | issue_read, list_issues, search_issues |
issue_write, add_issue_comment, sub_issue_write |
| Pull requests | pull_request_read, list_pull_requests, search_pull_requests |
create_pull_request, pull_request_review_write, merge_pull_request |
| Actions | actions_list, actions_get, get_job_logs (including logs of failed jobs) |
actions_run_trigger (run or rerun a workflow) |
| Security | code scanning, Dependabot and secret scanning alerts | none |
The remote server adds a few tools the local one doesn't have, such as create_pull_request_with_copilot, which hands a task to Copilot coding agent, plus Copilot Spaces and a GitHub support-docs search. Tools tied to a paid feature need the same license; Copilot coding agent tools need a paid Copilot plan.
So in one conversation an agent can find why last night's workflow failed, draft the fix on a branch with a commit message, and open the pull request.
Should you run the remote or the local GitHub MCP Server?
Use the remote GitHub MCP Server unless you're on GitHub Enterprise Server or want the runtime on your machine. GitHub hosts it at https://api.githubcopilot.com/mcp/, with no Docker to manage.
- Remote: you configure it with URL paths and HTTP headers. Full OAuth authentication currently works only in GitHub Copilot hosts such as Visual Studio Code 1.101+, Visual Studio, JetBrains, Xcode and Eclipse. Claude Code, Cursor, Windsurf, Codex, Gemini CLI and other hosts connect with a GitHub PAT in an
Authorizationheader, according to GitHub's installation guides. - Local: runs as the
ghcr.io/github/github-mcp-serverDocker image or a release binary. On github.com it can log you in with OAuth on first use and keep the token in memory only; aGITHUB_PERSONAL_ACCESS_TOKENenvironment variable overrides that. - Enterprise: GitHub Enterprise Cloud with data residency (
ghe.com) can use the remote server. GitHub Enterprise Server can't, so it runs the local server withGITHUB_HOSTset.
What do you need: GitHub Copilot plan, admin approval, tokens and rate limits?
Any GitHub account can use the server, but organization policy and token scopes decide what it can do. Members of an organization on Copilot Business or Copilot Enterprise need the "MCP servers in Copilot" policy enabled to use MCP in Copilot (GitHub Docs).
With a classic PAT, the server hides tools that need scopes your token doesn't have, so a narrow token also means a shorter tool list.
The server calls the GitHub APIs as you, so normal API limits apply: 5,000 REST requests per hour for an authenticated user, or 15,000 through apps owned by a GitHub Enterprise Cloud organization (GitHub Docs).
How do you set up the GitHub MCP Server in Claude, Cursor and ChatGPT?
Outside Copilot hosts, each client needs the server URL or a Docker command plus a fine-grained personal access token, created at github.com/settings/personal-access-tokens.
Claude Code
- In your terminal (not inside Claude Code), run:Shell
claude mcp add-json github '{"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{"Authorization":"Bearer YOUR_GITHUB_PAT"}}' - Restart Claude Code.
- Run
claude mcp listto check the server is connected.
GitHub's Claude guide also has the Docker command for a local server.
Claude Desktop
GitHub's guide says the remote server can't be added through Settings > Connectors > Add custom connector, because it needs OAuth through a registered GitHub App that this flow doesn't support. Claude on the web can't run local servers either, so use Claude Desktop with the local server:
- Open
claude_desktop_config.json(on macOS, in~/Library/Application Support/Claude/). - Add a
githubentry undermcpServerswith"command": "docker"and therun -i --rm ... ghcr.io/github/github-mcp-serverarguments from GitHub's guide, plus your token inenv. - Restart Claude Desktop.
Cursor
- Open
~/.cursor/mcp.json(Cursor v0.48.0 or later). - Add the server:JSON
{ "mcpServers": { "github": { "url": "https://api.githubcopilot.com/mcp/", "headers": { "Authorization": "Bearer YOUR_GITHUB_PAT" } } } } - Save and restart Cursor. GitHub notes that Cursor needs a PAT here, not OAuth (GitHub's Cursor guide).
ChatGPT
GitHub publishes no ChatGPT guide. ChatGPT has its own read-only GitHub app instead (Settings > Plugins > GitHub) for searching and analyzing code; writing goes through Codex (OpenAI Help Center). In Codex, codex mcp add github --url https://api.githubcopilot.com/mcp/ --bearer-token-env-var GITHUB_PAT_TOKEN connects the remote server.
How much context does the GitHub MCP Server use?
A lot, if you load everything. In a March 2026 benchmark by Scalekit, the same GitHub tasks on Claude Sonnet 4 cost 4 to 32 times more tokens through the GitHub MCP server than through the gh CLI; the simplest task used 44,026 tokens over MCP against 1,365 with the CLI, mostly because 43 tool schemas rode along with every request.
GitHub's own numbers point the same way: loading only the 3 to 10 tools you use most "can lead to a ~60-90% reduction in context window usage" against the default toolsets (GitHub changelog, December 2025).
Your client matters too: Claude Code defers MCP tool definitions by default and loads only tool names at session start (Claude Code docs), so the up-front cost there is smaller. More in why too many MCP servers make your AI worse.
How do you limit what the GitHub MCP Server loads?
Configure tool access from the task backward. Every option works on both servers (server configuration guide):
- Toolsets:
--toolsets issues,reposorGITHUB_TOOLSETSlocally; theX-MCP-Toolsetsheader or a/x/{toolset}path remotely. - Single tools:
--tools get_file_contents,pull_request_reador theX-MCP-Toolsheader, added in December 2025. - Exclusions:
--exclude-toolsorX-MCP-Exclude-Tools, for example to keeppull_requestsbut dropmerge_pull_request. - Read-only mode:
--read-only,GITHUB_READ_ONLY=1, theX-MCP-Readonlyheader, or/readonlyat the end of a remote URL. It overrides everything else, so write tools stay off even if you request them.
A 2026 bug report (issue #2156) found --read-only didn't filter write tools in the self-hosted HTTP mode of v0.31.0, so check the tool list after setup whichever mode you run.
Is the GitHub MCP Server safe?
It's as safe as the token you give it, and public repository content is the main way in. On May 26, 2025, Invariant Labs showed that a malicious issue in a public repository could steer an agent (Claude Desktop with Claude 4 Opus) into copying data from the user's private repositories into a public pull request. They stressed it was "not a flaw in the GitHub MCP server code itself" but an agent-level problem.
GitHub's response landed in December 2025: content sanitization on by default (it filters invisible Unicode, sanitizes HTML and removes hidden text) and a lockdown mode that only surfaces public-repo content from users with push access. GitHub's README calls lockdown a best-effort filter, "not an authorization boundary": it doesn't change what your token can read or write.
Practical rules:
- Use a fine-grained token scoped to the repos the task needs, not your whole account.
- Turn on lockdown mode (
--lockdown-modeorX-MCP-Lockdown) when agents read public issues. - Start read-only and approve each write.
- Don't let one session read untrusted issues and write to private repos.
The broader threat model is in Is MCP Safe?
Is the GitHub MCP Server worth it?
Yes, for conversational and multi-step GitHub work; no, for commands you already know.
Worth it when you're triaging a backlog, reviewing pull requests, asking questions of an unfamiliar codebase, debugging failed jobs, or delegating a task that reads, decides and acts across issues and branches.
Not worth it when the work is scripted and repetitive: if you know the exact command, gh pr create or gh issue list is faster and far cheaper, especially in an agent loop that repeats the same calls hundreds of times.
Where does Unabyss fit next to the GitHub MCP Server?
Unabyss solves a different problem: one MCP connection that builds your personal context from GitHub, Linear, Slack, Gmail, Notion and the other apps on its integrations page, keeps it current, and serves it to Claude, ChatGPT, Cursor and Claude Code. It doesn't act inside GitHub: no branches, commits or pull requests. Many people run both, the GitHub server for actions and Unabyss so the agent already knows which PRs and tickets are in flight. In an August 2026 Unabyss benchmark against connected tools alone, adding that context cut cost by 36% and time by 38% (What Structured AI Context Is Worth). The other vendor servers are compared in Best MCP Servers for Work.