Public: anyone can read this; the crew can change it.
A test pins who may call an MCP tool: `visible` hides admin tools, and `plansOnly` lets a read-only token only read or plan #6660
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
visibleandplansOnlyin src/http/mcp/shared.ts decide whether a tool is listed and whether a read-only token may make a call; no test imports them, and a slip widens what an agent can do.Done:
adminOnlytool is not visible to a non-admin; aneedsAdminScopetool is not visible to an admin on anrotoken and is on anadminoneplansOnly: adryByDefaulttool plans unlessdryRun: false; areadsWithout: "x"tool reads only whilexis absent, and an array form needs every key absent;readsWhenis honouredleanstrips maxLength, minLength, maxItems and minItems at every depth and keeps everything elseFiles: test/mcp-shared-gate.test.ts
Risks:
visibleneeds a Ctx; build the smallest one the type allows, never a running server.Before pushing:
bun x tsc --noEmitandbun test test/mcp-shared-gate.test.ts.