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
CONTRIBUTING tool template uses deprecated server.tool() and fails the registration test #149
Every tool uses server.registerTool(name, { description, inputSchema, annotations }, handler) with READ_ONLY, changesState() or destructive(). registration.test.ts requires annotations and fails any file containing server.tool(. The checklist also omits the README / CLAUDE.md / mcp-server/README / mcp-tools.json updates and counts that registration.test.ts:84-109 checks, the confirmParam/confirmCancelled helpers for state-changing tools, and HOMELAB_TEST_PI=true for the E2E suite.
Impact
A contributor following the documented pattern gets a PR that fails CI.
Steps to reproduce
Copy the CONTRIBUTING snippet into src/tools/foo.ts and register it in index.ts
npm test: the annotations and deprecated server.tool() tests fail
Suggested fix
Replace the snippet with the registerTool + annotations pattern, including the confirm-gated variant. Add the doc and count update steps and the E2E env var.
Acceptance criteria
Template compiles and passes registration tests when copied
Checklist lists every file the doc-sync test checks
How to run tests: cd mcp-server && npm install && npm test (and npm run typecheck); structure tests: pip install -r requirements-test.txt && pytest tests/ -v
Conventions: see CLAUDE.md and CONTRIBUTING.md
Filed by repo-audit/full-audit at 636fefb. Severity: medium. Effort: S. audit-key: documentation|CONTRIBUTING.md|add-mcp-tool-template
Fixed in b1cdb50: CONTRIBUTING now shows registerTool + READ_ONLY, a confirm-gated variant (confirmParam/confirmCancelled/destructive), and a checklist covering index.ts, tests (input-validation, handlers, confirm-gates, gated lists), every doc/count file registration.test.ts checks, CHANGELOG Unreleased, and HOMELAB_TEST_PI. Verified by copying both snippets into src/tools: they type-check and the read-only template passes the annotation and no-server.tool() tests.
Activity
TMHSDigital commentedon Nov 19, 2026
Fixed in b1cdb50: CONTRIBUTING now shows registerTool + READ_ONLY, a confirm-gated variant (confirmParam/confirmCancelled/destructive), and a checklist covering index.ts, tests (input-validation, handlers, confirm-gates, gated lists), every doc/count file registration.test.ts checks, CHANGELOG Unreleased, and HOMELAB_TEST_PI. Verified by copying both snippets into src/tools: they type-check and the read-only template passes the annotation and no-server.tool() tests.