GitHub MCP Server Setup for Claude Desktop
This guide shows you exactly how to install the official GitHub MCP Server for Claude Desktop, Claude Code, and Cursor. You will create a GitHub token, add the server config, restart Claude, and test the connection in a few minutes.
If you want the tool profile first, see the GitHub MCP Server listing. For broader recommendations, read Best MCP Servers for Claude.
What GitHub MCP Server does
GitHub MCP Server is GitHub's official MCP integration. It lets Claude interact directly with repositories, issues, pull requests, branches, and code search so you can work inside GitHub without constantly switching tabs.
In practice, that means you can ask Claude to list your repositories, inspect a pull request, review changed files, search across a codebase, summarize open issues, or prepare a fix before you push changes.
Before you start
GitHub account
You need a GitHub account with access to the repositories you want Claude to read or modify.
Claude client
Claude Desktop is the easiest starting point, but the same server also works with Claude Code and Cursor.
Personal Access Token
Create a GitHub Personal Access Token with only the permissions your workflow actually needs.
Step 1: Create a GitHub token
Go to GitHub Settings, then Developer Settings, then Personal Access Tokens. You can use a classic token for simplicity or a fine-grained token if you want tighter repository restrictions.
Recommended scopes
| Scope | Why you need it |
|---|---|
repo | Read and manage private repositories, pull requests, and issues. |
read:org | Read organization membership and organization-level repository access. |
read:user | Read your user profile information for account-level operations. |
If you only need public repository access, you can use a more limited token. For most real-world Claude workflows, though, repo is the practical baseline.
Step 2: Add GitHub MCP Server to Claude Desktop
Open your Claude Desktop configuration file and add the GitHub server entry inside the mcpServers object.
Claude Desktop config paths
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
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 the token you created in Step 1.
Step 3: Restart Claude and test it
Save the config file, fully quit Claude Desktop, and reopen it. A simple window refresh is not always enough. The MCP server usually loads when the client starts.
Test prompts
- List my GitHub repositories.
- Show me the open pull requests in my repository.
- Search this repo for auth middleware.
- Summarize the latest issues labeled bug.
GitHub MCP Server for Claude Code and Cursor
The same GitHub token and server package also work outside Claude Desktop. Claude Code supports MCP server registration through its CLI and config system, while Cursor can use MCP-compatible integrations through its own client setup flow.
If your team uses multiple clients, keep the token scopes minimal and document one approved setup method internally so everyone uses the same safe defaults.
Common errors and fixes
Invalid JSON in config file
If Claude does not start correctly, validate your JSON first. A missing comma or brace is the most common setup issue.
Token is missing or expired
If the server appears but GitHub actions fail, confirm that your token is still valid and correctly pasted into the env block.
Insufficient permissions
If Claude can see your account but not private repositories or pull requests, your token probably needs repo scope or broader repository access.
Claude was not fully restarted
After editing the config, completely close Claude Desktop and reopen it. Background processes can keep the old config loaded.
npx cannot resolve the package
Make sure Node.js is installed and available in your PATH. Without Node, Claude cannot run npx-based MCP servers.
Security best practices
Use least privilege
Do not grant broader repository permissions than you actually need. Start small and expand only if a workflow requires it.
Separate personal and work access
If possible, use separate tokens for personal projects and company repositories so a single leak does not expose everything.
Rotate tokens regularly
Use expiration dates and rotate tokens on a schedule. Replace old tokens immediately if you suspect any exposure.
Why GitHub MCP Server is worth installing
For most developers, GitHub is the highest-value MCP integration because it sits at the center of day-to-day engineering work. Once Claude can read repositories, inspect pull requests, and summarize issue threads, it becomes much more useful than a plain code assistant.
If you are only going to install one MCP server first, GitHub is usually the best place to start. After that, the next strongest pair is often Context7 for documentation and Desktop Commander for local execution.
Frequently asked questions
What is the GitHub MCP Server?▾
GitHub MCP Server is GitHub's official Model Context Protocol server. It lets Claude connect directly to GitHub 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 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 setup method changes slightly by client, but the same token and server package are used.
What is the easiest way to install it?▾
The easiest method is using npx in your Claude Desktop config file. That avoids manual builds and keeps the server easy to update.
Why is the GitHub MCP Server not showing up in Claude?▾
The most common causes are an invalid JSON config file, a missing token, incorrect token permissions, or forgetting to fully restart Claude Desktop after saving the config.
Is GitHub MCP Server safe to use?▾
It can be safe if you follow least-privilege access. Use the minimum token scopes required, avoid production org-wide permissions when unnecessary, and review any write action before allowing Claude to proceed.
Explore more MCP tools
Browse the full MCPIndex directory for setup guides, config JSON, and recommendations across GitHub, databases, design tools, productivity, monitoring, and security.