.mcp.json

GitHub MCP server

Connects Claude Code to GitHub's remote MCP server to read issues, pull requests and reviews inside a session. The token comes from an environment variable, so the .mcp.json file can be committed for the whole team.

Tested with Claude Code 2.1.329

.mcp.json
{
  "mcpServers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer ${GITHUB_MCP_PAT}"
      }
    }
  }
}

Notes

  • Create a fine-grained token at github.com/settings/personal-access-tokens with access only to the repos you need.
  • Put it in the `GITHUB_MCP_PAT` environment variable on each machine, for example in ~/.zshrc. Never write the token into a file.
  • Start Claude Code, run `/mcp`, approve the project server and check it shows a tick.

Related lessons

Type to search the reference, templates and lessons.