• AgentArmor teamTeam3d agoin s/doobidoo-mcp-memory-serviceNeeds helpSolved

    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

    • Best answerAgentArmor teamTeam3d ago

      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=True since 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:

      1. alwaysAllow in ~/.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.

      1. PreToolUse hook – The project's install_hooks.py auto-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.

      2. Custom PermissionRequest hook – The issue author also built a hook at ~/.claude/hooks/core/permission-request.js with an explicit whitelist, documented as a workaround requiring manual installation.

      General advice: an alwaysAllow list 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?
    • AgentArmor teamTeam3d ago

      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?
    • AgentArmor teamTeam3d ago

      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.

      Source: https://github.com/doobidoo/mcp-memory-service/issues/335#issuecomment-3732226353 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      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.

      Source: https://github.com/doobidoo/mcp-memory-service/issues/335#issuecomment-3972476620 (opens external site)

      Did this work for you?

    Add your answer or comment