feat: structured agent access — 'becwright check --json' + MCP server (phase B)#18
Conversation
Gives AI agents machine-readable results, the universal layer on top of the Claude Code plugin. - 'becwright check --json': JSON summary (rule_count, checked_files, blocked, per-rule results) sharing logic with the new report.py module; exit code unchanged. No extra dependency; works from the standalone binary too. - 'becwright mcp': an MCP (stdio) server exposing 'check' and 'list_checks' to any MCP-capable agent (Claude, Cursor, Windsurf). Lazily imported; ships behind the optional 'mcp' extra so the core stays pyyaml-only. Helpful error if the extra is missing. - git.repo_root() gains an optional cwd so MCP tools can target a given path. - Docs (documentation/mcp.md + es), README sections, and a skill note; tests for report, --json, the MCP tools (importorskip) and the missing-extra path. Coverage 91%; 121 tests pass. Completes the planned agent integration (plugin + structured access).
|
Warning Review limit reached
Next review available in: 32 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (13)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Phase B of the AI-agent integration: gives agents machine-readable access to becwright, on top of the Claude Code plugin (#17). Two additions, no impact on the minimal-deps core.
becwright check --jsonA JSON summary instead of colored text — consumable without parsing. Exit code unchanged (1 if a blocking rule failed). Shares logic with a new
report.pymodule (also used by the MCP server). No extra dependency; works from the standalone npm binary too.{ "rule_count": 3, "checked_files": 1, "blocked": true, "results": [ { "id": "no-debugger-js", "severity": "blocking", "passed": false, "intent": "...", "why_it_matters": "...", "output": "app.js:1\n > ..." } ] }becwright mcp— universal MCP serverA stdio MCP server exposing
checkandlist_checksto any MCP-capable agent (Claude, Cursor, Windsurf). Lazily imported and shipped behind the optionalmcpextra, so the core stayspyyaml-only; a missing extra prints a helpful install hint.Client config:
{ "mcpServers": { "becwright": { "command": "becwright", "args": ["mcp"] } } }Notes
git.repo_root()gains an optionalcwdso MCP tools can target a given path.Test plan
check --jsonverified (blocking + clean repos), valid JSON, correct exit codescheck,list_checks);checkreturns correct payload;list_checksreturns all built-ins (tests useimportorskip("mcp");mcpadded to thedevextra so CI runs them)claude plugin validatestill passes after the skill notebecwright checkpasses