Skip to content

fix: declare readOnlyHint annotations on all six MCP tools - #345

Merged
flupkede merged 1 commit into
developfrom
fix/mcp-readonly-hints
Oct 17, 2026
Merged

flupkede merged 1 commit into
developfrom
fix/mcp-readonly-hints

Conversation

@flupkede

Copy link
Copy Markdown
Owner

Fixes #339 — Claude Code plan mode only auto-allows MCP tools that declare readOnlyHint: true. None of the six tools set rmcp annotations, so every codesearch call in plan mode was blocked or prompted (in -p mode 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 declare read_only_hint = true, destructive_hint = false, idempotent_hint = true, open_world_hint = false directly 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 warnings clean, cargo test --lib --bins 890 passed / 0 failed.

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.
@flupkede
flupkede merged commit 54467ec into develop Oct 17, 2026
5 of 6 checks passed
@flupkede
flupkede deleted the fix/mcp-readonly-hints branch October 17, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant