Repository navigation
fix(nodes): keep MCP calls within the published catalog - #124652
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 11:07 AM ET / 15:07 UTC. ClawSweeper reviewWhat this changesThis PR makes the bounded node-host MCP tool catalog both the published inventory and the sole callable tool set, and removes entries when their MCP server closes. Merge readinessKeep open for normal maintainer landing: current main still has the proven split between published descriptors and callable MCP tools, while this PR is the linked repair. No concrete patch defect was found; exact PR blobs could not be materialized locally because the partial checkout’s remote was offline. Priority: P1 Review scores
Verification
How this fits togetherA node host discovers tools from configured MCP servers and publishes a bounded inventory to the Gateway for agent use. Later node invocations return to the MCP manager, so the published inventory and invocation authorization must remain aligned. flowchart LR
A[Configured MCP servers] --> B[Node host discovery]
B --> C[Bounded published catalog]
C --> D[Gateway tool inventory]
D --> E[Agent or raw node invocation]
E --> F[Node-host call authorization]
B --> G[Server close event]
G --> C
Before merge
Agent review detailsSecurityNone. PR surfaceSource -8, Tests +11, Other 0. Total +3 across 9 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Make the mutable published descriptor catalog the MCP manager’s one authority set, withdraw a closed server through the existing inventory callback, and retain focused manager/runtime plus process-boundary proof. Do we have a high-confidence way to reproduce the issue? Yes. Current main separately stores discovered tools for invocation and bounds published descriptors, so the supplied 130-tool path is source-reproducible. Is this the best way to solve the issue? Yes. The MCP manager is the invocation owner and the runtime already owns inventory republishing; the approach removes the divergent authority set rather than adding a downstream guard. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b90d7efddbc0. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready proof for exact head
ClawSweeper rank-up move applied: exact-head diff/checks were refreshed before merge. Its compatibility/security-boundary note is intentional: tools omitted from the bounded published catalog now fail closed with Known proof detail: the Testbox profile did not hydrate an OpenAI credential, so the authenticated provider turn ran against an isolated local Gateway with the key loaded from 1Password; the source build, Linux process boundary, and exact-head CI remained independently proven on Testbox/GitHub. |
|
Merged via squash.
|
Closes #124580
What Problem This Solves
Fixes an issue where node-hosted MCP could execute tools omitted from its bounded published catalog, and where a tool remained advertised after its backing MCP server disconnected.
Why This Change Was Made
The bounded node MCP descriptor list is now the sole call-authority set. When a connected MCP server closes, the node removes that server's descriptors in place and republishes the surviving MCP and plugin inventory. The same change removes obsolete
configuredServerCountbookkeeping and shrinks the assertion-safety baseline after the production cleanup.The fix stays inside the node-host MCP owner: no protocol, config, storage, migration, or compatibility surface changes.
AI-assisted: yes. The architecture, live evidence, implementation, simplification, and final diff were reviewed directly; no agent transcript is attached.
User Impact
Operators can trust the Gateway's node tool inventory as the actual callable MCP surface. Tools dropped by count or byte limits cannot be reached through raw
mcp.tools.call.v1, and dead MCP servers disappear from new agent turns while healthy sibling servers and ordinary node plugin tools remain available.Evidence
MCP_TOOL_UNAVAILABLE.openai/gpt-5.6-luna: the model used thenodestool to invoke a node-local MCP server, received an unprompted MCP-only nonce, and returned it exactly.flaky_*tools from bothnode.listandtools.effectivewhile the node stayed connected.tbx_01m05az9achqcch9hcws2r676y(run 31948957813):check:changedpassed, including production/test typecheck, core lint, architecture guards, import cycles, formatting, and assertion ratchets.pnpm buildpassed.Production LOC: +62/-70 (net -8) | Tests: +96/-85 (net +11) | Ratchet metadata: +2/-2.
Provenance: the split discovered-tool/published-descriptor authority entered with #90431 on 2026-07-11; this repair makes the bounded descriptor catalog canonical for both visibility and invocation.