# Claude + MCP: In-Editor GitHub Code Review Assistant

> Use the GitHub MCP server to let Claude Desktop review open PRs — fetch diffs, understand the changes, and suggest a review comment set.

**Platform:** Claude Desktop  
**Category:** mcp  
**Difficulty:** Intermediate  
**Tags:** claude, mcp, github, coding  
**Updated:** 2026-06-08  
**Source:** https://promptfoo.tech/workflows/claude-mcp-github-code-review

## Overview
Wire the GitHub MCP server into Claude Desktop and ask Claude to review a PR end-to-end. It fetches the diff, reads the modified files in context, and produces a review with severity-tagged comments and suggested code. You still post the review — Claude is the reviewer, not the approver.

## How it works
1. Install the official GitHub MCP server (Docker or npm).
2. Provide a GitHub PAT with pull_request:read and contents:read scopes only.
3. Register in Claude Desktop config.
4. Ask: 'Review PR #482 in org/repo.' Claude fetches diff + relevant file context.
5. Output: markdown-formatted review with inline suggestions; you paste it into GitHub or use the create-review tool if enabled.

## Benefits
- Consistent first-pass reviews on every PR.
- Catches obvious bugs and missing tests before humans burn cycles.
- Junior devs get instant feedback outside working hours.

## Use cases
- Small teams without dedicated reviewers.
- OSS maintainers with high PR volume.
- Contractors handing back review-ready work.

## Step-by-step
### Step 1: Create a scoped PAT
Fine-grained token, only the target repos. Read-only where possible.

### Step 2: Install and register the server
docker run ghcr.io/github/github-mcp-server, or the npm variant. Register in claude_desktop_config.json.

### Step 3: Prompt template
'Review PR #N in {org}/{repo}. Group comments by severity (blocker/nit/question). Include suggested code changes as diffs.'

### Step 4: Human gate
Never enable auto-post on first rollout. Always paste in reviews yourself for the first 20 PRs.

### Step 5: Add repo context to prompts
Reference your team's style guide inline — 'we prefer named exports, no default exports'.

## Example
```
Review output: 'Blocker (src/auth.ts:42): This bypasses the middleware — attach requireAuth. Nit (src/user.ts:88): consider useMemo here. Question (tests/api.test.ts): why is this expected to be null?'
```

## FAQs
**Is it as good as Copilot Review?**

For style + obvious bugs, comparable. For team conventions, Claude+MCP is better because you control the prompt.

**Cost?**

Anthropic tokens only. About $0.05-0.20 per medium PR.

**Can it approve PRs?**

The server exposes review-creation tools. Leave approval as a human action — this is a hard rule.

---
Licensed under CC-BY-4.0. Attribution: PromptFoo.tech