MCP.so
Sign In

GitHub MCP Server (Official)

@github

Basic information

Category

Version Control

License

MIT

Transports

stdio

Author

github

Submitted by

Antonio Klim

About GitHub MCP Server

GitHub's official MCP Server

GitHub MCP Server config

Add this server to your MCP-compatible client using the configuration below.

{
  "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_GITHUB_TOKEN"
      }
    }
  }
}

GitHub MCP Server tools

Tool list not available yet

This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.

We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.

Overview

What is GitHub MCP Server (Official)?

The GitHub MCP server is GitHub's official Model Context Protocol server that lets AI agents read repositories and code, manage issues and pull requests, inspect GitHub Actions runs and review security alerts through natural language. It runs as a hosted remote server or locally in Docker.

It is maintained by GitHub in the open-source github/github-mcp-server repository under the MIT license. The hosted endpoint is https://api.githubcopilot.com/mcp/; the local version ships as the public image ghcr.io/github/github-mcp-server and as release binaries.

How to use GitHub MCP Server (Official)?

Pick one of two modes:

  • Remote (hosted by GitHub): needs an MCP host with remote server support (the README lists VS Code 1.101+, Claude Desktop, Cursor, Windsurf and others) and any applicable organization policies enabled.
  • Local: needs Docker installed and running, or a binary built with go build / downloaded from the releases page.

Authentication is either GitHub OAuth (a browser flow; the token is kept in memory only) or a GitHub Personal Access Token in GITHUB_PERSONAL_ACCESS_TOKEN, which takes precedence over OAuth. Create a token at github.com/settings/personal-access-tokens/new and grant only the scopes you need.

Claude Code

Remote server (Claude Code 2.1.1 and newer), run in your terminal:

claude mcp add-json github '{"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{"Authorization":"Bearer YOUR_GITHUB_PAT"}}'

Local server with Docker and a PAT:

claude mcp add github -e GITHUB_PERSONAL_ACCESS_TOKEN=YOUR_GITHUB_PAT -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server

Restart Claude Code and run claude mcp list to confirm the server is configured.

Claude Desktop

GitHub's guide says the remote server's OAuth flow is not currently supported as a Claude Desktop custom connector, so use the local Docker setup in claude_desktop_config.json:

{
  "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_GITHUB_PAT"
      }
    }
  }
}

Cursor

Cursor v0.48.0+ can use the hosted server. Add this to ~/.cursor/mcp.json (or .cursor/mcp.json in a project) and restart Cursor:

{
  "mcpServers": {
    "github": {
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer YOUR_GITHUB_PAT"
      }
    }
  }
}

VS Code

Use the one-click install button in the README, or add the remote server manually (VS Code 1.101+ handles OAuth for you), then toggle Agent mode in Copilot Chat:

{
  "servers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/"
    }
  }
}

Codex

Edit ~/.codex/config.toml:

[mcp_servers.github]
url = "https://api.githubcopilot.com/mcp/"
bearer_token_env_var = "GITHUB_PAT_TOKEN"

Installation guides also exist for Copilot CLI, JetBrains, Visual Studio, Eclipse, Xcode, Windsurf, Zed, OpenCode, Gemini CLI and Rovo Dev CLI.

Key features of GitHub MCP Server (Official)

  • Official GitHub project, with a hosted remote server and a local Docker or binary option.
  • OAuth login or Personal Access Token authentication.
  • Toolsets: enable only the capability groups you need with --toolsets or GITHUB_TOOLSETS (default: context, repos, issues, pull_requests, users; all enables everything).
  • Pick individual tools with --tools / GITHUB_TOOLS, alone or combined with toolsets.
  • Read-only mode (--read-only or GITHUB_READ_ONLY=1) exposes only read tools.
  • Lockdown mode (--lockdown-mode) filters public-repository content from authors without push access to reduce prompt-injection risk.
  • GitHub Enterprise Server and ghe.com support via --gh-host / GITHUB_HOST.
  • Insiders mode for early access to experimental tools.

GitHub MCP Server (Official) tools

