fix(mcp): respect catalog capabilities and aborts - #1228
Conversation
|
Warning Review limit reached
More reviews will be available in 3 minutes and 37 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✨ 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 |
There was a problem hiding this comment.
Code Review
This pull request introduces pagination support for MCP client listings (tools, prompts, and resources) with a safety limit of 1,000 pages, and adds capability checks to prevent calling unsupported endpoints. It also forwards abort signals to tool execution and adds comprehensive test coverage. The review feedback suggests making the capability checks more robust by using loose nullish checks (!= null) and improving the pagination helper to defensively handle null cursors and verify that the returned items are arrays before spreading them.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Fresh-eye reviewer pass: no actionable P0-P3 findings. Reviewed the A1 MCP diff for capability gating, catalog pagination, abort signal propagation, tests, and scope. Residual risk noted: no live third-party MCP server smoke; local MCP tests and typecheck passed. |
|
Fresh-eye re-review after 481cac2: no actionable P0-P3 findings. Rechecked null capability/null cursor handling and the decision to keep malformed non-array catalogs rejected by SDK/zod validation rather than silently ignored. Local re-review verification passed. |
Summary
Teach MCP catalog handling to respect advertised server capabilities, follow paginated tool, prompt, and resource catalogs, and forward tool execution abort signals into
client.callTool.No PawWork issue is linked; this is upstream-value Line A1 for anomalyco/opencode #31271, #31442, and #31455.
Why
Some MCP servers expose only prompts or resources, but PawWork still tried to list tools and install tool-change handlers. Catalog listing also stopped after the first page, and canceled tool executions did not pass the parent abort signal to MCP.
Related Issue
No PawWork issue. Upstream references: anomalyco/opencode#31271, anomalyco/opencode#31442, anomalyco/opencode#31455.
Human Review Status
Pending
Review Focus
Please focus on the MCP capability checks around connect/auth flows, pagination cursor handling, and whether the tolerant
tools/listfallback still strips unsupported output schemas without losing pagination.Risk Notes
Skipped conditional checklist items:
How To Verify
Screenshots or Recordings
Not applicable; no visible UI changed.
Checklist
bug,enhancement,task,documentation. Type labels are author-added; the labeler bot does NOT assign them. Add the label in the GitHub UI, then tick this.app,ui,platform,harness,ci. The labeler bot assigns these on PR open based on changed paths. Confirm the bot's choice (or override if wrong), then tick this.P0,P1,P2,P3. The priority-triage bot suggests one on PR open. Confirm or override, then tick this.Pending,Approved by @<reviewer>, orNot required: <reason>(default isPending; "not required" is restricted to bot-authored low-risk PRs).dev, and my PR title and commit messages use Conventional Commits in English.