feat(mcp): read-only MCP server (search_notes, list_notes, get_note)#25
Merged
Conversation
search_notes, list_notes and get_note never mutate the KB, but mark3labs/mcp-go's default tool annotations report readOnlyHint=false / destructiveHint=true. MCP clients use these hints to decide whether to auto-approve a call, so safe lookups were being flagged as destructive. Set ReadOnly + Idempotent true and Destructive + OpenWorld false on each tool, and add a regression test asserting the annotations via ListTools(). Co-Authored-By: Claude Opus 4.8 <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.
What
Adds
inode mcp— runs inode as a read-only Model Context Protocol server over stdio, so MCP-aware clients (Claude Code, Cursor, …) can read the knowledge base mid-task.Three tools:
Safety model
get_note. Opt in withinode config set mcp.reveal_sensitive true.readOnly,idempotent, notdestructive) so clients don't warn users about safe lookups.Testing
internal/mcp).initialize→tools/list→tools/call list_notesagainst a real local DB.search_notesrequires Ollama (query embedding + grounded answer);list_notes/get_noteare pure SQLite.Wiring it up
or inspect interactively with
npx @modelcontextprotocol/inspector inode mcp.Commits
feat(mcp)— server + three tools + testsfix(mcp)— advertise tools as read-only (mark3labs defaults were destructive=true)🤖 Generated with Claude Code