MCP & Connectors

How do you connect Claude to GitHub via MCP?

QUICK ANSWER

To connect Claude to GitHub, generate a Personal Access Token (Classic or Fine-Grained) on GitHub with access to your target repositories, and add the official GitHub MCP server configuration to your local Claude Desktop config file.

Step-by-step Connection

  1. Log in to GitHub and go to Settings > Developer settings > Personal access tokens > Tokens (classic).
  2. Click Generate new token. Set the scope permissions for repo (full control of private repositories), read:org, and gist.
  3. Copy the generated token immediately.
  4. Add the GitHub server block to your claude_desktop_config.json file:
    {
      "mcpServers": {
        "github": {
          "command": "npx",
          "args": ["-y", "@modelcontextprotocol/server-github"],
          "env": {
            "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_yourGitHubTokenHere"
          }
        }
      }
    }
  5. Restart Claude Desktop. Claude can now search issues, read code files, commit changes, and interact with PRs on GitHub.
Verified against: GitHub MCP Server v1.0.1