Skip to content
AI Agent How-To

Home ›MCP server setup guides

GitHub MCP Server (Remote and Local)

Intermediate ~7 min read Last tested October 2026

Updated 2026-10-28

The GitHub MCP server is GitHub’s own server for issues, pull requests, and repository files. In Cursor, the supported remote setup is a Streamable HTTP URL plus a personal access token. Claude Desktop’s install guide says the remote server is not supported there yet, so Claude Desktop uses the local Docker image instead. If you need a custom tool instead of GitHub’s hosted server, start with Build an MCP server in Python. To call the same tools from your own Python loop, see Connect an AI agent to an MCP server. Last tested 2026-10-25.

The old npm package @modelcontextprotocol/server-github is not supported as of April 2025. Use https://api.githubcopilot.com/mcp/ or the image ghcr.io/github/github-mcp-server.

Prerequisites

  • A GitHub account.
  • Cursor, current enough for remote MCP. GitHub’s Cursor guide requires Cursor v0.48.0 or later for Streamable HTTP. Or Claude Desktop, latest version, plus Docker, if you use the local server.
  • A GitHub personal access token for the remote Cursor setup. GitHub’s Cursor guide says this server currently requires a PAT in Cursor, even though Cursor supports OAuth for some other MCP servers. Create one at github.com/settings/personal-access-tokens/new or github.com/settings/tokens.

Docs used for the steps below:

Steps

1. Create a token and keep it out of git

Use a token whose scopes match the actions you want. GitHub’s local-server notes name repo for repository operations, read:packages for Docker image access, and read:org for organization team access. The Claude install guide’s authentication check calls out the repo scope when auth fails. Do not commit the token. Do not paste it into a project file you push.

2. Connect the remote server in Cursor

GitHub hosts the remote server at https://api.githubcopilot.com/mcp/.

  1. Open the global file ~/.cursor/mcp.json, or .cursor/mcp.json in one project.
  2. Add the server. The Cursor install guide uses the mcpServers key.
{
  "mcpServers": {
    "github": {
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer YOUR_GITHUB_PAT"
      }
    }
  }
}
  1. Replace YOUR_GITHUB_PAT with the token. The install guide’s UI path is Tools & Integrations, then MCP tools, then the pencil icon next to “github”.
  2. Save and restart Cursor.
  3. Confirm a green dot under Settings, then Tools & Integrations, then MCP Tools. In chat, ask it to list repositories you can access.

VS Code’s config uses a servers key and "type": "http". Cursor’s guide uses mcpServers and does not include type. Use the Cursor block above in Cursor.

3. Connect Claude Desktop with Docker

GitHub’s Claude Desktop section says remote connectors need a registered GitHub App or OAuth App, which this server does not support there. Use the local image.

  1. Install Docker and start it.
  2. In Claude Desktop, open Settings, then Developer, then Edit Config. On macOS the file is ~/Library/Application Support/Claude/claude_desktop_config.json. On Windows it is %APPDATA%\Claude\claude_desktop_config.json. On Linux it is ~/.config/Claude/claude_desktop_config.json.
  3. Add the PAT form of the local server from the Claude install guide.
{
  "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"
      }
    }
  }
}
  1. Replace YOUR_GITHUB_PAT. Restart Claude Desktop.

The same guide also documents a Docker OAuth login that publishes 127.0.0.1:8085:8085 and sets GITHUB_OAUTH_CALLBACK_PORT to 8085, with no token in the file. Use that block if you do not want a PAT on disk. The PAT env var takes precedence when both are set.

Cursor can run this Docker command too. The Cursor guide’s local block uses the same image and the same GITHUB_PERSONAL_ACCESS_TOKEN env var, under mcpServers.

If you run that container on a small VPS instead of your laptop, a host such as DigitalOcean is enough. The remote URL in step 2 does not need a VPS.

4. Ask for something the token can see

Ask the client to list open pull requests on a repository the token can read. If the tool list is empty, restart the client once after the JSON is valid. GitHub’s docs also note that a tool which maps to a paid feature still requires that feature. Copilot cloud agent tools need a paid Copilot license. Listing a repository you can already open does not.

Common errors

Streamable HTTP not working in Cursor. GitHub’s Cursor guide says you need Cursor v0.48.0 or later. Upgrade Cursor, then restart it.

Authentication failures. The PAT is expired, missing, or missing a scope the call needs. The Claude guide tells you to check the repo scope when auth fails. Generate a new token and replace it in the JSON. Restart the client.

Image pull failures. The local server pulls ghcr.io/github/github-mcp-server. If the pull fails, run docker logout ghcr.io and pull again. The image is public. An expired ghcr.io token is the usual cause. Docker Desktop has to be running.

Docker not found, or spawn docker ENOENT. The client cannot see docker on PATH. Start Docker Desktop. If it is installed and the GUI client still cannot find it, see Fix: MCP server not connecting and use the absolute path to the docker binary.

Invalid JSON. A trailing comma in mcp.json or claude_desktop_config.json drops the whole file. Validate it before restarting.

Tools not appearing. Cursor’s guide says the server should show a green dot in MCP settings. If the dot is missing, the process did not start. Read the MCP log, fix the JSON, and restart the app completely, not only the chat panel.

Claude Desktop plus the remote URL. That combination is the one the Claude install guide says is unsupported. Switch Claude Desktop to the Docker block in step 3.

FAQ

What is the MCP server for GitHub?

It is the server GitHub maintains for repository, issue, and pull request actions. The remote URL is https://api.githubcopilot.com/mcp/. The local package is the Docker image ghcr.io/github/github-mcp-server.

How do I add it in Cursor?

Put the mcpServers block from step 2 in ~/.cursor/mcp.json or in .cursor/mcp.json. Set the Authorization header to Bearer plus a personal access token. Restart Cursor. You need Cursor v0.48.0 or later.

Why does Claude Desktop ignore the remote URL?

GitHub’s Claude Desktop instructions say the remote server needs an OAuth app that Claude Desktop does not support for this server. Use the Docker configuration in step 3.