GitHub MCP Server Setup: Stop Tab‑Switching to GitHub in 2026
You're asking Claude to review a pull request, but it has no idea what's in the repo. You copy-paste code back and forth, losing context with every switch. There's a better way. This guide gets your official GitHub MCP Server running on Claude Desktop, Claude Code, or Cursor in under 10 minutes — and includes a free premium cheat sheet (normally $29) with every token scope and config template you'll need.
New to MCP? Start with Claude Desktop MCP Setup. For the tool profile, see GitHub MCP Server listing. For comparisons, read Best MCP Servers for Claude.
What GitHub MCP Server does
GitHub MCP Server is GitHub's official Model Context Protocol integration. It lets Claude interact directly with GitHub API endpoints for repositories, issues, pull requests, branches, and code search — no tab switching needed.
Ask Claude to list repos, inspect PRs, review changed files, search code, summarize issues, or prepare fixes before pushing changes.
Before you start
GitHub account
A GitHub account with access to repos you want Claude to read/write.
Claude client
Claude Desktop is easiest; also works with Claude Code and Cursor.
Personal Access Token
Create a token with only needed scopes – repo, read:org, read:user.
Step 1: Create a GitHub token
Go to GitHub Settings → Developer Settings → Personal Access Tokens. Choose classic (simpler) or fine-grained (tighter control).
Recommended GitHub token scopes
| Scope | Why you need it |
|---|---|
repo | Private repos, PRs, issues. |
read:org | Organization membership & visibility. |
read:user | User profile for account-level ops. |
Public-only? A more limited token works. For real workflows, repo is the practical baseline.
Step 2: Add GitHub MCP Server to Claude Desktop
Open claude_desktop_config.json and add:
Config file paths
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@github/github-mcp-server"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_TOKEN"
}
}
}
}Replace YOUR_GITHUB_TOKEN with your token from Step 1.
Step 3: Restart Claude and test it
Save the config, fully quit Claude, reopen. Try:
- List my GitHub repositories.
- Show open pull requests.
- Search this repo for auth middleware.
- Summarize issues labeled bug.
GitHub MCP Server for Claude Code and Cursor
The same token and package work with Claude Code (CLI config) and Cursor (MCP settings). Keep scopes minimal and document one approved method for teams.
Common GitHub MCP Server errors and fixes
Invalid JSON
Validate commas/braces in config.
Missing/expired token
Check token in env block.
Insufficient permissions
Add repo scope for private repos/PRs.
Not fully restarted
Quit and reopen Claude completely.
npx fails
Install Node.js LTS.
Security best practices
Least privilege
Start with minimal scopes, expand only if needed.
Separate tokens
Use distinct tokens for work and personal projects.
Rotate regularly
Set expiration dates, replace immediately if exposed.
Get the GitHub MCP Setup Cheat Sheet
The exact Markdown reference we use internally to onboard new developers. Normally sold for $29 — free today for mcpindex.dev readers.
- ▹ Ready‑to‑paste config block
- ▹ Token scopes quick reference
- ▹ Top 5 errors & fixes
Instant .md download. No email required.
Why GitHub MCP Server is worth installing
For most developers, GitHub MCP Server is the highest‑value MCP server. Once Claude reads repos, PRs, and issues, it becomes far more than a code assistant.
After GitHub, add Context7 MCP for docs and Desktop Commander for local execution.
Frequently asked questions (2026)
What is the GitHub MCP Server?▾
GitHub MCP Server is GitHub's official Model Context Protocol (MCP) server. It lets Claude connect directly to GitHub API endpoints so you can list repositories, search code, manage issues, open pull requests, and review changes without leaving the chat window.
Do I need a GitHub token?▾
Yes. You need a GitHub Personal Access Token to authenticate the GitHub MCP Server. For most Claude workflows, the recommended scopes are repo, read:org, and read:user. If you only need public repositories, you can use a more limited token.
Does GitHub MCP Server work with Claude Desktop only?▾
No. It works with Claude Desktop, Claude Code, Cursor, VS Code, and other MCP-compatible clients. The exact MCP server setup method changes slightly by client, but the same GitHub token and @github/github-mcp-server package are used.
What is the easiest way to install it?▾
The easiest method is using npx in your claude_desktop_config.json file. That avoids manual builds and keeps the GitHub MCP Server easy to update.
Why is the GitHub MCP Server not showing up in Claude?▾
The most common causes are an invalid claude_desktop_config.json file, a missing GitHub Personal Access Token, incorrect token scopes, or forgetting to fully restart Claude Desktop after saving the MCP server configuration.
Is GitHub MCP Server safe to use?▾
It can be safe if you follow least-privilege access. Use the minimum GitHub token scopes required, avoid production org-wide permissions when unnecessary, and review any write action before allowing Claude to proceed with GitHub API requests.
Explore more MCP tools
Browse the full MCPIndex directory for setup guides, config examples, and recommendations.