Repository navigation
feat(mcp)!: advertise only agent inputs in MCP tool schemas - #4468
Conversation
The tool list cost about 268 KB, and clients that defer or compact large tool schemas then call tools without their arguments. Tenant, run, lease, and Android device-allowlist scope become operator-owned: MCP refuses them with the operator path, and their env and config defaults still apply. Repeated property descriptions shrink, every input schema fits under 5 KB, and the server instructions tell agents to load a deferred schema first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Derives both checks from listCommandTools() and the declared audiences, so a new oversized schema or an advertised operator-owned key fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 12 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Restores the facts the shortened descriptions dropped: the result-size effect of the MCP output controls, the waitMs range, the snapshot-bridge settle default and its non-empty-screen floor, and what physical: false selects. The config-loader audience moves beside the other MCP audiences so the schema gate reads the same declarations as admission. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apex SentinelVerdict: No findings. 1 finding below Reviewed with this repository's own Sentinel configuration ( Feedback goes in the review comment threads, as a reply under the inline comment of a finding: Reply Useful? Reply Comment |
|
This PR is ready at 5d4ac57. I found no problems in the code, and all 22 checks pass. There are no conflicts. The only step left before merge is for a maintainer to accept the MCP and AI SDK break. All 9 earlier review threads are resolved, and the head diff addresses each one. Not blocking, and you can take or leave these: the "no MCP tool advertises an operator-owned input" test in |
Summary
tools/listcost ~268 KB. Clients that defer tool schemas then call tools without them, and clients that compact schemas above ~5 KB drop their structure. This cuts the advertised input schemas at their owners (common input fields, MCP control fields, flaginputDescriptions); no per-tool schemas.tenant,runId,leaseId,androidDeviceAllowlistbecome operator-owned. Explicit input is refused with the operator path. Env/config defaults still reach the route (test added).settleQuietMs,openwaitMs/metroPort).listCommandTools().tools/list(62 tools)open)open)12 files. The proxy lease device spec stays advertised (#3864 decided it is agent-visible); only its descriptions shrank.
Validation
validation: CI. At 5d4ac57: focused
vitest --project unit-coreonsrc/mcp,src/ai-sdk,packages/command-surface,packages/command-registry,packages/contractspassed (192 files, 1408 tests);pnpm typecheckandoxlintclean. Bytes measured from the built server over stdio.🤖 Generated with Claude Code