Detailed guide on configuring GitHub MCP Server, including Personal Access Token creation, permission settings, and security configuration. For developers who need AI to safely operate GitHub repositories.
GitHub MCP Server enables AI Agents to safely operate GitHub repositories.
Capabilities:
Token name
Claude-Code-MCP
Expiration
Scopes
| Scope | Description | Recommended |
|---|---|---|
| repo | Full control of private repos | Required |
| repo:status | Access commit status | Recommended |
| public_repo | Access public repos | Recommended |
Minimum recommended
repo, repo:status, public_repo
Important: Token only shown once!
ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
{
"mcpServers": {
"github": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
}
/mcp to see github toolMinimum: repo, repo:status, public_repo. Select based on needs.
Create new token on GitHub, update config, restart Claude Code.
Use environment variables, never commit to repo, use password manager.
人类专家验证
官方机器人验证