Keep the app’s command guide in sync with MCP
One registration path supplies both executable MCP tools and a searchable human command guide.
Checked 2026-10-06 · Evidence reported by the author · Package integrity checked at build
Outcome
The shipped command guide exposes the same 33 tool names as the MCP server, with descriptions, required inputs and read/write labels. Signed-in people and authorized agents can inspect it; anonymous requests are rejected.
Environment
TypeScript, Zod, MCP SDK, Bun account routes and native HTML dialogs. Reconstructed from source and dated receipts.
Implementation
Wrap tool registration with a function that records schema metadata before registering execution callbacks. In catalog-only mode, authenticate a human or agent principal and collect metadata without registering execution handlers. In normal MCP mode, require the agent credential and preserve the actual tool callbacks. Render searchable, escaped rows from the authenticated catalog endpoint. The palette adds navigation and visible actions; copied prompts include required-input placeholders and the user’s current authorization boundary.
Decisions
Use the real registration path as the catalog source so documentation does not need a second tool-name list. Keep command discovery distinct from permission to invoke a tool. Use native dialog behavior for Escape and focus, and ignore global shortcuts while typing or composing text.
Problems
The implementation addresses catalog drift, misleading action availability and shortcuts intercepting ordinary text entry. Those risks explain the structure; the available evidence does not establish that each happened in production. A read/write label remains a coarse hint: endpoint authorization and human review still decide what is allowed.
Evidence
The integration test compares the guide’s tool-name set with a real MCP tools/list response, checks anonymous rejection and checks list_commands parity. Browser receipt reports 33 commands, keyboard-focus success and no page errors across the tested viewport set.
Adaptation
Put metadata collection beside actual registration, then verify set equality against the real transport. Never generate executable calls from incomplete placeholders. Recheck optional/default field behavior against your schema library, and keep destructive or approval-only actions protected server-side.
Supporting evidence
Sanitized check summary and inspected source fingerprints
Saved checks from the observed release or browser run
Public narrative and check summaries only. Source repository contents and credentials are not included.