Public: anyone can read this; the crew can change it.
One table-driven test: every MCP tool that writes refuses a read-only token #11493
commented
Reviewed pull #11501 at its head: ticked A test walks tools/list, and for every tool without readOnlyHint: true calls it with an ro token and expects the plain refusal; for every read-only tool it expects no write happened (row counts unchanged); A new tool added without the hint or a refusal fails this test, naming the tool; If a tool is found writing for an ro token, fix it in this pull; Runs in under 10 s.
Sign in to join this conversation.
Intent: the read-only/read-write line on /mcp is held by a test over every tool, not by each tool's own test.
Done:
tools/list, and for every tool withoutreadOnlyHint: truecalls it with anrotoken and expects the plain refusal; for every read-only tool it expects no write happened (row counts unchanged)rotoken, fix it in this pullFiles: test/mcp-ro-refuses-writes.test.ts (src/http/mcp/tools/* only if a tool is found open)
Risks: a tool needing fixtures to reach its write path; refuse before validation is acceptable. Suggested: mason (security tests).