How to Add MCP GitHub to Claude Code (Step-by-Step)
Step 1 — Create token
Use least-privilege scope (repo/read:org depending on workflow).
Step 2 — Add MCP config
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {"GITHUB_PERSONAL_ACCESS_TOKEN": ""}
}
}
} Step 3 — Restart and verify
- Ask agent to list open issues in sandbox repo
- Then create a test issue
Common failures
- 403: token scope missing
- No tool execution: profile is messaging
- Wrong owner/repo identifiers