Data as of

GitHub MCP Server for Claude Code: Setup & Config

GitHub MCP Server connects Claude Code to repository content, issues, pull requests, and platform workflows.

What you can do with GitHub in Claude Code

Give agents GitHub-native repository context and issue, review, workflow, and security operations.

  • Investigate failed GitHub Actions runs and development pipeline activity.
  • Review security findings and Dependabot alerts.
  • Coordinate discussions, notifications, and team project work.

Before you start: GitHub in Claude Code

  • Docker installed and running for local container execution
  • An MCP-compatible host
  • GitHub authentication and appropriate account permissions

The command uses the README's local PAT-based Docker example. The remote URL uses HTTP and supports OAuth where the host implements it, or PAT authentication. Grant only the permissions required for your tasks.

GitHub Claude Code configuration

  1. Choose Claude Code configuration scope

    For GitHub MCP Server, open Project scope: .mcp.json at the repository root. Project JSON: merge into mcpServers; user scope: use the CLI.

  2. Add GitHub MCP Server to Claude Code

    Use the github-mcp-server entry below in mcpServers. Keep GitHub MCP Server's documented stdio connection fields and your other Claude Code entries.

  3. Check GitHub MCP Server in Claude Code

    GitHub MCP Server: Inspect claude mcp list and /mcp status.

Config file · Project scope: .mcp.json at the repository root

JSON
{
  "mcpServers": {
    "github-mcp-server": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GITHUB_PERSONAL_ACCESS_TOKEN",
        "ghcr.io/github/github-mcp-server"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<your GitHub personal access token with appropriate permissions>"
      }
    }
  }
}

CLI (POSIX shell)
claude mcp add-json --scope project 'github-mcp-server' '{"type":"stdio","command":"docker","args":["run","-i","--rm","-e","GITHUB_PERSONAL_ACCESS_TOKEN","ghcr.io/github/github-mcp-server"],"env":{"GITHUB_PERSONAL_ACCESS_TOKEN":"<your GitHub personal access token with appropriate permissions>"}}'

Troubleshooting GitHub in Claude Code

  • If GitHub MCP Server fails to start, check docker and a running Docker engine, the working directory, and Claude Code's selected scope; inspect claude mcp list and /mcp.
  • GitHub MCP Server: check GITHUB_PERSONAL_ACCESS_TOKEN; keep credentials out of shared .mcp.json.
  • GitHub MCP Server uses stdio here: Claude Code must keep the configured process running; protocol output belongs on stdout and diagnostics on stderr.
  • Known limitation: OAuth support and configuration vary by MCP host.
  • Known limitation: GitHub Enterprise Server cannot use the hosted remote service.
  • Known limitation: Individual tool names are not stated in the supplied README excerpt.
  • General Claude Code troubleshooting lives in the /clients/claude-code guide.

GitHub MCP Server — details. Claude Code guide

Frequently asked questions

Register GitHub MCP Server with the displayed claude mcp add-json --scope project command, or merge the JSON into .mcp.json at the repository root.