io.github.detailobsessed/codereviewbuddy

编码与调试

by detailobsessed

帮助 AI coding agents 在 GitHub PR 中与 AI code reviewers 协作交互的 MCP server。

什么是 io.github.detailobsessed/codereviewbuddy

帮助 AI coding agents 在 GitHub PR 中与 AI code reviewers 协作交互的 MCP server。

README

<!-- mcp-name: io.github.detailobsessed/codereviewbuddy -->

codereviewbuddy

ci release documentation Python 3.14+ FastMCP v3

An MCP server that helps your AI coding agent manage PR review comments from any AI reviewer that uses GitHub's PR review infrastructure.

Features

Review comment management

  • Triage review commentstriage_review_comments filters to only actionable inline threads and includes direct GitHub URLs for each comment
  • Get thread detailsget_thread fetches full conversation history for any thread by node ID
  • Reply to anything — inline review threads (PRRT_), PR-level reviews (PRR_), and bot issue comments (IC_) all routed to the correct GitHub API

CI & stack diagnosis

  • Diagnose CI failuresdiagnose_ci collapses 3-5 sequential gh commands into one call: finds the failed run, identifies failed jobs/steps, and extracts actionable error lines
  • Stack activity feedstack_activity shows a chronological timeline of pushes, reviews, labels, merges across all PRs in a stack with a settled flag for deciding when to proceed
  • Scan merged PRslist_recent_unresolved catches late review comments on already-merged PRs

Agent experience

  • Recovery-guided errors — every tool handler classifies errors (auth, rate limit, not found, workspace, GraphQL, config) and returns actionable recovery hints so agents self-correct instead of retrying blindly
  • Next-action hints — tool responses include next_steps suggestions guiding agents to the right follow-up tool call
  • Empty result messages — when results are empty, responses explain why and suggest what to try next
  • GUI URLs — triage items include comment_url so agents can link users directly to the comment on GitHub
  • Tool classification tags — tools are tagged query, command, or discovery for MCP clients that support filtering

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)
  • Zero config auth — uses gh CLI, no PAT tokens or .env files

CLI testing (free with FastMCP v3)

FastMCP v3 gives you terminal testing of the server with no extra code:

bash
# List all tools with their signatures
fastmcp list codereviewbuddy.server:mcp

# Call a tool directly from the terminal
fastmcp call codereviewbuddy.server:mcp triage_review_comments pr_numbers='[42]'

# Inspect server metadata
fastmcp inspect codereviewbuddy.server:mcp

# Run with MCP Inspector for interactive debugging
fastmcp dev codereviewbuddy.server:mcp

Prerequisites

Installation

This project uses uv. No install needed — run directly:

bash
uvx codereviewbuddy

Or install permanently:

bash
uv tool install codereviewbuddy

MCP Client Configuration

Quick setup (recommended)

One command configures your MCP client — no manual JSON editing:

bash
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:

bash
uvx codereviewbuddy install windsurf \
  --env CRB_SELF_IMPROVEMENT__ENABLED=true

For any other client, generate the JSON config:

bash
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:

jsonc
{
  "mcpServers": {
    "codereviewbuddy": {
      "command": "uvx",
      "args": ["codereviewbuddy@latest"],
      "env": {
        // All CRB_* env vars are optional — zero-config works out of the box.
        // See Configuration section below for the full list.
      }
    }
  }
}

All options enabled:

jsonc
{
  "mcpServers": {
    "codereviewbuddy": {
      "command": "uvx",
      "args": ["codereviewbuddy@latest"],
      "env": {
        // GitHub logins considered "ours" for triage filtering (comma-separated)
        "CRB_OWNER_LOGINS": "alice,bob",
        // Enable PR description quality checks
        "CRB_PR_DESCRIPTIONS__ENABLED": "true",
        // Agents suggest Linear issues when they hit server gaps
        "CRB_SELF_IMPROVEMENT__ENABLED": "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 @latest? Without it, uvx caches 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.

jsonc
{
  "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"
      }
    }
  }
}

Troubleshooting

If your MCP client reports No module named 'fastmcp.server.tasks.routing', the runtime has an incompatible FastMCP. Fixes:

  1. Prefer uvx codereviewbuddy@latest in MCP client config.
  2. For local source checkouts, launch with uv run --directory /path/to/codereviewbuddy codereviewbuddy.
  3. Reinstall to refresh cached deps: uv tool install --reinstall codereviewbuddy.

MCP Tools

ToolTagsDescription
summarize_review_statusquery, discoveryLightweight stack-wide overview — start here
triage_review_commentsqueryOnly actionable inline threads needing attention
get_threadqueryFull thread details by node ID — use after triage for conversation history
reply_to_commentcommandReply to inline threads (PRRT_), PR-level reviews (PRR_), or bot comments (IC_)
diagnose_ciqueryDiagnose CI failures — finds the failed run, jobs, steps, and error lines in one call
check_ci_statusqueryLightweight CI pass/fail/pending check for a PR — use before merging
stack_activityqueryChronological activity feed across a PR stack with a settled flag
list_recent_unresolvedqueryScan recently merged PRs for unresolved review threads
review_pr_descriptionsqueryAnalyze PR descriptions for quality issues (empty body, boilerplate, missing linked issues)
show_configdiscoveryShow active configuration with human-readable explanation

MCP Resources

ResourceDescription
pr://{owner}/{repo}/{pr_number}/reviewsRead-only review summary for a single PR

MCP Prompts

PromptDescription
review_stackFull review pass workflow — summarize, triage, fix, reply, verify
pr_review_checklistPre-merge quality checklist (review threads, PR hygiene, CI, tests)
ship_stackPre-merge sanity check workflow before merging a PR stack

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 varTypeDefaultDescription
CRB_PR_DESCRIPTIONS__ENABLEDbooltrueWhether review_pr_descriptions tool is available
CRB_SELF_IMPROVEMENT__ENABLEDboolfalseAgents suggest Linear issues when they encounter server gaps
CRB_OWNER_LOGINScomma-separated[]GitHub usernames considered "ours" for triage filtering (e.g. alice,bob)

Typical workflow

code
1. summarize_review_status()                     # Stack-wide overview — start here
2. triage_review_comments(pr_numbers=[42, 43])   # Only actionable threads needing attention
3. # Fix bugs flagged by triage, then:
4. reply_to_comment(42, thread_id, "Fixed in ...")  # Reply explaining the fix
5. diagnose_ci(pr_number=42)                     # If CI fails, diagnose in one call

Each tool response includes next_steps hints guiding the agent to the right follow-up call. For stacked PRs, all query tools auto-discover the stack when pr_numbers is omitted.

Development

bash
git clone https://github.com/detailobsessed/codereviewbuddy.git
cd codereviewbuddy
uv sync

Testing

bash
poe test          # Run tests (excludes slow)
poe test-cov      # Run with coverage report
poe test-all      # Run all tests including slow

Quality checks

bash
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, instructions, and recovery-guided error handling
  • config.py — Configuration (CRB_* env vars via pydantic-settings)
  • tools/ — Tool implementations (comments.py, stack.py, ci.py, descriptions.py)
  • gh.py — Thin wrapper around the gh CLI for GraphQL and REST calls
  • models.py — Pydantic models for typed tool outputs with next_steps and message fields for agent guidance

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:

bash
copier update --trust .

常见问题

io.github.detailobsessed/codereviewbuddy 是什么?

帮助 AI coding agents 在 GitHub PR 中与 AI code reviewers 协作交互的 MCP server。

相关 Skills

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描123.0k

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描123.0k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描123.0k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
84.2k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
53.3k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
46.4k

评论