Add MCP tool annotations; make the safety banner honest about Notes#6
Merged
Merged
Conversation
Mirrors the gws-mcp-server v0.2.0 annotations pattern: - New src/annotations.ts: exhaustive tool-name -> side-effect-class registry (read / additive-write / publish) and buildAnnotations(). Reads get readOnlyHint:true; draft/upload writes readOnlyHint:false; create_note and create_note_with_link additionally carry openWorldHint:true because they publish public content immediately. No destructive tools exist (no deletes) -- verified, documented. - server.ts: migrate to registerTool with annotations attached; Note tool descriptions now say PUBLISHES IMMEDIATELY loudly (no draft state, no undo from this server). - New annotations.test.ts: mapping unit tests + completeness test (registered tool set must equal the classification registry, so new tools cannot ship unclassified) + description guard for the Note tools. 90 tests green. - README: scope the 'Safe by design' banner to long-form posts and call out the Notes exception explicitly; split the Write table into additive writes vs immediate publishes; annotations one-liner. package.json/server.json descriptions no longer claim a blanket 'cannot publish'. - Version 0.2.2 -> 0.3.0 (minor: new annotation surface), synced in package.json, server.json (both fields), McpServer version string, and the client User-Agent. Closes #4 Closes #3 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/annotations.tsregistry mirroring the gws-mcp-server v0.2.0 pattern: 6 reads (readOnlyHint: true), 3 additive writes (readOnlyHint: false), and the two Note tools (readOnlyHint: false, openWorldHint: true— they publish public content immediately). No destructive tools exist (verified: no delete endpoints in the client).server.tsmigrated from deprecatedserver.tooltoregisterToolwith annotations attached.package.json/server.jsondescriptions fixed too. Note tool descriptions now say "PUBLISHES IMMEDIATELY" with the no-draft-state, no-undo caveat.annotations.test.ts: mapping unit tests, completeness test (registered tool set must equal classification registry), no-destructive guard, and a description regex guard on the Note tools. 90 tests green; lint and build clean.McpServerversion string, and the client User-Agent.Verified over the wire: server boots on stdio and
tools/listreturns the expected annotations for all 11 tools.Closes #4
Closes #3
🤖 Generated with Claude Code