feat(mcp-v2,docs,api): MCP server instructions and destructive/read-only tool annotations
Merged
SA
4mo ago+144+144+012345678901234567890123456789-7-7-0123456789
Summary
- Add
instructionsto both MCP servers' initialize responses and behavioral annotations to every tool:readOnlyHinton the 12 list/get tools,destructiveHinton the 3 deletes,idempotentHinton updates/pause/resume,destructiveHint: falseon creates/dispatch. - This is the genuinely useful slice of the latest orank rescan: it graded our new docs MCP server and flagged missing instructions/annotations — the same gaps existed invisibly in the product mcp-v2 server, where they matter for real agent safety (an agent can now decline
workspaces_deletewithout user confirmation instead of guessing).
Why / Context
Follow-up to #5910/#5912. The rescan (77/100) surfaced three real MCP-quality items alongside a pile of REST-isms we're deliberately not chasing. Per the MCP spec, an unannotated tool defaults to "assume destructive" — annotating makes the safe majority of our catalog explicitly safe and the dangerous minority explicitly dangerous.
How It Works
defineTool(mcp-v2) gains anannotationspass-through; each of the 27 tool definitions declares its hints inline.createMcpServersetsinstructions(host-scoped ID guidance + destructive-tool warning) in the initialize response.- Docs MCP server gets instructions +
readOnlyHinton both tools. - The live-introspected server card now carries annotations per tool.
- Also:
/.well-known/mcp.jsonmanifest alias (marketing + api), typed response schemas for the 4 discovery operations in openapi.json, and a factual versioning/deprecation paragraph (v1 MCP stays served during migration; changes announced in changelog).
Manual QA Checklist
-
tools/liston mcp-v2 (via server card introspection): all 27 tools annotated, deletes carrydestructiveHint, lists carryreadOnlyHint, none unannotated - Docs MCP
initializereturns instructions; both toolsreadOnlyHint: true -
/.well-known/mcp.jsonserves on the api app (marketing route is an identical re-export) - Invalid tool call / bad args verified to return structured
-32602errors (SDK behavior, unchanged)
Testing
bun run typecheck(mcp-v2, api, docs, marketing)bun run lint(exits 0)
Known Limitations
- The scanner's "MCP error handling" warning wants raw JSON-RPC errors where the MCP SDK intentionally returns
isErrortool results with the code in the message — not ours to patch.
Summary by cubic
Adds MCP server instructions and explicit tool annotations to mcp-v2 and the docs server so agents can safely distinguish read-only, idempotent, and destructive calls. Also surfaces annotations in the server card, adds a /.well-known/mcp.json manifest alias, and types discovery endpoints in openapi.json with versioning notes.
- New Features
mcp-v2:initializenow returnsinstructions(host-scoped ID guidance + destructive-tool warning). All 27 tools annotated:readOnlyHinton list/get,destructiveHinton deletes (anddestructiveHint: falseon creates/dispatch),idempotentHinton updates/pause/resume.- Docs MCP: added
instructions; both tools setreadOnlyHint: true. - Server card now includes per-tool
annotations; new/.well-known/mcp.jsonalias onapiandmarketingfor manifest probes. openapi.json: adds typed response schemas for resource metadata, authorization server metadata, MCP server card, and the OpenAPI document; documents path-based versioning (v2) and deprecation policy (v1 MCP remains available during migration).
Summary by CodeRabbit
-
New Features
- MCP tools now expose clear read-only, destructive, and idempotent operation indicators.
- MCP server guidance now explains supported behavior, tool usage, and safety considerations.
- MCP discovery endpoints are available through standardized metadata routes.
-
Documentation
- API documentation now provides more precise schemas for discovery and server-card responses.
- Versioning and migration guidance has been added to the API documentation.
-
Improvements
- Server cards now include tool annotations for richer client experiences.