Repository navigation
fix: declare readOnlyHint annotations on all six MCP tools - #345
Merged
Merged
Conversation
Claude Code plan mode only auto-allows MCP tools that declare readOnlyHint: true — without annotations every codesearch call was blocked or prompted (issue #339). All six tools are read-only index queries; they now declare read_only_hint = true, destructive_hint = false, idempotent_hint = true, open_world_hint = false. The 6-tool registration test pins the hint so a future tool cannot ship without it.
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.
Fixes #339 — Claude Code plan mode only auto-allows MCP tools that declare
readOnlyHint: true. None of the six tools set rmcpannotations, so every codesearch call in plan mode was blocked or prompted (in-pmode it failed outright), in the main session and in subagents alike.All six tools (
search,find,explore,get_chunk,status,find_impact) are read-only index queries; they now declareread_only_hint = true, destructive_hint = false, idempotent_hint = true, open_world_hint = falsedirectly in the#[tool(...)]attributes (rmcp 3.5.0 macro syntax, verified against the vendored macros source).The existing 6-tool registration test now also pins the hint on every tool, so a future tool cannot ship without it. Validation: fmt clean, clippy
--all-targets -D warningsclean,cargo test --lib --bins890 passed / 0 failed.