codereview buddy helps your AI agent interact with AI code review--smoothly!
Project description
codereviewbuddy
An MCP server that helps your AI coding agent interact with AI code reviewers — smoothly.
Manages review comments from Unblocked, Devin, and CodeRabbit on GitHub PRs with staleness detection, batch resolution, re-review triggering, and issue tracking.
[!WARNING] Bleeding edge. This server runs on Python 3.14 and FastMCP v3 prerelease (
>=3.0.0rc1). FastMCP v3 is pre-release software — APIs may change before stable. We track it closely and pin versions inuv.lockfor reproducibility, but be aware that upstream breaking changes are possible.
Features
Review comment management
- List review comments — inline threads, PR-level reviews, and bot comments (codecov, netlify, vercel, etc.) with reviewer identification and staleness detection
- Stacked PR support —
list_stack_review_commentsfetches comments across an entire PR stack in one call - Resolve comments — individually or bulk-resolve stale ones (files changed since the review)
- Smart skip logic —
resolve_stale_commentsskips reviewers that auto-resolve their own comments (Devin, CodeRabbit), only batch-resolving threads from reviewers that don't (Unblocked) - Reply to anything — inline review threads (
PRRT_), PR-level reviews (PRR_), and bot issue comments (IC_) all routed to the correct GitHub API - Request re-reviews — per-reviewer logic handles differences automatically (manual trigger for Unblocked, auto for Devin/CodeRabbit)
Issue tracking
- Create issues from review comments — turn useful AI suggestions into GitHub issues with labels, PR backlinks, file/line location, and quoted comment text
Server features (FastMCP v3)
- Typed output schemas — all tools return Pydantic models with JSON Schema, giving MCP clients structured data instead of raw strings
- Progress reporting — long-running operations report progress via FastMCP context (visible in MCP clients that support it)
- Production middleware — ErrorHandling (transforms exceptions to clean MCP errors with tracebacks), Timing (logs execution duration for every tool call), and Logging (request/response payloads for debugging)
- Update checker —
check_for_updatescompares the running version against PyPI and suggests upgrade commands - Zero config auth — uses
ghCLI, no PAT tokens or.envfiles
CLI testing (free with FastMCP v3)
FastMCP v3 gives you terminal testing of the server with no extra code:
# List all tools with their signatures
fastmcp list codereviewbuddy.server:mcp
# Call a tool directly from the terminal
fastmcp call codereviewbuddy.server:mcp list_review_comments pr_number=42
# Inspect server metadata
fastmcp inspect codereviewbuddy.server:mcp
# Run with MCP Inspector for interactive debugging
fastmcp dev codereviewbuddy.server:mcp
Prerequisites
- GitHub CLI (
gh) installed and authenticated (gh auth login) - Python 3.14+
Installation
This project uses uv. No install needed — run directly:
uvx codereviewbuddy
Or install permanently:
uv tool install codereviewbuddy
MCP Client Configuration
Quick setup (recommended)
One command configures your MCP client — no manual JSON editing:
uvx codereviewbuddy install claude-desktop
uvx codereviewbuddy install claude-code
uvx codereviewbuddy install cursor
uvx codereviewbuddy install windsurf
uvx codereviewbuddy install windsurf-next
With optional environment variables:
uvx codereviewbuddy install windsurf \
--env CRB_SELF_IMPROVEMENT__ENABLED=true \
--env CRB_SELF_IMPROVEMENT__REPO=your-org/codereviewbuddy
For any other client, generate the JSON config:
uvx codereviewbuddy install mcp-json # print to stdout
uvx codereviewbuddy install mcp-json --copy # copy to clipboard
Restart your MCP client after installing. See uvx codereviewbuddy install --help for all options.
Manual configuration
If you prefer manual setup, add the following to your MCP client's config JSON:
{
"mcpServers": {
"codereviewbuddy": {
"command": "uvx",
"args": ["--prerelease=allow", "codereviewbuddy@latest"],
"env": {
// All CRB_* env vars are optional — zero-config works out of the box.
// See Configuration section below for the full list.
// Per-reviewer overrides (JSON string — omit to use adapter defaults)
// "CRB_REVIEWERS": "{\"devin\": {\"enabled\": false}}",
// Self-improvement: agents file issues when they hit server gaps
// "CRB_SELF_IMPROVEMENT__ENABLED": "true",
// "CRB_SELF_IMPROVEMENT__REPO": "your-org/codereviewbuddy",
// Diagnostics (off by default)
// "CRB_DIAGNOSTICS__IO_TAP": "true",
// "CRB_DIAGNOSTICS__TOOL_CALL_HEARTBEAT": "true"
}
}
}
}
The server auto-detects your project from MCP roots (sent per-window by your client). This works correctly with multiple windows open on different projects — no env vars needed.
Why
--prerelease=allow? codereviewbuddy depends on FastMCP v3 prerelease (>=3.0.0rc1). Without this flag,uvxrefuses to resolve pre-release dependencies.Why
@latest? Without it,uvxcaches the first resolved version and never upgrades automatically.
From source (development)
For local development, use uv run --directory to run the server from your checkout instead of the PyPI-published version. Changes to the source take effect immediately — just restart the MCP server in your client.
{
"mcpServers": {
"codereviewbuddy": {
"command": "uv",
"args": ["run", "--directory", "/path/to/codereviewbuddy", "codereviewbuddy"],
"env": {
// Same CRB_* env vars as above, plus dev-specific settings:
"CRB_SELF_IMPROVEMENT__ENABLED": "true",
"CRB_SELF_IMPROVEMENT__REPO": "detailobsessed/codereviewbuddy",
"CRB_DIAGNOSTICS__IO_TAP": "true",
"CRB_DIAGNOSTICS__TOOL_CALL_HEARTBEAT": "true",
"CRB_DIAGNOSTICS__HEARTBEAT_INTERVAL_MS": "5000",
"CRB_DIAGNOSTICS__INCLUDE_ARGS_FINGERPRINT": "true"
}
}
}
}
Troubleshooting
If your MCP client reports No module named 'fastmcp.server.tasks.routing', the runtime has an incompatible FastMCP. Fixes:
- Prefer
uvx --prerelease=allow codereviewbuddy@latestin MCP client config. - For local source checkouts, launch with
uv run --directory /path/to/codereviewbuddy codereviewbuddy. - Reinstall to refresh cached deps:
uv tool install --reinstall codereviewbuddy.
MCP Tools
| Tool | Description |
|---|---|
summarize_review_status |
Lightweight stack-wide overview with severity counts — auto-discovers stack when pr_numbers omitted |
list_review_comments |
Fetch all review threads with reviewer ID, status, staleness, and auto-discovered stack field |
list_stack_review_comments |
Fetch comments for multiple PRs in a stack in one call, grouped by PR number |
resolve_comment |
Resolve a single inline thread by GraphQL node ID (PRRT_...) |
resolve_stale_comments |
Bulk-resolve threads on files modified since the review, with smart skip for auto-resolving reviewers |
reply_to_comment |
Reply to inline threads (PRRT_), PR-level reviews (PRR_), or bot comments (IC_) |
create_issue_from_comment |
Create a GitHub issue from a review comment with labels, PR backlink, and quoted text |
review_pr_descriptions |
Analyze PR descriptions across a stack for quality issues (empty body, boilerplate, missing linked issues) |
Configuration
codereviewbuddy works zero-config with sensible defaults. All configuration is via CRB_* environment variables in the "env" block of your MCP client config — no config files needed. Nested settings use __ (double underscore) as a delimiter. See the dev setup above for a fully-commented example.
All settings
| Env var | Type | Default | Description |
|---|---|---|---|
CRB_REVIEWERS |
JSON | {} |
Per-reviewer overrides as a JSON string (see below) |
CRB_PR_DESCRIPTIONS__ENABLED |
bool | true |
Whether review_pr_descriptions tool is available |
CRB_SELF_IMPROVEMENT__ENABLED |
bool | false |
Agents file issues when they encounter server gaps |
CRB_SELF_IMPROVEMENT__REPO |
string | "" |
Repository to file issues against (e.g. owner/repo) |
CRB_DIAGNOSTICS__IO_TAP |
bool | false |
Log stdin/stdout for transport debugging |
CRB_DIAGNOSTICS__TOOL_CALL_HEARTBEAT |
bool | false |
Emit heartbeat entries for long-running tool calls |
CRB_DIAGNOSTICS__HEARTBEAT_INTERVAL_MS |
int | 5000 |
Heartbeat cadence in milliseconds |
CRB_DIAGNOSTICS__INCLUDE_ARGS_FINGERPRINT |
bool | true |
Log args hash/size in tool call logs |
Severity levels
Each reviewer adapter classifies comments using its own format. Currently only Devin has a known severity format (emoji markers). Unblocked and CodeRabbit comments default to info until their formats are investigated.
Devin's emoji markers:
| Emoji | Level | Meaning |
|---|---|---|
| 🔴 | bug |
Critical issue, must fix before merge |
| 🚩 | flagged |
Likely needs a code change |
| 🟡 | warning |
Worth addressing but not blocking |
| 📝 | info |
Informational, no action required |
| (none) | info |
Default when no marker is present |
Reviewers without a known format classify all comments as info. This means resolve_levels = ["info"] would allow resolving all their threads, while resolve_levels = [] blocks everything.
Per-reviewer overrides
Each adapter defines sensible defaults. To override, set CRB_REVIEWERS as a JSON string:
"CRB_REVIEWERS": "{\"devin\": {\"enabled\": false}, \"greptile\": {\"resolve_levels\": [\"info\", \"warning\"]}}"
Available fields per reviewer:
| Field | Type | Default | Description |
|---|---|---|---|
enabled |
bool | true |
Whether this reviewer's threads appear in results |
auto_resolve_stale |
bool | varies | Whether resolve_stale_comments touches this reviewer's threads |
resolve_levels |
list | varies | Severity levels allowed to be resolved (info, warning, flagged, bug) |
require_reply_before_resolve |
bool | true |
Block resolve unless someone replied explaining the fix |
Adapter defaults (used when no override is set):
| Reviewer | auto_resolve_stale |
resolve_levels |
|---|---|---|
| Unblocked | true |
all |
| Devin | false |
["info"] |
| CodeRabbit | false |
[] (none) |
| Greptile | true |
all |
Resolve enforcement
The resolve_levels config is enforced server-side. If an agent tries to resolve a thread whose severity exceeds the allowed levels, the server returns an error. This prevents agents from resolving critical review comments regardless of their instructions.
For example, with the default config, resolving a 🔴 bug from Devin is blocked — only 📝 info threads can be resolved.
Reviewer behavior
| Reviewer | Auto-reviews on push | Auto-resolves comments | Re-review trigger |
|---|---|---|---|
| Unblocked | No | No | gh pr comment <N> --body "@unblocked please re-review" |
| Devin | Yes | Yes | Auto on push (no action needed) |
| CodeRabbit | Yes | Yes | Auto on push (no action needed) |
| Greptile | No (not on force push) | No | gh pr comment <N> --body "@greptileai review" |
Typical workflow
1. Push a fix
2. list_review_comments(pr_number=42) # See all threads with staleness
3. resolve_stale_comments(pr_number=42) # Batch-resolve changed files
4. reply_to_comment(42, thread_id, "Fixed in ...") # Reply to remaining threads
5. gh pr comment 42 --body "@unblocked please re-review" # Trigger re-review
For stacked PRs, use list_stack_review_comments with all PR numbers to get a full picture before deciding what to fix.
Development
git clone https://github.com/detailobsessed/codereviewbuddy.git
cd codereviewbuddy
uv sync
Testing
poe test # Run tests (excludes slow)
poe test-cov # Run with coverage report
poe test-all # Run all tests including slow
Quality checks
poe lint # ruff check
poe typecheck # ty check
poe check # lint + typecheck
poe prek # run all pre-commit hooks
Architecture
The server is built on FastMCP v3 with a clean separation:
server.py— FastMCP server with tool registration, middleware, and instructionsconfig.py— Per-reviewer configuration (CRB_*env vars via pydantic-settings, severity classifier, resolve policy)tools/— Tool implementations (comments.py,stack.py,descriptions.py,issues.py,rereview.py)reviewers/— Pluggable reviewer adapters with behavior flags (auto-resolve, re-review triggers)gh.py— Thin wrapper around theghCLI for GraphQL and REST callsmodels.py— Pydantic models for typed tool outputs
All blocking gh CLI calls are wrapped with call_sync_fn_in_threadpool to avoid blocking the async event loop.
Template Updates
This project was generated with copier-uv-bleeding. To pull the latest template changes:
copier update --trust .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codereviewbuddy-0.23.1.tar.gz.
File metadata
- Download URL: codereviewbuddy-0.23.1.tar.gz
- Upload date:
- Size: 54.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
693303902f74a5b1430c738196daf4dab159400ec9801e70e9d722ba9adaf302
|
|
| MD5 |
e4942a06e42e2518c39cecf012189607
|
|
| BLAKE2b-256 |
ffde30aea1cb866820ef42f4dba896b17b7c95916c81b290c78778bb0baca92a
|
File details
Details for the file codereviewbuddy-0.23.1-py3-none-any.whl.
File metadata
- Download URL: codereviewbuddy-0.23.1-py3-none-any.whl
- Upload date:
- Size: 64.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ef13c01e8dbdb962e1345b4d1ab01e8a8da86b2acc2f4375dc3215b64e320f4
|
|
| MD5 |
48fff106662b67dfef72d88fe89fc6c2
|
|
| BLAKE2b-256 |
ab02cbbe9c5aa8af30f9babdfbc08c9c1557645d94e148e1b8ba6875458d74f0
|