{
  "$schema": "https://promptfoo.tech/schemas/workflow-template.json",
  "name": "Claude + MCP: In-Editor GitHub Code Review Assistant",
  "slug": "claude-mcp-github-code-review",
  "platform": "Claude Desktop",
  "category": "mcp",
  "difficulty": "Intermediate",
  "tags": [
    "claude",
    "mcp",
    "github",
    "coding"
  ],
  "summary": "Use the GitHub MCP server to let Claude Desktop review open PRs — fetch diffs, understand the changes, and suggest a review comment set.",
  "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.",
  "variables": {
    "ANTHROPIC_API_KEY": "sk-ant-...",
    "GITHUB_TOKEN": "ghp_..."
  },
  "steps": [
    {
      "order": 1,
      "name": "Create a scoped PAT",
      "description": "Fine-grained token, only the target repos. Read-only where possible."
    },
    {
      "order": 2,
      "name": "Install and register the server",
      "description": "docker run ghcr.io/github/github-mcp-server, or the npm variant. Register in claude_desktop_config.json."
    },
    {
      "order": 3,
      "name": "Prompt template",
      "description": "'Review PR #N in {org}/{repo}. Group comments by severity (blocker/nit/question). Include suggested code changes as diffs.'"
    },
    {
      "order": 4,
      "name": "Human gate",
      "description": "Never enable auto-post on first rollout. Always paste in reviews yourself for the first 20 PRs."
    },
    {
      "order": 5,
      "name": "Add repo context to prompts",
      "description": "Reference your team's style guide inline — 'we prefer named exports, no default exports'."
    }
  ],
  "howItWorks": [
    "Install the official GitHub MCP server (Docker or npm).",
    "Provide a GitHub PAT with pull_request:read and contents:read scopes only.",
    "Register in Claude Desktop config.",
    "Ask: 'Review PR #482 in org/repo.' Claude fetches diff + relevant file context.",
    "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."
  ],
  "useCases": [
    "Small teams without dedicated reviewers.",
    "OSS maintainers with high PR volume.",
    "Contractors handing back review-ready work."
  ],
  "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": [
    {
      "q": "Is it as good as Copilot Review?",
      "a": "For style + obvious bugs, comparable. For team conventions, Claude+MCP is better because you control the prompt."
    },
    {
      "q": "Cost?",
      "a": "Anthropic tokens only. About $0.05-0.20 per medium PR."
    },
    {
      "q": "Can it approve PRs?",
      "a": "The server exposes review-creation tools. Leave approval as a human action — this is a hard rule."
    }
  ],
  "source": "https://promptfoo.tech/workflows/claude-mcp-github-code-review",
  "updated": "2026-06-08",
  "license": "CC-BY-4.0"
}