DevTools · MCP Server

GitHub MCP

MCP server that lets Claude read repos, open PRs, manage issues, and review code directly from chat.

MCP · GitHub

What it does

The GitHub MCP server lets Claude Desktop interact with your repositories as if it were another teammate on the review. Once installed, Claude can read files, search code across branches, open issues, create pull requests, and leave structured review comments — all from a normal chat. Pair it with the Senior Code Reviewer prompt and you have an in-chat code review workflow that runs against live PRs instead of pasted diffs.

What Claude can do with it installed

Claude can fetch the contents of any file or PR diff by URL, search for usages of a symbol across the repo, create or update issues with structured bodies, open a new pull request from a branch you specify, and leave multi-threaded review comments on existing PRs. It can also trigger GitHub Actions by creating the required workflow dispatch events, list commit history, and compare branches. Combined with the Git Commits skill, Claude can author both the code change and the conventional-commit message directly.

Who should use it

Engineers who are tired of copy-pasting diffs and review comments between GitHub and Claude. Tech leads who want Claude participating in PR reviews as a consistent 'second reviewer' with their own team conventions. Teams using monorepos where Claude needs cross-package context to answer a question well. Works on macOS and Windows; Linux is supported via the community build.

Safety

Use a fine-grained personal access token scoped only to the repositories Claude needs — never grant admin:org or the classic repo scope across your entire account. For organizations, use a dedicated bot account and a token that is easy to rotate. Treat claude_desktop_config.json like any other file containing secrets: never commit it, and update it when you rotate the token. For review-only workflows, scope the token to 'contents: read' and 'pull requests: write' so Claude can comment but cannot merge.

How to install

Which tool are you using?

Not sure? Claude.ai is the website. Claude Code is the command-line tool you install separately. Cursor is a code editor that reads .cursorrules.

  1. 01

    Create a GitHub personal access token

    Go to https://github.com/settings/tokens/new (classic tokens) or https://github.com/settings/personal-access-tokens/new (fine-grained, recommended). Give the token a descriptive name like 'Claude MCP'. Set expiration (90 days is a reasonable default). Select the scopes: repo (read+write to private repos), read:org (for organization repos), read:user.

    Fine-grained tokens are safer — scope them to specific repositories rather than your entire account. Treat the token like a password.

  2. 02

    Open the Claude Desktop config file

    Claude Desktop reads MCP config from a JSON file. Open it with your text editor:

    terminal
    # macOSopen ~/Library/Application\ Support/Claude/claude_desktop_config.json # Windowsnotepad %APPDATA%\Claude\claude_desktop_config.json

    If the file does not exist, create it with { "mcpServers": {} } as starting content.

  3. 03

    Add the GitHub server block

    Copy the JSON from the file section below. Merge the github entry into your mcpServers object, preserving any other MCP servers you already have configured.

  4. 04

    Paste your GitHub token

    Replace 'ghp_YOUR_TOKEN_HERE' with the token you generated in step 1. Save the file.

    Never commit claude_desktop_config.json to git. If you rotate the token, remember to update this file.

  5. 05

    Restart Claude Desktop and verify

    Fully quit Claude Desktop (Cmd+Q on Mac, close from taskbar on Windows) and reopen it. Start a new chat and ask: 'List the open issues in my-org/my-repo'. Claude should call the GitHub MCP tool and return live results.

    If the token expires or lacks permissions, Claude will surface the GitHub API error directly — usually obvious from the message.

The mcp server file

Copy the full contents below, or download the file directly.

claude_desktop_config.json
claude_desktop_config.json
{  "mcpServers": {    "github": {      "command": "npx",      "args": ["-y", "@modelcontextprotocol/server-github"],      "env": {        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_YOUR_TOKEN_HERE"      }    }  }}

Example output

What Claude does before and after you install this mcp server.

Without this mcp server

You copy-paste a diff from the GitHub UI to Claude, paste the review back into GitHub by hand.

With this mcp server

Claude reads the PR directly, posts a structured review as comments, and opens a follow-up issue for a flagged risk. You approve in the chat.

Customization tips

Use a fine-grained PAT scoped to the repositories Claude needs. For orgs, use a dedicated bot account so audit logs clearly show "Claude" activity vs real humans. Never use a token with admin:org scope. For GitHub Enterprise Server, add a GITHUB_API_URL env var pointing at your Enterprise instance. Rotate the token on a schedule — fine-grained tokens expire and force good hygiene automatically.

Related resources

Frequently asked questions

Does it support GitHub Enterprise Server?

Yes. Add a GITHUB_API_URL env var pointing to your Enterprise instance (e.g. https://github.mycompany.com/api/v3). See the MCP server README for the exact variable name.

Can Claude merge pull requests?

If the token has write permission, yes. For safety, use a fine-grained token with review permissions only unless you specifically need merge capability.

Does it read private repositories?

Yes, as long as the PAT has the repo scope for classic tokens, or explicit access to the repository for fine-grained tokens.

What are the rate limits?

GitHub API rate limits apply — typically 5000 requests per hour with a PAT. Fine-grained tokens share the same limit. You will almost never hit this unless Claude is in a tight loop.

Does it work on Windows?

Yes. The config path is %APPDATA%\Claude\claude_desktop_config.json. The JSON shape and token handling are identical. Use notepad or any text editor.

Want more like this?

Browse the full RohanKit library — free resources for Claude and Cursor.

Back to RohanKit