You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Migrate tools from deprecated server.tool() to registerTool with annotations #122
All 51 tools register with server.tool(name, description, schema, handler), the deprecated overload in @modelcontextprotocol/sdk 1.x, while the newer prompts.ts and resources.ts use registerPrompt / registerResource. Because of this no tool declares MCP tool annotations, even though the code already knows which tools are read-only and which 11 are destructive.
Where
every file in mcp-server/src/tools/*.ts (for example piReboot.ts:12)
Clients cannot tell read-only tools from destructive ones, so they cannot auto-approve safe calls or warn before destructive ones.
Two registration styles in one codebase; a future SDK major that drops the overload breaks all tools at once.
Suggested fix
Migrate each tool to server.registerTool(name, { title, description, inputSchema, annotations }, handler) (mechanical, one commit per group of tools).
Set annotations.readOnlyHint: true on read-only tools and destructiveHint: true on the confirm-gated ones (idempotentHint where it applies).
Update the test harness that captures handlers (confirm-gates.test.ts, input-validation.test.ts, registration.test.ts) and assert the annotation per tool.
Acceptance criteria
No server.tool( calls remain.
Every tool has annotations, enforced by registration.test.ts.
Fixed in 140c514 (released in 0.22.1). Every tool now registers with server.registerTool(name, { description, inputSchema, annotations }, handler); annotations come from utils/annotations.ts (39 read-only, 12 destructive confirm-gated, 2 state-changing: composePull and ntfySend).
Verified: registration.test.ts asserts each tool's annotations and that no server.tool( call remains; the built server lists all 53 tools over stdio with the expected annotations. CI passed on ubuntu (Node 22, 24) and Windows.
Activity
TMHSDigital commentedon Nov 18, 2026
Fixed in 140c514 (released in 0.22.1). Every tool now registers with
server.registerTool(name, { description, inputSchema, annotations }, handler); annotations come fromutils/annotations.ts(39 read-only, 12 destructive confirm-gated, 2 state-changing: composePull and ntfySend).Verified:
registration.test.tsasserts each tool's annotations and that noserver.tool(call remains; the built server lists all 53 tools over stdio with the expected annotations. CI passed on ubuntu (Node 22, 24) and Windows.