Skip to content

MCP shim: --tools all returns only 7 tools due to IMPLEMENTED_TOOLS hardcode #234

Closed

Description

@cl0ckt0wer

Summary

agentmemory mcp --tools all (and AGENTMEMORY_TOOLS=all env var) silently returns only 7 tools instead of 51. The issue is in src/mcp/standalone.ts — even though getVisibleTools() correctly returns all 51 when mode is "all", the result is filtered through a hardcoded IMPLEMENTED_TOOLS set of 7 tool names.

Root cause

src/mcp/standalone.ts:

const IMPLEMENTED_TOOLS = new Set([
  "memory_save", "memory_recall", "memory_smart_search",
  "memory_sessions", "memory_export", "memory_audit",
  "memory_governance_delete",
]);

tools/list returns: getVisibleTools().filter((t) => IMPLEMENTED_TOOLS.has(t.name))

Even with --tools all, getVisibleTools() returns all 51, then the filter reduces it to 7.

Impact

Every non-Claude-Code user (OpenCode, Cursor, Gemini CLI, Cline, etc.) is affected. Users get 7 tools and have no path to the remaining 44 (actions, graphs, signals, sentinels, slots, lessons, etc.) without writing a custom HTTP→stdio bridge.

Proposed fix

When in proxy mode (detected server via AGENTMEMORY_URL), delegate tools/list to the server: GET <base>/agentmemory/mcp/tools and return its response directly, bypassing the local filter. The server already has all 51 tools registered.

Environment

  • agentmemory: v0.9.4 (Docker, iii-engine 0.11.6)
  • Client: OpenCode (stdio MCP)
  • Workaround: custom 22-line Node.js bridge proxying stdio → HTTP on Docker worker

