Setup CodeRabbit MCP for Claude Code
npm install coderabbit-mcp-setupbash
npx cr-mcp [project-path]
`
$3
| Argument | Required | Description |
|----------|----------|-------------|
| github-pat | Yes | Your GitHub Personal Access Token |
| project-path | No | Path to your project (defaults to current directory) |
$3
`bash
Setup for current directory
npx cr-mcp ghp_xxxxxxxxxxxx
Setup for specific project
npx cr-mcp ghp_xxxxxxxxxxxx "D:\MyProject"
`
Getting a GitHub PAT
1. Go to https://github.com/settings/tokens
2. Click "Generate new token (classic)"
3. Give it a name like coderabbit-mcp
4. Select repo scope
5. Click "Generate token"
6. Copy the token (starts with ghp_)
After Setup
1. Restart Claude Code to load the MCP
2. Ask Claude: "Check CodeRabbit reviews for PR #45"
How it works
This tool adds the CodeRabbit MCP configuration to your ~/.claude.json file for the specified project. The MCP uses your GitHub PAT to fetch CodeRabbit review comments from your PRs.
Requirements
- Node.js 18+
- Claude Code
- CodeRabbit installed on your GitHub repo
- GitHub PAT with repo` scope