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.

GitHub MCP Server 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>"}}'

GitHub in Claude Code: stdio checks

  • 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.

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.

Claude Code's github-mcp-server example uses stdio.

GitHub MCP Server's Claude Code configuration invokes docker and a running Docker engine.

Claude Code's GitHub MCP Server example references GITHUB_PERSONAL_ACCESS_TOKEN. Check these names if startup or authentication fails; the example alone does not distinguish required from optional values.