Skip to content

What is GitHub MCP Server? Setup, token scopes, read-only mode and security

You ask your assistant about a repository, an issue or a pull request (PR); GitHub MCP Server reads repositories and code, manages issues and PRs, monitors Actions runs and reviews security alerts. It is the official MCP server built by GitHub itself (MIT); you use it either as a remote server hosted by GitHub (no installation) or as a local server running on your own machine (Docker). GitHub Docs states the server is available to all GitHub users regardless of plan type. It also has write and destructive tools (deleting files, deleting repositories, merging PRs, triggering workflows); read-only mode turns them off. The main risk: issue and PR text in public repositories can look like instructions to the assistant (prompt injection).

What it does
Has your assistant do repository, issue, PR and Actions work on GitHub
Type
MCP server (remote, hosted by GitHub; or local Docker)
Where
Claude Code, VS Code, Cursor, Codex, Gemini CLI and more
Authentication
Personal access token (PAT) or OAuth
Does it write?
Yes, including destructive tools; read-only mode available
Turkish
Not stated in official sources
Cost
The server is free (MIT); no plan differences

What does GitHub MCP Server do?

MCP is the standard that lets AI programs connect to outside tools. With this server you can have your assistant work directly on GitHub: read a repository's files and history, search code, open and review issues and pull requests, read Actions run logs, and go through code scanning, Dependabot and secret scanning alerts.

YouYou describe the repository, issue or PR task
AssistantClaude Code, VS Code, Cursor, Codex, Gemini CLI
GitHub MCP ServerGitHub's remote server or local Docker
GitHubRepositories, issues, PRs, Actions, security alerts

Authentication: personal access token (PAT) or OAuth. There are write and destructive tools; read-only mode turns them off.

The tools are split into groups called "toolsets" (context, repos, issues, pull_requests, actions and others). Only some are on by default: context, repos, issues, pull_requests and users (about 45 tools). The README lists 92 tools in total; the remote server has 4 more, for 96. The Actions and security toolsets are off by default.

Who it is for: developers who work on GitHub and want to speed up repository, issue and PR work with an assistant. If you don't write code, it won't help you.

How do you set up GitHub MCP Server?

