Repository navigation
feat(mcp): align remote settings and runtime filtering - #242
gitfromwildan wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Important
The annotation filter can reject valid read-only MCP tools, so this needs correction before merging.
Reviewed changes The review covers the MCP settings migration, timeout persistence, dynamic discovery/filtering, session lifecycle coordination, and the corresponding web and desktop settings paths.
- Settings and migration — accepts legacy
identries while persisting unique names, bounded timeout overrides, and backend-held credentials. - Dynamic tool filtering — discovers remote schemas and retains compatibility allow-lists while filtering newly configured tools by MCP annotations.
- Session/runtime behavior — adds per-remote coordination, unique JSON-RPC request IDs, concurrent discovery, and retired-session cleanup.
gpt-6-luna | 𝕏
| .any(|allowed| allowed == &qualified); | ||
| } | ||
| tool.annotations.as_ref().is_some_and(|annotations| { | ||
| annotations.read_only_hint && annotations.destructive_hint == Some(false) |
There was a problem hiding this comment.
This rejects valid read-only tools unless the server also sends destructiveHint: false. Under the MCP ToolAnnotations contract, readOnlyHint: true already declares that the tool does not modify its environment, while destructiveHint is only meaningful for non-read-only tools and may be omitted. As a result, servers that correctly return only { "readOnlyHint": true } have their tools marked unusable and disappear from the usable context-tool flow; accept the read-only hint without requiring destructiveHint: Some(false) (and keep destructive tools excluded).
Technical details
# Read-only annotation filter rejects valid MCP tools
## Affected sites
- `core/rust-ai/context.rs:229-231` — requires `destructiveHint == false` even when `readOnlyHint` is true.
## Required outcome
- A tool with `annotations.readOnlyHint: true` must pass the read-only filter whether `destructiveHint` is omitted or present, while tools without the read-only hint remain unavailable.
## Suggested approach
- Treat `readOnlyHint` as the controlling condition and do not require `destructiveHint` for a read-only tool.
## Open questions for the human
- None; this follows the MCP ToolAnnotations contract.
Source: https://modelcontextprotocol.io/specification/2025-06-18/server/tools|
Pushed commit Verified: Task list (6/6 completed)
|
Signed-off-by: pullfrog[bot] <226033991+pullfrog[bot]@users.noreply.github.com>

Summary
Follow-up to the merged MCP settings implementation in #241, aligned with the remote-server and client-owned lifecycle requirements.
idconfig entries and keeping existing credential keys usable.readOnlyHint: trueplusdestructiveHint: false. Existing backend allow-lists are retained for compatibility; Settings does not expose or manage tool lists.MCP annotations are server-provided hints, not a security guarantee; configure only trusted remote endpoints.
Validation
npm test: 790 passedcargo test: core 156, server 51, desktop 23 passednpm run buildpassed-D warningsgit diff --checkpassedLocal E2E could not run: the available macOS 12 host is unsupported by the installed Playwright version. CI should run the browser E2E checks.