Repository navigation
Conversation
…on checks An unrelated Claude MCP deny rule, such as mcp__buildkite__create_build, stripped the read-only hint from every MCP App tool, so read-only background calls asked for approval and were then refused by the adapter's broad deny guard. When Claude advertises mcp_call_check_permissions_v1 and the thread runs in Full Access with readable rules and no ask rule that may cover MCP tools, keep read-only hints and send mcp_call with check_permissions, so Claude's own evaluator applies exact, wildcard and alias rules to the actual tool. Older CLIs, unreadable rules, ask rules, other permission modes and tools without a read-only annotation keep the conservative path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…aude-mcp-permission-checks-v2
T3's broad ask matcher treated any mcp__ ask rule as covering every MCP App tool, so an unrelated ask rule still withheld read-only hints and sent calls back through the broad deny guard. With check_permissions, Claude evaluates ask rules itself and routes a matching ask to canUseTool, which prompts during a turn and refuses when idle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…calls" This reverts commit dace83f. With native checks, an ask rule that really covers a read-only app tool reaches canUseTool, which refuses it when no turn is active. Cards load between turns, so the frame lost its confirmation and the call failed, where main asks and then runs it. Any MCP ask rule again keeps the frame's confirmation and the unchecked call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
In a Full Access Claude thread, one unrelated MCP deny rule (for example
mcp__buildkite__create_build) makes T3 drop the read-only hint from every MCP App tool on every server. A read-only background helper such as Datadog's_dd_gffthen opens "Allow … to run …?". Confirming does not help: the adapter's broad deny guard refuses the call with "A Claude deny rule may cover …, so it was not called."The guard is broad on purpose. Claude also matches rules against server aliases T3 can't list (#31131), and
mcp_callused to skip Claude's own permission check.Change
Claude Code advertises
mcp_call_check_permissions_v1, which letsmcp_callrun Claude's own permission evaluator on the real tool. That evaluator also handles aliases and wildcards. Use it inClaudeAdapterV2when all of these hold:bypassPermissions)askrule could cover MCP toolsOn that path,
listToolskeepsreadOnlyHintandcallToolsendsmcp_callwithcheck_permissions: true. If a deny rule really covers the tool, Claude refuses the call itself.Everything else keeps today's conservative behavior: older CLIs, unreadable rules, ask rules, other permission modes, and tools without a read-only annotation. The checked path stays limited to Full Access with no possible ask rule because an idle card can't answer a CLI approval request. The server-prefix overlap and normalized tool-name collision guards are unchanged. Clients and wire schemas are unchanged.
This is the same change as #32230, ported onto current
mainand re-verified, and it supersedes that PR. #32230 was closed only to stay within the open-PR limit and had no outstanding review findings. It conflicted after about 2,950 commits onmain.Scope
Bug fix for #32185 (open). It is limited to the Claude adapter (
ClaudeAdapterV2.tsand its test).Refs #32185. This fixes the reported case: an unrelated deny rule in Full Access. Two cases from the issue comments still prompt, because they keep the conservative path:
askrule that may cover MCP tools, including an unrelated one such asmcp__atlassian__createJiraIssueHandling those would need a way to route Claude's "ask" result to an idle card, which is a design decision for maintainers. #38962 (open) separately stops dialogs for calls an app makes without a click.
Verification
Windows 11, Node 26, Claude Code CLI 2.1.328 (installed), base
origin/mainf9b19a7, head 2d8a3be.End to end, real server and real Claude CLI. Script:
run.ts <label> <case>. Each run did the following:t3 serveon a fresh isolated T3 home, with an isolatedCLAUDE_CONFIG_DIRt3 project addt3 thread start --provider claudeAgent --waitThe project's
.mcp.jsonregisters a stdio MCP fixture shaped like Datadog's graph app:show_graphrenders an MCP Appget_graph_datais an app-only helper annotated read-only, and it logs each executionA loopback Anthropic Messages fixture stood in for the model. It only emitted the
show_graphtool_use and then some text. Claude Code made every permission decision itself. After the turn, the persisted MCP App item was read from the run's own database. The script then calledmcpApps.toolInfoandmcpApps.callToolforget_graph_dataover the server's authenticated WebSocket RPC, which is the pathMcpAppFrameuses. No paid model turn or live user data was used.Before (origin/main):
After (this branch):
With an unrelated deny rule, the read-only helper now runs without a prompt. A deny rule that names the tool, exactly or by wildcard, is still enforced, now by Claude's own evaluator. The helper never runs. The unrelated-ask case is unchanged, as described under Scope.
Focused tests. From
apps/server, the existing permission-rules table inClaudeAdapterV2.test.tsgains five rows:__Results:
vp test run src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts -t "permission rules to MCP app" --maxWorkers 1on unmodifiedmainsource: 1 failed, 26 passed. The failure wasexpected { destructiveHint: false } to deeply equal { readOnlyHint: true, …(1) }(unrelated-deny row).vp test run src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts src/provider/AgentContextBudget.test.ts --maxWorkers 1on this branch: 479 passed, 1 skipped. One test failed, and it is unrelated:native fork > forks a session from its original directory…expectsC:\workspaceand gets/workspace, a Windows path difference in code this PR does not touch. It fails the same way on unmodifiedmainon this machine (1 failed, 472 passed).vp run typecheck: passed.vp staged(fmt, lint, knip): passed.apps/server/src/provider/agentContextBudget.jsonis unchanged.Not checked:
McpAppFrameacts on.Written by Claude Opus 5.5 in Claude Code via T3 Code.
🤖 Generated with Claude Code