What the GitHub MCP server does
The GitHub MCP server connects AI assistants like Claude directly to the GitHub API. Instead of switching between your editor and GitHub's web UI, you can manage your entire repository workflow through natural language.
Common things you can ask once the server is connected:
- "Open an issue for the login bug I just found"
- "Show me all open PRs on the frontend repo"
- "Create a branch called
feature/dark-modefrom main" - "What did the last three commits touch?"
- "Add a comment to PR #247 asking for a test case"
The AI handles the GitHub API calls. You just describe what you want.
New to MCP? Read What is an MCP server? first, or see How to install an MCP server for a general installation walkthrough.
What it exposes
The official GitHub MCP server exposes tools across five areas:
Repositories: create, fork, list, search, get file contents, push file changes
Issues: create, list, get, comment, close
Pull requests: create, list, get, review, merge, add comments
Git operations: create branches, list commits, get diffs
Search: search code, issues, repositories, users
Prerequisites
- A GitHub account with a Personal Access Token (PAT)
- An MCP-compatible client (Claude Desktop, Cursor, Windsurf, etc.)
- Node.js 18+ installed
Setup
Step 1: Create a GitHub PAT
Go to GitHub Settings, then Developer Settings, then Personal Access Tokens. Create a fine-grained token with the scopes your use case requires. For full repo management: repo, read:org, read:user.
Step 2: Install the server
npx -y @modelcontextprotocol/server-github
Or install globally:
npm install -g @modelcontextprotocol/server-github
Step 3: Configure your MCP client
For Claude Desktop, add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "your-token-here"
}
}
}
}
Restart Claude Desktop. The GitHub tools should appear.
Security note
Keep your PAT scoped to what you actually need. A read-only token is safer if you only want the AI to pull information. Only grant write permissions if you want the AI to push changes, create issues, or open PRs.
Never commit your PAT to a repository, even a private one.
Local setup
The setup above runs the GitHub server locally via npx. This means Node.js needs to be installed on your machine. The server runs as a local process and communicates with your AI client over stdio.
Find it on MCP Marketplace
The GitHub MCP server is listed on MCP Marketplace with its security score and install stats. You can also browse related servers for code review, CI/CD, and project management tools that pair well with GitHub.
For a broader list of developer-focused servers, see Best MCP servers for developers.