Tools are grouped into toolsets that map to GitHub product areas:

  • Context and users: get_me, get_teams and search_users tell the agent who it is acting as. GitHub calls context "strongly recommended".
  • Repositories and Git: browse and change code with get_file_contents, search_code, list_commits, create_branch, create_or_update_file, push_files, fork_repository and get_repository_tree.
  • Issues and pull requests: list_issues, issue_read, issue_write, search_issues, create_pull_request, pull_request_read, pull_request_review_write and merge_pull_request cover triage, review and merging.
  • Actions: actions_list, actions_get, actions_run_trigger and get_job_logs inspect and trigger workflow runs.
  • Security: code scanning, Dependabot, secret scanning and security advisory tools such as list_code_scanning_alerts and list_dependabot_alerts.
  • Collaboration: discussions, notifications, projects, gists, labels, stargazers and organization tools.
  • Remote-only extras: create_pull_request_with_copilot (Copilot coding agent), Copilot Spaces and github_support_docs_search.

Use cases of GitHub MCP Server (Official)

  • Code exploration: "Find where the rate limiter is implemented in this repo and explain how it works."
  • Issue triage: "List open issues labeled bug from the last week and summarize the duplicates."
  • Pull request review: "Read the diff of PR 42, flag risky changes and leave review comments."
  • CI debugging: "Why did the latest workflow run on main fail? Show the failing job logs."
  • Security review: "List open Dependabot and code scanning alerts for this repository by severity."
  • Delegating work: on the remote server, ask Copilot coding agent to open a pull request for a described task.

GitHub MCP Server (Official) vs alternatives

  • Official vs older community and reference servers: the earlier reference GitHub server in the MCP servers repository (Github MCP Server) and the npm package @modelcontextprotocol/server-github are no longer supported; GitHub's docs point users to ghcr.io/github/github-mcp-server. Community projects such as cyanheads/github-mcp-server are deprecated in favor of the official server too.
  • Remote vs local: the remote server needs no Docker and gets extra toolsets, while the local server works with hosts that lack remote MCP support and with GitHub Enterprise Server.
  • Other forges: if your code lives on GitLab, see the GitLab MCP Server.

Troubleshooting GitHub MCP Server (Official)

  • Docker image pull fails: the image is public; an expired token can break pulls, so run docker logout ghcr.io and retry.
  • Remote server not connecting in Cursor: make sure you are on Cursor v0.48.0 or later for Streamable HTTP, and that the PAT is valid with the right scopes.
  • claude mcp add-json returns "Invalid input" (reported on Windows): use the legacy claude mcp add --transport http github https://api.githubcopilot.com/mcp -H "Authorization: Bearer YOUR_GITHUB_PAT" form.
  • Server fails at startup after setting --tools: tool names must match exactly (for example get_file_contents); an invalid name stops the server.
  • Write tools are missing: read-only mode skips write tools even if you list them in --tools.

Frequently asked questions

1

Is the GitHub MCP server official?

Yes. It is built and maintained by GitHub in the `github/github-mcp-server` repository, and GitHub's own install guides point to it.

2

Is the GitHub MCP server free?

The server is open source under the MIT license, and the README lists no separate price for the hosted endpoint. You need a GitHub account, and organization policies can control whether the remote server is allowed.

3

What is the remote GitHub MCP server URL?

`https://api.githubcopilot.com/mcp/`. GitHub Enterprise Cloud with data residency uses `https://copilot-api.<subdomain>.ghe.com/mcp`.

4

Do I need a Personal Access Token?

Not always. VS Code and the local server support OAuth login, but several hosts (for example Cursor and Claude Code's remote setup) use a PAT sent as a Bearer header. If both are set, `GITHUB_PERSONAL_ACCESS_TOKEN` takes precedence.

5

Does it work with Claude Code, Cursor and VS Code?

Yes. GitHub publishes setup guides for Claude Code, Claude Desktop, Cursor, VS Code, Codex, Windsurf, Zed and more.

6

Does it support GitHub Enterprise Server?

Only through the local server. Set `GITHUB_HOST` (or `--gh-host`) to your `https://` hostname; the remote server does not support GitHub Enterprise Server.

7

How do I limit what the AI can do?

Grant a token only the minimum scopes, run with `--read-only`, restrict toolsets with `--toolsets`, and turn on lockdown mode for public repositories. GitHub notes lockdown mode is a content filter, not an authorization boundary.

8

Can I use the old npm package instead?

No. GitHub states that `@modelcontextprotocol/server-github` is no longer supported as of April 2025; use the official Docker image or the remote server.

Comments

More Version Control MCP servers