MCP Directory

How to add GitHub MCP Server to Claude Desktop

GitHub's official server for repos, issues, PRs, and Actions — local Docker or hosted remote. Paste the config into ~/Library/Application Support/Claude/claude_desktop_config.json and restart Claude Desktop.

Last updated June 15, 2026 · 31k · stdio · apikey · official

Claude Desktop config for GitHub MCP Server

docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server
{
  "mcpServers": {
    "github-mcp-server": {
      "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>"
      }
    }
  }
}

Requires Docker to be installed and running.

Setup steps

  1. 1Open Claude Desktop → Settings → Developer → Edit Config (this opens ~/Library/Application Support/Claude/claude_desktop_config.json).
  2. 2Paste the GitHub MCP Server config below under the top-level "mcpServers" key.
  3. 3Fill in any placeholder secrets (API keys, paths) in the snippet.
  4. 4Save the file, then fully quit and reopen Claude Desktop.
  5. 5Open a chat and confirm GitHub MCP Server's tools appear under the 🔌 tools menu.

Before you start

  • For the remote server: an MCP client that supports remote servers (VS Code 1.101+, Claude Desktop, Cursor, Windsurf) and either GitHub OAuth or a personal access token
  • For local use: Docker running, or a Go build environment to build from source
  • A GitHub personal access token — choose scopes for what you need, e.g. `repo` for repository/issue/PR operations, `read:org` for org/team data, `security_events` for code scanning, `notifications`, and `gist`
  • For GitHub Enterprise Server: set GITHUB_HOST to your instance URL

What GitHub MCP Server can do in Claude Desktop

repos (toolset)

Browse and manage repositories: get_file_contents, search_code, list_commits, create_branch, push files.

issues (toolset)

Read and write issues: issue_read, issue_write, list_issues, search_issues.

pull_requests (toolset)

Work with PRs: create_pull_request, pull_request_read, list_pull_requests, merge_pull_request.

actions (toolset)

Inspect and run CI: actions_list, actions_get, actions_run_trigger, get_job_logs.

code_security / secret_protection (toolsets)

Read scanning results: get_code_scanning_alert, get_secret_scanning_alert, list_dependabot_alerts.

users / orgs (toolsets)

Look up users, organizations, and team membership.

discussions, gists, projects, labels, notifications, git (toolsets)

Additional capabilities you can enable as needed for discussions, gists, project boards, labels, notifications, and low-level git operations.

Security

A personal access token grants broad read/write to your repos, so mint a fine-grained token limited to the repositories and scopes you actually need. The hosted remote server uses OAuth and avoids storing a long-lived token locally.

GitHub MCP Server + Claude Desktop FAQ

Where is the Claude Desktop config file?

Claude Desktop reads MCP servers from ~/Library/Application Support/Claude/claude_desktop_config.json. Paste the GitHub MCP Server config there under the "mcpServers" key and restart the client.

Is GitHub MCP Server safe to use with Claude Desktop?

A personal access token grants broad read/write to your repos, so mint a fine-grained token limited to the repositories and scopes you actually need. The hosted remote server uses OAuth and avoids storing a long-lived token locally.

Should I use the remote server or the local Docker image?

Use the hosted remote server (https://api.githubcopilot.com/mcp/) for the quickest setup and OAuth support. Use the local Docker image (ghcr.io/github/github-mcp-server) when you need self-hosting, air-gapped control, or GitHub Enterprise Server.

What token scopes do I need?

It depends on the toolsets. `repo` covers most repository, issue, and PR work; add `read:org` for org/team data, `security_events` for code scanning, and `notifications` or `gist` for those features. Grant the least privilege required.

How do I limit which tools are exposed?

Set GITHUB_TOOLSETS to a comma-separated list of toolsets (or GITHUB_TOOLS for individual tools). The defaults are context, repos, issues, pull_requests, and users.

View repo Full GitHub MCP Server page