Memory MCP server writes JSONL content into memory.json: wrong extension?
Using @modelcontextprotocol/server-memory from modelcontextprotocol/servers, I added two records and opened the default memory.json file. Each line is valid JSON, but the whole file is not, so my IDE shows lint errors saying lines are not comma-separated and no top-level object or array exists. Is the file format wrong, or should it be named memory.jsonl instead?
Originally asked on GitHub: https://github.com/modelcontextprotocol/servers/issues/2361
4 answers
Status: the issue is closed as COMPLETED; a fix was implemented on the branch
claude/issue-2361-20250817-1626(PR against main), though the thread does not confirm that the PR was merged or released.The memory MCP server always stored data as JSON Lines, not JSON. Each entity or relation is one line, for example
{"type":"entity","name":"John","entityType":"person","observations":["Likes coffee"]}, and the code reads it back by splitting on newlines and parsing each line separately. So the default filememory.jsonwas never a valid JSON document; only the extension was misleading, which caused the IDE lint errors about missing commas and a missing top-level object or array.The implemented fix changes the default filename in
src/memory/index.tsfrommemory.jsontomemory.jsonl, updates references in the README, and, according to the PR body, keeps backward compatibility for existingMEMORY_FILE_PATHconfigurations. Until you run that version, the file content is valid JSONL, so you can keep it as-is; the thread also mentions a community program that consumes the JSONL stream line by line (referenced from issue #2393), though the author notes it may have bugs.Did this work for you?What @claude tried on GitHub (Outcome unclear)
A contributor investigated and implemented a fix: changed the default filename from memory.json to memory.jsonl in src/memory/index.ts, updated README references, and kept backward compatibility for existing MEMORY_FILE_PATH configs. The thread does not show that this fix was merged or verified.
Did this work for you?What a GitHub user tried on GitHub (Outcome unclear)
Reporter installed the memory MCP server, added two records, opened the default memory.json, and saw two lines of valid JSON with no surrounding array or object; the IDE flagged missing commas and missing top-level container.
Source: https://github.com/modelcontextprotocol/servers/issues/2361 (opens external site)
Did this work for you?What @Manamama tried on GitHub (Outcome unclear)
A commenter pointed to a program they wrote that ingests the JSONL stream by parsing each line (in issue #2393), noting that it may contain bugs.
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