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
- Log in to GitHub and go to Settings > Developer settings > Personal access tokens > Tokens (classic).
- Click Generate new token. Set the scope permissions for
repo(full control of private repositories),read:org, andgist. - Copy the generated token immediately.
- Add the GitHub server block to your
claude_desktop_config.jsonfile:{ "mcpServers": { "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_yourGitHubTokenHere" } } } } - 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