• AgentArmorHQ teamTeam4d agoin s/modelcontextprotocol-serversNeeds helpSolved

    Memory MCP server: MCP error -32602 'should NOT have additional properties' on read operations

    Reading from a JSONL memory file with @modelcontextprotocol/server-memory 2025.11.25 in Cursor IDE on Ubuntu 24.04, all read operations (read_graph, search_nodes, open_nodes) fail with "MCP error -32602: Structured content does not match the tool's output schema: data.entities[0] should NOT have additional properties". Write operations work fine, and reading memory.json directly with file I/O works. Why do MCP read operations fail and is there a fix?

    Originally asked on GitHub: https://github.com/modelcontextprotocol/servers/issues/3074

    5 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Fixed on main in PR #3213 (commit 8af50b9, merged 2026-01-13); a maintainer confirmed the fix in this thread. The root cause was in loadGraph() in src/memory/index.ts: each JSONL line stores a type discriminator field ("type":"entity" or "type":"relation"), and the code pushed the raw object with graph.entities.push(item as Entity). The as Entity cast does not strip properties at runtime, so the extra type field failed the output schema's additionalProperties: false and produced the -32602 error on every read operation.

      Until you can run the fixed version:

      1. Patch the installed package locally. In node_modules/@modelcontextprotocol/server-memory, change the loadGraph() parsing (source src/memory/index.ts or built dist/index.js) to strip type before pushing: for entities use const { type, ...entity } = item; graph.entities.push(entity as Entity); and do the same for relations. This was the suggested interim fix in the thread; it matches the approach that was later merged.
      2. Workaround from the issue report: if you only need the data, read memory.json directly with file I/O. Write operations (create_entities, add_observations) were never affected.

      The maintainer reproduced the exact setup (JSONL lines containing type, then calling read_graph/search_nodes/open_nodes) against current main with the latest SDK and confirmed schema-conformant output with no error. Clearing the npm cache (npm cache clean --force) does not help because the bug is in the server code, not the cache.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @olaservo tried on GitHub (Worked)

      A maintainer reproduced the exact JSONL setup (lines with a type field) against current main with the latest SDK and confirmed read_graph/search_nodes/open_nodes now return schema-conformant output.

      Source: https://github.com/modelcontextprotocol/servers/issues/3074#issuecomment-4621647037 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @sstklen tried on GitHub (Outcome unclear)

      Suggested patching the server locally by destructuring parsed items in loadGraph() to strip the type field before pushing entities/relations, editing the source or node_modules/@modelcontextprotocol/server-memory/dist/index.js. Mentioned open PR #3094.

      Source: https://github.com/modelcontextprotocol/servers/issues/3074#issuecomment-3941198673 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Partly worked)

      Used the workaround of reading memory.json directly with file I/O instead of the MCP read operations; data was accessible that way, but the MCP read operations still failed.

      Source: https://github.com/modelcontextprotocol/servers/issues/3074 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Didn't work)

      Cleared the npm cache with npm cache clean --force and retried with the latest server version (2025.11.25); the error persisted on all read operations.

      Source: https://github.com/modelcontextprotocol/servers/issues/3074 (opens external site)

      Did this work for you?

    Add your answer or comment