Claude Code ignores readOnlyHint for mcp-memory-service: workarounds?
I'm using mcp-memory-service v8.69.0 (graph tools added in v8.72.0) with Claude Code. All MCP tool calls require manual approval, even read-only ones like find_connected_memories, retrieve_memory, and check_database_health, although the server sets readOnlyHint=True on all 24 tools. Is there a way to auto-approve these read-only tools until Claude Code honors the annotation?
Originally asked on GitHub: https://github.com/doobidoo/mcp-memory-service/issues/335
4 answers
Status: This issue is closed on the project side. The mcp-memory-service maintainers stated the server implementation is complete: all 24 tools have been annotated with
readOnlyHint=Truesince v8.69.0 (PR #328). They closed the issue because the remaining auto-approval behavior depends on the Claude Code client, which is outside the project's scope. As of the thread, Claude Code still asks for manual approval on every MCP tool call.Workarounds from the thread:
alwaysAllowin~/.claude.json– Add the server and list the exact tools to auto-approve:
json{ "mcpServers": { "memory": { "alwaysAllow": [ "check_database_health", "retrieve_memory", "recall_memory", "search_by_tag", "store_memory" ] } } }This is the simplest explicit option, but each user must maintain the list per server.
-
PreToolUsehook – The project'sinstall_hooks.pyauto-registers a hook that pattern-matches read-only tool prefixes (get,list,retrieve,check,health, etc.). The installer bug where the hook was not registered was fixed in v8.75.1, so from that version it should register on install. The thread does not include test results, so treat it as a proposed workaround rather than a confirmed one. -
Custom
PermissionRequesthook – The issue author also built a hook at~/.claude/hooks/core/permission-request.jswith an explicit whitelist, documented as a workaround requiring manual installation.
General advice: an
alwaysAllowlist means no prompt before those tools run, so only add read-only tools to it. The tool names above come directly from the thread; your server's tool names may differ.Did this work for you?What a GitHub user tried on GitHub (Outcome unclear)
The issue author created a custom PermissionRequest hook at ~/.claude/hooks/core/permission-request.js that auto-approves read-only tools via an explicit whitelist, documented as a workaround requiring manual installation.
Source: https://github.com/doobidoo/mcp-memory-service/issues/335 (opens external site)
Did this work for you?What @doobidoo tried on GitHub (Outcome unclear)
The maintainer suggested adding an alwaysAllow array to the server's config in ~/.claude.json, listing the exact tools to auto-approve.
Did this work for you?What @doobidoo tried on GitHub (Outcome unclear)
The maintainer described a PreToolUse hook installed via python install_hooks.py that pattern-matches read-only tool prefixes, with a registration bug fixed in v8.75.1, but no test results were posted.
Did this work for you?
Related questions
- mcp-memory-service Docker boot loop: container restarts after exit code 0
- mcp-memory-service v8.19.0: retrieve_memory and search_by_tag broken with 'tags' and 'float' errors
- mcp-memory-service: exact text only scores 60-70%? Use hybrid BM25 + vector search (v10.8.0)
- How do I use project management or custom memory types in mcp-memory-service?
- UNIQUE constraint failed: memories.content_hash after delete_memory() in mcp-memory-service