A local PR review tool that lets you review git diffs, add comments, and send feedback to AI coding agents via MCP (Model Context Protocol).
When reviewing PRs or working with AI coding assistants, you often want to:
- See the full diff in a proper UI (not inline in your editor)
- Add comments on specific lines or general feedback
- Process multiple comments with AI to consolidate/improve them
- Have your AI assistant automatically receive and act on your feedback
This tool does exactly that - locally, with no external services required (except optional AI providers for comment processing).
- Node.js 20+
- pnpm (recommended) or npm
git clone https://github.com/nartc/local-pr-reviewer.git
cd local-pr-reviewer
pnpm install
pnpm buildThe MCP server allows AI coding agents to directly receive your review comments. This is the recommended approach for Claude Code, Cursor, and other MCP-compatible agents.
Add the following to your agent's MCP configuration:
Claude Code CLI (~/.claude/settings.json on macOS, ~/.config/claude/config.json on Linux):
{
"mcpServers": {
"pr-reviewer": {
"type": "local",
"command": [
"node",
"/absolute/path/to/local-pr-reviewer/dist/mcp-server/index.js"
]
}
}
}Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"pr-reviewer": {
"command": "node",
"args": [
"/absolute/path/to/local-pr-reviewer/dist/mcp-server/index.js"
]
}
}
}Cursor (~/.cursor/mcp.json):
{
"mcpServers": {
"pr-reviewer": {
"command": "node",
"args": [
"/absolute/path/to/local-pr-reviewer/dist/mcp-server/index.js"
]
}
}
}After adding the configuration, restart your coding agent for changes to take effect.
If you prefer automatic configuration, run:
pnpm setup:mcpThis will detect installed agents and configure them automatically. You'll still need to restart your agent afterward.
Once configured, your agent will have access to:
| Tool | Description |
|---|---|
check_pr_comments |
Check for pending review comments in the current repo |
mark_comment_resolved |
Mark a comment as resolved after addressing it |
list_pending_comments |
List pending comments across all repos |
list_repo_pending_comments |
List pending comments for current repo only |
get_comment_details |
Get full details of a specific comment |
Copy the example environment file:
cp .env.example .envEdit .env with your settings:
# AI Provider API Keys (at least one required for AI processing features)
GOOGLE_API_KEY=your-key-here
OPENAI_API_KEY=your-key-here
ANTHROPIC_API_KEY=your-key-here
# Repository scanning settings
REPO_SCAN_ROOT=/Users/me/code # Directories to scan for git repos
REPO_SCAN_MAX_DEPTH=3 # How deep to scan for reposREPO_SCAN_ROOT accepts a comma-separated list of absolute paths to scan for git repositories:
# Single directory
REPO_SCAN_ROOT=/Users/me/code
# Multiple directories
REPO_SCAN_ROOT=/Users/me/code,/Users/me/projects,/Users/me/workIf not set, defaults to your home directory ($HOME).
Start the server:
pnpm start # Production
# or
pnpm dev # Development with hot reload- Select a repository from the scanned list
- View the diff against the base branch
- Add comments:
- Click on line numbers in the diff to add inline comments
- Use the + button in the Comments panel for general feedback
- Queue or Send Now:
- Queue - Stage comments for batch sending
- Send Now - Immediately send to your agent
- Process with AI (optional) - Consolidate and improve staged comments
- I don't think this is working 😅
- Send - Deliver all staged comments to your agent
Your agent calls check_pr_comments to receive pending comments for the current repository. After addressing each comment, it should call mark_comment_resolved to mark it complete.
- React Router 7 - Full-stack React framework
- Effect - Typed functional programming
- MCP SDK - Model Context Protocol server
- Radix UI + Tailwind CSS - UI components
- better-sqlite3 - Local database
- Vercel AI SDK - AI provider integrations
MIT