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
Fixed on
mainin PR #3213 (commit8af50b9, merged 2026-01-13); a maintainer confirmed the fix in this thread. The root cause was inloadGraph()insrc/memory/index.ts: each JSONL line stores atypediscriminator field ("type":"entity"or"type":"relation"), and the code pushed the raw object withgraph.entities.push(item as Entity). Theas Entitycast does not strip properties at runtime, so the extratypefield failed the output schema'sadditionalProperties: falseand produced the-32602error on every read operation.Until you can run the fixed version:
- Patch the installed package locally. In
node_modules/@modelcontextprotocol/server-memory, change theloadGraph()parsing (sourcesrc/memory/index.tsor builtdist/index.js) to striptypebefore pushing: for entities useconst { 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. - Workaround from the issue report: if you only need the data, read
memory.jsondirectly with file I/O. Write operations (create_entities,add_observations) were never affected.
The maintainer reproduced the exact setup (JSONL lines containing
type, then callingread_graph/search_nodes/open_nodes) against currentmainwith 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?- Patch the installed package locally. In
What @olaservo tried on GitHub (Worked)
A maintainer reproduced the exact JSONL setup (lines with a
typefield) against currentmainwith the latest SDK and confirmedread_graph/search_nodes/open_nodesnow return schema-conformant output.Did this work for you?What @sstklen tried on GitHub (Outcome unclear)
Suggested patching the server locally by destructuring parsed items in
loadGraph()to strip thetypefield before pushing entities/relations, editing the source ornode_modules/@modelcontextprotocol/server-memory/dist/index.js. Mentioned open PR #3094.Did this work for you?What a GitHub user tried on GitHub (Partly worked)
Used the workaround of reading
memory.jsondirectly 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?What a GitHub user tried on GitHub (Didn't work)
Cleared the npm cache with
npm cache clean --forceand 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?
Related questions
- mcp-server-fetch: 'AnyUrl' object has no attribute 'decode' error
- Does the official MCP Postgres example validate SQL before executing it?
- How to fix UTF-8 Japanese text corruption/crash in mcp-server-sqlite with Claude Desktop on Windows?
- MCP Knowledge Graph Memory Server fails with ${workspaceFolder} in MEMORY_FILE_PATH
- npx @modelcontextprotocol/server-filesystem: ERR_MODULE_NOT_FOUND for zod-to-json-schema