The official guide presents the remote server as "the easiest way to get started" (https://api.githubcopilot.com/mcp/). The local server is for clients without remote MCP support, GitHub Enterprise Server and customization; it needs Docker. For authentication, a personal access token (PAT) works in every client. The README recommends a fine-grained token. The commands are taken verbatim from the official guide.

Claude Code 2.1.1 and later (in the terminal)› claude mcp add-json github '{"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{"Authorization":"Bearer YOUR_GITHUB_PAT"}}'

Then restart Claude Code and check with claude mcp list. If add-json returns "Invalid input" on Windows, the guide suggests the older form:

Older form (2.1.0 and earlier)› claude mcp add --transport http github https://api.githubcopilot.com/mcp -H "Authorization: Bearer YOUR_GITHUB_PAT"

The --transport http command on the atlas card is only for older versions; for 2.1.1 and later the guide gives the add-json form. For scope, use --scope local (default), project (shared with the team via .mcp.json) or user.

Start read-only: on the local server use --read-only or GITHUB_READ_ONLY=1; on the remote server use the /readonly URL or the X-MCP-Readonly header.

How do you use GitHub MCP Server?

Once it is set up, you write your request in plain language. For anything that requires writing, ask the assistant to tell you first what it is going to do.

Summarize open PRs"Using GitHub MCP, list the open pull requests in the my-org/project-name repository and summarize each in one sentence. Don't change anything."
Investigate a failure"Read the log of the last failed Actions run and explain the cause of the error. Don't change any files to fix it; suggest a fix to me first."
Open an issue"Draft an issue describing this bug and show it to me. Don't open the issue until I approve."

In a client that asks for approval on every tool call, keep approval on, especially for delete, merge and push tools.

Which programs does GitHub MCP Server work in?

Claude CodeYesRemote (PAT) or local Docker; the command depends on the version.
Claude DesktopPartlyThe remote server can't be added as a custom connector; local Docker is used.
VS Code (Copilot), Visual Studio, JetBrains, Xcode, EclipseYesThrough Copilot settings; some require Copilot access.
Cursor, Windsurf, Zed, OpenCodeYesOfficial guide available; most need a PAT for the remote server.
Codex, Gemini CLI, GitHub Copilot CLIYesOfficial guide available.
ChatGPTUnclearNot mentioned in the official guide; one user reported an account suspension after using it with ChatGPT (issue #3497), a single unverified report.

What does GitHub MCP Server access, write and delete?

Reads

Repositories your identity can access: files, branches, commits, issues and PRs, Actions runs and logs, Dependabot, code scanning and secret scanning alerts, notifications, discussions, projects, organization and team members. Private repositories included; access is limited by your token's scope and your GitHub permissions.

Writes

Opening, updating, commenting on, reviewing and merging issues and PRs; creating and updating files, pushing; creating branches and repositories, forking; gists; labels; triggering Actions workflows; organization governance tools.

Deletes

delete_file (deletes a file as a commit) and delete_repository (deletes a repository) are in the tool list; some tools include delete methods. You decide which tools are on through toolset and tool selection.

Where data goes

The remote server runs on GitHub infrastructure; with the local server the code runs on your machine and connects to the GitHub API. Content that is read (including private repository data) goes to the AI model you use.

Read-only modeHow
Local server--read-only flag or GITHUB_READ_ONLY=1 environment variable.
Remote server/readonly URL or X-MCP-Readonly header.
PrecedenceRead-only mode takes precedence: write tools are skipped even if explicitly requested with --tools (README).

Issue, PR, comment and commit text in public repositories can carry content that looks like instructions to the assistant. Lockdown mode filters content from users without push access, but the README states this is not an authorization boundary. Security advisories: GHSA-pjp5-fpmr-3349 (moderate, patched in 1.1.2) and GHSA-w4q6-qw23-4rg7 (high, unauthenticated crash). For the second, the GitHub advisory leaves the patched version blank and lists the affected range as "0.33.0 and below (including the latest main branch)"; OSV says it was fixed in 1.1.0. A definite patched version is unclear; use the latest version.

Organization side: access is always limited by the identity's GitHub permissions; there is no anonymous access. Admins use the "MCP servers in Copilot" policy, OAuth App access, PAT policies (classic tokens can be disabled) and SSO enforcement. There is no single "turn it all off" switch. Underlying API calls appear in the GitHub audit log; there is no MCP-specific logging yet.

Is GitHub MCP Server free, and do you need Copilot?

The server itself is free and MIT-licensed. GitHub Docs states it is available to all GitHub users regardless of plan type. In general a Copilot subscription is not required; however, tools tied to features that need a paid GitHub or Copilot license (for example the Copilot coding agent) need the same license, and Copilot access is a prerequisite for use in Visual Studio. For Copilot Business and Enterprise members, the organization's "MCP servers in Copilot" policy must be enabled. Running it on your own machine costs nothing from GitHub; Docker and model costs are yours. The official documentation gives no number for the API rate limit, only that it is subject to GitHub API limits.

Allowed
  • MIT: free to use, modify and use commercially
  • The server is available to all GitHub users regardless of plan type
Not allowed
  • Tools for features that need a paid Copilot or GitHub license need the same license
  • The remote server is not supported for GitHub Enterprise Server; only local use

Source: GitHub Docs, the README and the policy document. This is not legal advice.

Common problems and fixes

What happensWhat to do
Tools don't appear in the list, or you get a 401The PAT must not be expired and must include the scope the tool needs (usually "repo"). With a classic PAT, tools without the scope are hidden from the list; with a fine-grained PAT all tools appear but the API denies permission.
Error while pulling the Docker imageOfficial guide: the image is public; an expired token may have caused the error. Run docker logout ghcr.io, then try again.
The remote server can't be added with "Add custom connector" in Claude DesktopOfficial guide: not supported at the moment; use the local Docker setup.
Reported by users After v2.0.x, the Claude Code tool list fails to load with a "missing required resultType" errorOpen issue #3453 (October 7, 2026): the reporting user wrote that the v1.14.0 image works; a commenter could not reproduce it on v2.0.1. Status unresolved.
Reported by users The Docker command with a PAT returns "unknown option -e"Open issue #3032 (August 6, 2026); try the add-json form or the OAuth command instead.

How do you remove GitHub MCP Server?

  1. Remove it from the client: In Claude Code, claude mcp remove github; in Cursor, delete the github entry from ~/.cursor/mcp.json; in VS Code, delete it from the MCP configuration.
  2. If you used a PAT: Revoke the token under GitHub › Settings then Developer settings › Personal access tokens. A fine-grained token makes revocation easier.
  3. If you connected with OAuth: Remove access from the authorized applications in your GitHub account.
  4. Docker (optional): docker rmi ghcr.io/github/github-mcp-server deletes the local image.

Frequently asked questions

What is GitHub MCP Server?

GitHub's official, MIT-licensed MCP server. It lets an AI assistant read repositories and code, manage issues and pull requests, and review Actions runs and security alerts. It runs remotely (hosted by GitHub) or locally (Docker).

Is GitHub MCP Server free, and do you need a Copilot subscription?

The server is available to all GitHub users regardless of plan and is MIT-licensed. A Copilot subscription is generally not required, but tools tied to features that need a paid Copilot or GitHub license need the same license, and Copilot access is a prerequisite in Visual Studio.

Can the assistant accidentally delete my repository?

delete_repository and delete_file are in the tool list; you decide which tools are on through toolset and tool selection. Read-only mode (--read-only, /readonly, X-MCP-Readonly) turns off write tools entirely. Limiting the token to only the repositories you need (fine-grained PAT) is another safeguard.

Does lockdown mode protect against prompt injection?

Partly. Lockdown mode filters content from users without push access, but the README states it is not an authorization boundary and that filtered content may still be reachable through other tools.

Should I set it up remote or local?

The official guide presents the remote server as the easiest way. The local server is for clients without remote MCP support, GitHub Enterprise Server and customization, and it needs Docker.

Can it be added to Claude Desktop?

The remote server can't be added as a custom connector: the official guide states this requires an OAuth registration and is not supported at the moment. The local Docker setup is used instead.

Does it work with GitHub Enterprise?

For GitHub Enterprise Cloud, the remote server can be used. Remote hosting is not supported on GitHub Enterprise Server; the local server is used with the GitHub host setting. Organization policies (OAuth App, PAT, SSO) apply.

Tasks and setup kits that use GitHub MCP Server

Related guides

Sources

Not clear in the official sources: Rate-limit figure (not given in the official documentation) · which plans include GitHub Advanced Security alerts · the full method list of mixed tools · OAuth consent screen and authorized applications menu path · a definite patched version for GHSA-w4q6-qw23-4rg7 (GitHub and OSV differ) · commands for the Rovo Dev CLI, Cline, Roo Code and Antigravity guides · Turkish support. Each is noted in the relevant section.