Activity

  1. rohitg00 commented on May 8, 2026

    @rohitg00
    Owner

    Thanks @cl0ckt0wer — root cause is exactly right. Confirmed:

    • src/mcp/standalone.ts hardcodes a 7-name IMPLEMENTED_TOOLS set
    • tools/list filters getVisibleTools() through that set even when AGENTMEMORY_TOOLS=all is configured
    • Result: every non-Claude-Code MCP client gets 7 tools regardless of the config flag

    Fix is in #238 — switches tools/list and validate() to proxy-aware behavior: when running against a reachable server (AGENTMEMORY_URL set + livez ok), delegate to the server's tool list (gets all 51), with a fallback to the local 7-tool list when the server is unreachable. Has tests covering the proxy path including auth-header passthrough.

    I've already approved #238 — holding for @rohitg00 to land. Once it does, will close this with the merge.

    Good catch on the impact framing too — every non-Claude-Code user (OpenCode, Cursor, Gemini CLI, Cline) was hitting this silently.

  2. added a commit that references this issue on May 10, 2026
    13924d2
  3. jcalfee commented on May 10, 2026

    @jcalfee

    ◇ iii-engine is ready
    [agentmemory] Starting worker v0.9.6...

    Image
  4. rohitg00 commented on May 10, 2026

    @rohitg00
    Owner

    @jcalfee what should I see here?

  5. jcalfee commented on May 10, 2026

    @jcalfee

    It appear that version 0.9.6 didn't work because I'm seeing only 4 tools. If I'm reading the github comments right then it would have been fixed in version 0.9.6.

    I'm running VS Codeium in Flatpak with the MCP server in RooCode.

    "agentmemory": {
                "command": "npx",
                "args": ["-y", "@agentmemory/mcp"],
                "env": {
                    "AGENTMEMORY_URL": "http://localhost:3111"
                }
            }
    

    It seems that the RooCode MCP startup is able to escape the flat pack though because the place where I find it running the AgentMemory MCP server is on the host. So that seems to go well.

    So I check on the host and see this version:

    $ npm exec @agentmemory/mcp --version
    10.9.7

    And I get these four tools whether or not I have the regular process running on the host, which was very confusing until I figured out or remembered that you've got a Docker container. So that makes sense that it's coming from the Docker container:

    $ npx @agentmemory/agentmemory
    ┌  agentmemory
    │
    ◆  iii-engine is running
    [agentmemory] Starting worker v0.9.6...
    ...

    I'm not sure how to check the version inside of the Docker container which is actually pod man on my machine because I can't find bash or sh inside but I assumed that this should be up to date and the bug would be fixed right?

    agentmemory-iii-engine-1

  6. rohitg00 commented on May 10, 2026

    @rohitg00
    Owner

    @jcalfee thanks for the detail — the 4-tool count is the smoking gun. Two things going on:

    1. Version check is misleading
    npm exec @agentmemory/mcp --version reports 10.9.7 because --version is consumed by npm itself (your npm CLI version), not the package. To check the package version:

    npx -y @agentmemory/mcp@latest 2>&1 | head -3
    # or
    npm view @agentmemory/mcp version

    Both should show 0.9.6.

    2. The 4 tools come from the container, not the shim
    The shim flow is:

    • probe http://localhost:3111/agentmemory/livez (500ms)
    • if up → GET /agentmemory/mcp/tools from the server → return whatever the server lists (8 essentials by default, 51 when AGENTMEMORY_TOOLS=all)
    • if down → fall back to local 7-tool IMPLEMENTED_TOOLS

    4 ≠ 8 and ≠ 7, so your container is older than v0.9.6 and its /agentmemory/mcp/tools predates the current ESSENTIAL_TOOLS set.

    Fix — rebuild the container (swap docker → podman if that's your runtime)

    docker compose down
    docker rmi agentmemory-iii-engine ghcr.io/rohitg00/agentmemory:latest 2>/dev/null
    docker compose pull
    docker compose up -d
    
    # verify the server tool count
    curl -s http://localhost:3111/agentmemory/mcp/tools | jq '.tools | length'
    # expect 8 (default "core") or 51 (with AGENTMEMORY_TOOLS=all)

    To get all 51 tools add to your compose env:

    environment:
      AGENTMEMORY_TOOLS: all

    Then curl ... | jq '.tools | length' should return 51, and RooCode will see the same set via the shim.

    If after rebuild you still see 4 tools from the curl, post the curl output and docker compose ps (or podman compose ps) and I'll dig further.

  7. rohitg00 commented on May 10, 2026

    @rohitg00
    Owner

    Reopening pending @jcalfee confirmation on Docker rebuild — original fix landed in v0.9.6 (#270) but his container appears to predate the change.

  8. jcalfee commented on May 11, 2026

    @jcalfee

    I don't think it was the rebuild that was required. It was that I had to put all in the tool names here on the host:

    AGENTMEMORY_TOOLS=all npx @agentmemory/agentmemory

    I did the rebuild anyways because I was still having problems getting that list of tools into the Flatpak and Roo code in VS Codeium:

    ADDED: user@s1max:~/.npm/_npx/076f5982d055bff5/node_modules/@agentmemory/agentmemory

    $ egrep AGENTMEMORY_TOOLS docker-compose.yml 
          AGENTMEMORY_TOOLS: all
     user@s1max:~/.npm/_npx/076f5982d055bff5/node_modules/@agentmemory/agentmemory
    $ docker compose down
    [+] down 2/2
     ✔ Container agentmemory-iii-engine-1 Removed                                                                                                                                       0.7s
     ✔ Network agentmemory_default        Removed                                                                                                                                       0.0s
     user@s1max:~/.npm/_npx/076f5982d055bff5/node_modules/@agentmemory/agentmemory
    $ docker compose pull
    [+] pull 21/21
     ✔ Image iiidev/iii:0.11.2 Pulled                                                                                                                                                   0.9s
     user@s1max:~/.npm/_npx/076f5982d055bff5/node_modules/@agentmemory/agentmemory
    $ docker compose up -d
    [+] up 2/2
     ✔ Network agentmemory_default        Created                                                                                                                                       0.0s
     ✔ Container agentmemory-iii-engine-1 Started                                                                                                                                       0.1s
     user@s1max:~/.npm/_npx/076f5982d055bff5/node_modules/@agentmemory/agentmemory
    $ curl -s http://localhost:3111/agentmemory/mcp/tools | jq '.tools | length'
     user@s1max:~/.npm/_npx/076f5982d055bff5/node_modules/@agentmemory/agentmemory
    $ curl -s http://localhost:3111/agentmemory/mcp/tools | jq '.tools | length'
    51

    Now the issue persists:

    Image Image
     user@s1max:~/.npm/_npx/076f5982d055bff5/node_modules/@agentmemory/agentmemory
    $ pgrep -fal agentmemory
    466782 npm exec @agentmemory/agentmemory
    466797 node /home/user/.npm/_npx/076f5982d055bff5/node_modules/.bin/agentmemory
    471625 /usr/bin/conmon --api-version 1 -c 0157bb72948d4a83c4ef28334eb88a89c576a14c4476740c85737d605d59b01d -u 0157bb72948d4a83c4ef28334eb88a89c576a14c4476740c85737d605d59b01d -r /usr/bin/crun -b /home/user/.local/share/containers/storage/overlay-containers/0157bb72948d4a83c4ef28334eb88a89c576a14c4476740c85737d605d59b01d/userdata -p /run/user/1000/containers/overlay-containers/0157bb72948d4a83c4ef28334eb88a89c576a14c4476740c85737d605d59b01d/userdata/pidfile -n agentmemory-iii-engine-1 --exit-dir /run/user/1000/libpod/tmp/exits --persist-dir /run/user/1000/libpod/tmp/persist/0157bb72948d4a83c4ef28334eb88a89c576a14c4476740c85737d605d59b01d --full-attach -s -l journald --log-level info --syslog --runtime-arg --log-format=json --runtime-arg --log --runtime-arg=/run/user/1000/containers/overlay-containers/0157bb72948d4a83c4ef28334eb88a89c576a14c4476740c85737d605d59b01d/userdata/oci-log --conmon-pidfile /run/user/1000/containers/overlay-containers/0157bb72948d4a83c4ef28334eb88a89c576a14c4476740c85737d605d59b01d/userdata/conmon.pid --exit-command /usr/bin/podman --exit-command-arg --root --exit-command-arg /home/user/.local/share/containers/storage --exit-command-arg --runroot --exit-command-arg /run/user/1000/containers --exit-command-arg --log-level --exit-command-arg info --exit-command-arg --cgroup-manager --exit-command-arg systemd --exit-command-arg --tmpdir --exit-command-arg /run/user/1000/libpod/tmp --exit-command-arg --network-config-dir --exit-command-arg  --exit-command-arg --network-backend --exit-command-arg netavark --exit-command-arg --volumepath --exit-command-arg /home/user/.local/share/containers/storage/volumes --exit-command-arg --db-backend --exit-command-arg sqlite --exit-command-arg --transient-store=false --exit-command-arg --hooks-dir --exit-command-arg /usr/share/containers/oci/hooks.d --exit-command-arg --runtime --exit-command-arg crun --exit-command-arg --storage-driver --exit-command-arg overlay --exit-command-arg --events-backend --exit-command-arg journald --exit-command-arg container --exit-command-arg cleanup --exit-command-arg --stopped-only --exit-command-arg 0157bb72948d4a83c4ef28334eb88a89c576a14c4476740c85737d605d59b01d
    473013 npm exec @agentmemory/mcp
    473014 npm exec @agentmemory/mcp
    473072 node /home/user/.npm/_npx/ba4b5775a0ab44e2/node_modules/.bin/agentmemory-mcp
    473079 node /home/user/.npm/_npx/ba4b5775a0ab44e2/node_modules/.bin/agentmemory-mcp
    473138 npm exec @agentmemory/mcp
    473173 node /home/user/.npm/_npx/ba4b5775a0ab44e2/node_modules/.bin/agentmemory-mcp

    I did a pkill -9 and docker compose down then restarted the npx host and the MCP server:

     user@s1max:~/.npm/_npx/076f5982d055bff5/node_modules/@agentmemory/agentmemory
    $ pgrep -fal agentmemory
    476643 npm exec @agentmemory/agentmemory
    476815 node /home/user/.npm/_npx/076f5982d055bff5/node_modules/.bin/agentmemory
    476889 /usr/bin/conmon --api-version 1 -c a1f11316a57cf95fb49cd5621c8e9ac29d382db6475c3115c042f79f2d1b43a6 -u a1f11316a57cf95fb49cd5621c8e9ac29d382db6475c3115c042f79f2d1b43a6 -r /usr/bin/crun -b /home/user/.local/share/containers/storage/overlay-containers/a1f11316a57cf95fb49cd5621c8e9ac29d382db6475c3115c042f79f2d1b43a6/userdata -p /run/user/1000/containers/overlay-containers/a1f11316a57cf95fb49cd5621c8e9ac29d382db6475c3115c042f79f2d1b43a6/userdata/pidfile -n agentmemory-iii-engine-1 --exit-dir /run/user/1000/libpod/tmp/exits --persist-dir /run/user/1000/libpod/tmp/persist/a1f11316a57cf95fb49cd5621c8e9ac29d382db6475c3115c042f79f2d1b43a6 --full-attach -s -l journald --log-level info --syslog --runtime-arg --log-format=json --runtime-arg --log --runtime-arg=/run/user/1000/containers/overlay-containers/a1f11316a57cf95fb49cd5621c8e9ac29d382db6475c3115c042f79f2d1b43a6/userdata/oci-log --conmon-pidfile /run/user/1000/containers/overlay-containers/a1f11316a57cf95fb49cd5621c8e9ac29d382db6475c3115c042f79f2d1b43a6/userdata/conmon.pid --exit-command /usr/bin/podman --exit-command-arg --root --exit-command-arg /home/user/.local/share/containers/storage --exit-command-arg --runroot --exit-command-arg /run/user/1000/containers --exit-command-arg --log-level --exit-command-arg info --exit-command-arg --cgroup-manager --exit-command-arg systemd --exit-command-arg --tmpdir --exit-command-arg /run/user/1000/libpod/tmp --exit-command-arg --network-config-dir --exit-command-arg  --exit-command-arg --network-backend --exit-command-arg netavark --exit-command-arg --volumepath --exit-command-arg /home/user/.local/share/containers/storage/volumes --exit-command-arg --db-backend --exit-command-arg sqlite --exit-command-arg --transient-store=false --exit-command-arg --hooks-dir --exit-command-arg /usr/share/containers/oci/hooks.d --exit-command-arg --runtime --exit-command-arg crun --exit-command-arg --storage-driver --exit-command-arg overlay --exit-command-arg --events-backend --exit-command-arg journald --exit-command-arg container --exit-command-arg cleanup --exit-command-arg --stopped-only --exit-command-arg a1f11316a57cf95fb49cd5621c8e9ac29d382db6475c3115c042f79f2d1b43a6
    477288 npm exec @agentmemory/mcp
    477331 npm exec @agentmemory/mcp
    477332 npm exec @agentmemory/mcp
    477363 node /home/user/.npm/_npx/ba4b5775a0ab44e2/node_modules/.bin/agentmemory-mcp
    477384 node /home/user/.npm/_npx/ba4b5775a0ab44e2/node_modules/.bin/agentmemory-mcp
    477391 node /home/user/.npm/_npx/ba4b5775a0ab44e2/node_modules/.bin/agentmemory-mcp

    Still 51 tools on the host but 7 in Roo Code.

    Also, I loose everything when I restart docker and the data dir is empty:

    $ find /home/user/.local/share/containers/storage/volumes/agentmemory_iii-data/_data
    /home/user/.local/share/containers/storage/volumes/agentmemory_iii-data/_data

    The last startup was a bit strange that it had to re-install:

     user@s1max:~/dev/vendor/stt (master)
    $ AGENTMEMORY_TOOLS=all npx @agentmemory/agentmemory
    Need to install the following packages:
    @agentmemory/agentmemory@0.9.6
    Ok to proceed? (y) y
    
    ┌  agentmemory
    which: no iii in (/home/user/.npm/_npx/076f5982d055bff5/node_modules/.bin:/home/user/dev/vendor/stt/node_modules/.bin:/home/user/dev/vendor/node_modules/.bin:/home/user/dev/node_modules/.bin:/home/user/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/usr/lib/node_modules_22/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/user/.cargo/bin:/home/user/.local/share/mise/installs/http-mise-inpower/1.0.0:/home/user/.local/bin:/home/user/bin:/usr/local/bin:/usr/bin:/run/host/usr/bin:/run/host/sbin:~/dev/ipall/bin:node_modules/.bin:../node_modules/.bin:../../node_modules/.bin:../../../node_modules/.bin:../../../../node_modules/.bin:~/.cargo/bin:~/dev/ipall/bin:node_modules/.bin:../node_modules/.bin:../../node_modules/.bin:../../../node_modules/.bin:../../../../node_modules/.bin:~/.cargo/bin)
    │
    ◇  Docker compose started
    │
    ◇  iii-engine is ready
    [agentmemory] Starting worker v0.9.6...
    [agentmemory] Engine: ws://localhost:49134
    [agentmemory] Provider: openrouter (anthropic/claude-sonnet-4-20250514)
    [agentmemory] Embedding provider: openrouter (1536 dims)
    [agentmemory] REST API: http://localhost:3111/agentmemory/*
    [agentmemory] Streams: ws://localhost:3112
    [OTel] Traces initialized: engine=ws://localhost:49134, service=agentmemory
    [OTel] Metrics initialized: interval=30000ms
    [OTel] Global fetch instrumentation enabled
    [OTel] Logs initialized: delay=100ms, batch=1
    [agentmemory] Consolidation pipeline: registered (CONSOLIDATION_ENABLED=false)
    [agentmemory] Auto-compress: OFF (default, #138) — observations indexed via zero-LLM synthetic compression. Set AGENTMEMORY_AUTO_COMPRESS=true to opt-in to LLM-powered summaries (uses your API key).
    [agentmemory] WARNING: AGENTMEMORY_INJECT_CONTEXT=true — the PreToolUse and SessionStart hooks will inject up to ~4000 chars of memory context into every tool turn. On Claude Pro this burns session tokens proportional to your tool-call frequency (see #143). Set AGENTMEMORY_INJECT_CONTEXT=false to disable.
    [agentmemory] v0.6 advanced retrieval: sliding-window, query-expansion, temporal-graph, retention-scoring
    [agentmemory] Orchestration layer: actions, frontier, leases, routines, signals, checkpoints, flow-compress, mesh, branch-aware, sentinels, sketches, crystallize, diagnostics, facets
    (node:476815) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    (Use `node --trace-deprecation ...` to show where the warning was created)
    [iii] Worker registered with ID: 683ce8e0-136a-43f7-8a28-78790cd6e9e5
    [OTel] Connected to engine at ws://localhost:49134/otel
    [agentmemory] Ready. Triple-stream (BM25+Vector+Graph) search active.
    [agentmemory] Endpoints: 107 REST + 51 MCP tools + 6 MCP resources + 3 MCP prompts
    [agentmemory] Auto-forget: enabled (every 60m)
    [agentmemory] Lesson decay sweep: enabled (every 24h)
    [agentmemory] Viewer: http://localhost:3113
  9. rohitg00 commented on May 11, 2026

    @rohitg00
    Owner

    You're right — my "rebuild the container" advice missed the actual root cause. Re-read the trace carefully now. Server is fine; the shim is what's degraded. Walking through what your output proves:

    1. Server side: correct. curl http://localhost:3111/agentmemory/mcp/tools | jq '.tools | length' → 51. Server-side endpoint, AGENTMEMORY_TOOLS=all, healthy.

    2. Shim side: silently in local mode. @agentmemory/mcp v0.9.6 has a two-mode flow (src/mcp/rest-proxy.ts):

      • probe GET http://localhost:3111/agentmemory/livez (500ms timeout)
      • probe OK → proxy mode → forward tools/list to server → 51 tools
      • probe fails → local mode → return IMPLEMENTED_TOOLS (7) from src/mcp/standalone.ts:16

      You see 7 tools in Roo Code, so the shim instance Roo Code spawned is in local mode. The probe failed for that process — even though it works from your host shell.

    3. Likely cause: Roo Code spawns the shim inside the VS Codeium Flatpak sandbox. Even though Flatpak normally shares the host network namespace, two things commonly break the probe:

      • VS Codeium's Flatpak manifest restricts --share=network or routes localhost to a sandboxed loopback
      • The 500ms probe timeout is aggressive for first-call cold-start inside the sandbox

      The probe error is currently swallowed (catch {} in rest-proxy.ts:39), so there's no log line telling you what happened — that's a shim DX bug I'll fix.

    Confirm the diagnosis — run this from inside the Flatpak (not your host shell):

    flatpak run --command=sh com.vscodium.codium  # or whatever your VS Codeium flatpak id is
    # inside the sandbox:
    curl -v --max-time 1 http://localhost:3111/agentmemory/livez

    If that fails or hangs, the probe is being blocked at the sandbox layer.

    Workarounds while I land a fix:

    Option A — point Roo Code at a tunnel that the Flatpak can reach (replace localhost with the host's LAN IP, e.g. 192.168.x.x):

    {
      "command": "npx",
      "args": ["-y", "@agentmemory/mcp"],
      "env": {
        "AGENTMEMORY_URL": "http://192.168.x.x:3111"
      }
    }

    Option B — give the Flatpak network permission explicitly (run on host):

    flatpak override --user --share=network com.vscodium.codium

    Then fully quit VS Codeium and re-add the MCP server in Roo Code so the shim re-probes. (Roo Code, like most MCP clients, calls tools/list once per session and caches the result; restarting Codeium isn't enough — the MCP server entry needs to be removed/re-added.)

    What I'm going to land in a follow-up PR:

    1. rest-proxy.ts — surface probe failures to stderr with URL + reason (not silent), bump probe timeout from 500ms to 2000ms.
    2. Add AGENTMEMORY_FORCE_PROXY=1 env so sandboxed clients can skip the probe entirely.
    3. README troubleshooting note for Flatpak / Snap / sandboxed MCP clients.

    Separate issues you flagged (filing these so they don't get lost):

    • Data dir empty after docker compose down — volume binding bug. Will open a separate issue.
    • which: no iii in ... plus reinstall every npx run — @agentmemory/agentmemory not finding the iii CLI on PATH. Separate.

    Sorry for the misdirected first reply. Reopen this if the workarounds don't get Roo Code to 51 tools — I'd rather keep one thread on the shim/probe bug.

  10. rohitg00 commented on May 11, 2026

    @rohitg00
    Owner

    @jcalfee Found data-loss bug! Config writes to ./data/ (relative — inside container's $PWD) but volume mounts at /data (absolute). Mismatch → data goes to ephemeral layer → lost on docker compose down.

  11. rohitg00 commented on May 11, 2026

    @rohitg00
    Owner

    @jcalfee follow-up PR #280 — adds AGENTMEMORY_FORCE_PROXY=1 escape hatch for the Flatpak / Roo Code probe failure, plus probe-failure stderr logging, plus fixes the related volume-mount bug (state was being written to the ephemeral container layer instead of iii-data — that's why your data dir came up empty after docker compose down). Once it lands and v0.9.7 ships, try AGENTMEMORY_FORCE_PROXY=1 in your Roo Code env and you should see 51 tools.

  12. rohitg00 commented on May 11, 2026

    @rohitg00
    Owner

    Hey @jcalfee, can you try a local build with this #280? Thanks, really appreciated.

  13. jcalfee commented on May 11, 2026

    @jcalfee

    flatpack is and was already using share=network

    Image

    Also, in flatpack:

    [📦 com.vscodium.codium agentmemory]$ curl http://localhost:3111/agentmemory/mcp/tools | jq '.tools | length'
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 21443  100 21443    0     0  4352k      0 --:--:-- --:--:-- --:--:-- 5235k
    51

    I removed the extension, stopped VSCodium, ensured there are no agentmemory process, started everything up and re-added the MCP server. Still 7 tools. It has to be in the extension format. maybe that change to reveal an error will help

    Here again it's using the host network so this should show that it is going to the right server:

     user@s1max:~/.npm/_npx/076f5982d055bff5/node_modules/@agentmemory/agentmemory
    $ flatpak run --command=sh com.vscodium.codium
    [📦 com.vscodium.codium agentmemory]$ curl -v --max-time 1 http://localhost:3111/agentmemory/livez
    * Host localhost:3111 was resolved.
    * IPv6: ::1
    * IPv4: 127.0.0.1
    *   Trying [::1]:3111...
    * connect to ::1 port 3111 from ::1 port 46036 failed: Connection refused
    *   Trying 127.0.0.1:3111...
    * Connected to localhost (127.0.0.1) port 3111
    * using HTTP/1.x
    > GET /agentmemory/livez HTTP/1.1
    > Host: localhost:3111
    > User-Agent: curl/8.15.0
    > Accept: */*
    > 
    * Request completely sent off
    < HTTP/1.1 200 OK
    < content-type: application/json
    < vary: origin, access-control-request-method, access-control-request-headers
    < content-length: 39
    < date: Mon, 11 May 2026 10:07:57 GMT
    < 
    * Connection #0 to host localhost left intact
    {"service":"agentmemory","status":"ok"}

    AGENTMEMORY_TOOLS=all is required. AGENTMEMORY_TOOLS=all npx @agentmemory/agentmemory and in pr-280 AGENTMEMORY_TOOLS=all npm start to see the full list (certainly not on by default).

    Local build of pr-280:

    Adding "AGENTMEMORY_FORCE_PROXY": "1" still yields only 7 tools (expected, I think it is established that the API is already returning all 51 tools and that there is not a zombie process).

    Grok looked at the list of 7 that did parse and all of the 51 in the json: "there are no inconsistencies or structural patterns in the 51-tool JSON that would cause the Roo Code plugin (or its MCP server integration) to fail parsing the other 44 tools."

    I'm not confident that I would see this error if it happened:

    // Lines 372-396
    case "tools/list": {
      const handle = await resolveHandle();  // Probes /agentmemory/livez ✓ succeeds
      announceMode(handle);
      if (handle.mode === "proxy") {
        try {
          const remote = (await handle.call("/agentmemory/mcp/tools", {
            method: "GET",
          })) as { tools?: unknown } | null;
          if (remote && Array.isArray(remote.tools)) {
            return { tools: remote.tools };  // ← Should return 51 tools
          }
        } catch (err) {
          // Falls back to local mode (7 tools)
          process.stderr.write(`[@agentmemory/mcp] tools/list proxy failed: ${err}\n`);
          invalidateHandle();
        }
      }
      // FALLBACK: Only 7 tools
      return { tools: getVisibleTools().filter((t) => IMPLEMENTED_TOOLS.has(t.name)) };
    }

    There is nothing under Roo Code itself:

    Image

    Also, it's not straightforward to test it by stopping everything and reloading the tool list in Roo Code MCP because, even with "AGENTMEMORY_FORCE_PROXY": "1", the MCP tool list still loads the seven tools even while the docker container is down and AGENTMEMORY_TOOLS=all npm start is not running.


    The docker volume has data files in it now. Thank you!

  14. jcalfee commented on May 11, 2026

    @jcalfee

    Of course the PR is not running inside of the Flatpak environment and that's still running under NPX (npm release I presume). I'm not even I'm not too clear on how that even works because when try suggestions I'm getting about this environment is not working so well.

    [📦 com.vscodium.codium agentmemory]$ flatpak-spawn --host npx -y @agentmemory/mcp 
    Portal call failed: org.freedesktop.DBus.Error.ServiceUnknown
    Hint: --host only works when the Flatpak is allowed to talk to org.freedesktop.Flatpak

    But yet the Roo Code MCP server seems to be able to do this... I do know why the Roo Code plugin succeeds while a manual command in the integrated terminal does not.

  15. rohitg00 commented on May 11, 2026

    @rohitg00
    Owner

    @jcalfee — I just found out, bug isn't in agentmemory/mcp at all. Roo Code itself is dropping 44 of the 51 tools before showing them to you. I have a clean repro proving the shim returns 51.

    Reproduction (just ran this against #280's branch)

    Set up:

    docker compose up -d            # iii-engine
    AGENTMEMORY_TOOLS=all node dist/cli.mjs    # agentmemory worker
    

    Drive the shim over stdio exactly the way Roo Code does, with full debug:

    {
      printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","clientInfo":{"name":"test","version":"1"},"capabilities":{}}}'
      printf '%s\n' '{"jsonrpc":"2.0","method":"notifications/initialized","params":{}}'
      printf '%s\n' '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'
      sleep 1
    } | AGENTMEMORY_URL=http://localhost:3111 AGENTMEMORY_DEBUG=1 node dist/standalone.mjs 2>/tmp/shim.stderr | tee /tmp/shim.stdout > /dev/null
    

    Shim's stderr trace:

    [@agentmemory/mcp] Standalone MCP server v0.9.7 starting...
    [@agentmemory/mcp] proxying to agentmemory server at http://localhost:3111
    [@agentmemory/mcp] tools/list: handle.mode=proxy baseUrl=http://localhost:3111
    [@agentmemory/mcp] tools/list: remote response shape: keys=tools toolsType=array(len=51)
    [@agentmemory/mcp] tools/list: returning 51 tools from server
    

    Shim's stdout to the MCP client:

    $ grep -o '"name":"[^"]*"' /tmp/shim.stdout | wc -l
    52
    

    (51 tools + 1 serverInfo.name = 52 — confirms shim returns all 51 over the wire.)

    The shim is correct. Roo Code is dropping tools after parsing them.

    What's happening on the Roo Code side

    Three signals point at Roo Code, not us:

    1. You see 7 tools when docker is down. If the shim were doing it, you'd see 7 only when the shim's fallback path triggers. With docker down → engine down → livez 404 → shim falls back to 7. But with docker UP and AGENTMEMORY_TOOLS=all set, the shim returns 51 (proven above). The fact that 7 persists across both states is Roo Code caching its own MCP tool list, independent of what the shim reports.

    2. Always exactly 7, never anything else. If Roo Code rendered what the shim sent, you'd see 51 (with server up) or 7 (with server down). The fact that the count is stuck at 7 means Roo Code is reading from cache, not from the wire.

    3. The 7 are the IMPLEMENTED_TOOLS set, not the ESSENTIAL_TOOLS set. IMPLEMENTED_TOOLS (7) is the shim's local-fallback list; ESSENTIAL_TOOLS (8) is the server's default when AGENTMEMORY_TOOLS is unset. If Roo Code were getting the server's default, you'd see 8. The fact that you see exactly the 7 IMPLEMENTED_TOOLS strongly suggests Roo Code cached a prior (server-down) tools/list response from before you set AGENTMEMORY_TOOLS=all, and is replaying it.

    What to do on your side

    Clear Roo Code's MCP cache and re-add the server. The cache likely lives under one of:

    ~/.var/app/com.vscodium.codium/config/VSCodium/User/globalStorage/rooveterinaryinc.roo-cline/
    ~/.var/app/com.vscodium.codium/config/VSCodium/User/workspaceStorage/*/rooveterinaryinc.roo-cline/
    # stop everything first
    flatpak kill com.vscodium.codium
    pkill -9 -f '@agentmemory/mcp' 2>/dev/null
    
    # nuke the Roo Code state for this workspace
    rm -rf ~/.var/app/com.vscodium.codium/config/VSCodium/User/globalStorage/rooveterinaryinc.roo-cline/
    
    # bring everything back up clean
    docker compose up -d
    AGENTMEMORY_TOOLS=all npx @agentmemory/agentmemory   # in one shell
    # then start Codium and re-add the agentmemory MCP server entry

    What v0.9.7 ships for you regardless

    Already pushed to #280 since you last commented:

    • AGENTMEMORY_DEBUG=1 — shim now logs handle.mode, response shape, and tool count to stderr on every tools/list. Set it in your Roo Code env block and Roo Code will route the shim's stderr to its output panel; you'll see whether 51 or 7 is leaving the shim.
    • Loud stderr warning if /agentmemory/mcp/tools ever returns a JSON shape that isn't {tools: Array} (previously: silent local fallback).
    • Plus the things already on this branch: probe stderr logging, AGENTMEMORY_FORCE_PROXY=1, AGENTMEMORY_PROBE_TIMEOUT_MS, absolute volume paths (you've confirmed this one works), which iii stderr leak fix, 30 MB compose log cap.
  16. jcalfee commented on May 11, 2026

    @jcalfee

    I'll just work with the 7 tools until the successor, Zoo Code, is released then try again. Thank you..

  17. jcalfee commented on May 11, 2026

    @jcalfee

    You may still have a bug but we'll see if someone else reports it. Why do you need filtering at all into the seven tools? I definitely see the request is getting proxied out to the actual memory storage container, Docker container, and it's being logged properly on the host logs. But I still think you have MCP filtering that gets triggered where you don't expect it to be triggered. There's no way that Roo Code is caching this result and filtering out tools. Grok tells me Row Code doesn't filter memory tool commands and does not have any meaningful cache..

  18. rohitg00 commented on May 11, 2026

    @rohitg00
    Owner

    If 51 tools are exposed at once, That's token pollution to agent windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions