Skip to main content
Guide2 min read

GitHub MCP server: setup for Claude, Cursor & Windsurf (2026)

Connect GitHub to Claude Desktop, Cursor and Windsurf with the official GitHub MCP server. Remote OAuth and local Docker configs, token scopes, and fixes.

The GitHub MCP server lets an AI client read issues, review pull requests, search code and open PRs on your behalf. As of 2026 the official server is GitHub's Go-based github/github-mcp-server — the old @modelcontextprotocol/server-github npm package is archived. Here are the configs that actually work.

Two ways to run it

There are two supported paths. Pick one:

  • Remote server (recommended) — hosted by GitHub at https://api.githubcopilot.com/mcp. Nothing to install; authenticate with OAuth or a token. Best for Claude Desktop, VS Code and Cursor.
  • Local Docker — run ghcr.io/github/github-mcp-server yourself. Best when you need full control, air-gapped networks, or a self-hosted setup.

Step 1 — create a token

Create a fine-grained Personal Access Token at github.com/settings/personal-access-tokens/new. Grant only the scopes you are comfortable handing to an AI tool — start with read-only Contents, Issues and Pull requests, and add write scopes later if you want the agent to open PRs. Least privilege matters here; see our MCP security best practices.

Step 2 — configure the client

Local Docker (works in Claude Desktop, Cursor, Windsurf). Add to your config file:

{
  "mcpServers": {
    "github": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"],
      "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here" }
    }
  }
}

Remote server (Claude Code one-liner):

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

Not sure where the config file lives? See MCP config file location. Restart the client afterwards.

Step 3 — verify

Restart the client, open the tools panel (the hammer icon in Claude Desktop), and confirm GitHub tools appear. Ask: "List the open pull requests in owner/repo." If it answers from live data, you are connected.

Common problems

  • failed to pull image — the GHCR image is public; an expired login can block it. Run docker logout ghcr.io and retry.
  • Tools never show up — Docker Desktop must be running before the client launches. See Claude Desktop MCP not loading.
  • 403 / resource not accessible — your token is missing a scope. Regenerate with the needed permission.
  • Too many tools — the GitHub server exposes a lot of tools and Cursor caps at ~40. Use the server's toolset flags to enable only what you need.

When to use it

The GitHub MCP server pairs naturally with a filesystem and a memory server for a full coding stack. See our curated developer loadouts for ready-made combinations, or browse the developer tools category for alternatives. Built your own GitHub-related server? Submit it to Loadout.

Loadout

Build your AI agent loadout

The directory of MCP servers and AI agents that actually work. Pick the right loadout for Slack, Postgres, GitHub, Figma and 20+ integrations — with install commands ready to paste into Claude Desktop, Cursor or your own stack.

© 2026 Loadout. Built on Angular 21 SSR.