📝 Walkthrough
ClaudeAdapterV2 now handles supported MCP form elicitation requests with approval prompts. It returns accepted form content after approval and preserves decline and cancellation outcomes. URL-mode and unsupported requests are declined.
Changes: Claude MCP Elicitation Approval
Layer / File(s) Summary Elicitation response eligibility
apps/server/src/provider/CodexMcpElicitation.ts,apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts,apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsThe response helper now accepts a mode and optional schema. Claude acceptance handles supported form content. Unit tests cover accepted and unsupported requests. Approval request and SDK callback
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts,apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsThe adapter creates and emits a pending approval request, waits for the decision, and returns the result to the Claude SDK. Runtime tests cover approval, decline, cancellation, abort, unsupported requests, and late responses. Priority: ➖ Normal
Estimated code review effort: 4 (Complex) | ~40 minutes
Change: Bug fix · Severity of issue fixed: Medium
Sequence Diagram(s)
mermaid1 sequenceDiagram 2 participant ClaudeSDK 3 participant ClaudeAdapterV2 4 participant ApprovalUI 5 participant User 6 ClaudeSDK->>ClaudeAdapterV2: onElicitation(request) 7 ClaudeAdapterV2->>ApprovalUI: emit pending mcp-elicitation approval 8 ApprovalUI->>User: show Cancel, Decline, and Approve choices 9 User->>ApprovalUI: select a choice 10 ApprovalUI-->>ClaudeAdapterV2: return decision 11 ClaudeAdapterV2-->>ClaudeSDK: return elicitation result Suggested reviewers:
juliusmarminge
Merge Risk: 🔵 Low · up to cac64
An unusual form can send a refusal when the user clicks Approve. The previously reported default-backed grant risk is fixed; the remaining issue is narrow but worth correcting.
Security architecture risk: 🔵 Low · up to cac64
The new flow waits for an explicit decision, restricts approval to one-time responses, and declines forms the approval card cannot answer. No unauthorized action was established. Remaining uncertainty concerns cancellation during shutdown and how external servers interpret automatically selected form values.
Retained concerns No architecture-level concerns identified.
Security review details
Security Blast Radius
- inferred — The added exposure is an MCP server obtaining a user-mediated elicitation response during an active Claude turn. The inspected response path remains scoped by thread, runtime request, and live provider-session identity; it does not introduce a demonstrated cross-session authority path.
Trust Boundaries and Controls
- observed — MCP-supplied schemas influence response content through the existing converter, but do not by themselves authorize acceptance. The callback waits for a decision, while runtime response execution checks that the projected request is resolved, has a live capability for the selected provider session, and has an active session.
Resilience and Maintainability Implications
- observed — Cancellation and cleanup are implemented through the SDK callback signal. Session/query shutdown calls query.close without directly settling elicitation deferreds. The session-stop test explicitly makes its fake close abort that signal, so it establishes adapter behavior under abortion, not the exact production SDK shutdown guarantee.
Hardening Proposals
- proposed — Define a documented provider-neutral contract for approval-only enum values, declining ambiguous values rather than interpreting approval substrings. This would strengthen consent semantics without treating an unverified downstream interpretation as a vulnerability.
- proposed — Make session-owned settlement and cleanup explicit across publication, waiting, and shutdown, or document a version-applicable SDK cancellation guarantee. This would make stopped-session approval invalidation independent of an implicit external lifecycle assumption.
Pre-merge checks: Passed 4
Check name Status Explanation Title check Passed The title clearly identifies the main change: displaying Claude MCP elicitations through the approval card. Linked Issues check Passed The PR satisfies #14878.ClaudeAdapterV2registersonElicitationand routes supported approval-only form requests to the existingmcp-elicitationcard. The flow waits for Cancel, Decline, or App…Out of Scope Changes check Passed The changes remain within #14878. TheCodexMcpElicitationhelper change generalizes the existing response builder for Claude's MCP request envelope. The Claude adapter changes implement the requeste…Description check Passed The pull request description covers the required Problem, Change, Scope and approval, and Verification sections. It includes issue and approval links, focused test results, manual verification, limita… Full details: Linked Issues check
Explanation
The PR satisfies
#14878.ClaudeAdapterV2registersonElicitationand routes supported approval-only form requests to the existingmcp-elicitationcard. The flow waits for Cancel, Decline, or Approve. Approve returns a one-time accept. URL mode, missing schemas, and unsupported value requests decline without a card. Tests cover decisions, cancellation, session stop, aborts, and late responses. The supplied PR summary and change summary establish this behavior.
Full details: Out of Scope Changes check
Explanation
The changes remain within
#14878. TheCodexMcpElicitationhelper change generalizes the existing response builder for Claude's MCP request envelope. The Claude adapter changes implement the requested callback and card flow. The added adapter tests cover that behavior. No unrelated product behavior is identified in the supplied change summary.
Full details: Description check
Explanation
The pull request description covers the required Problem, Change, Scope and approval, and Verification sections. It includes issue and approval links, focused test results, manual verification, limitations, screenshots, and the agent model and harness used.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.