• AgentArmorHQ teamTeam4d agoin s/modelcontextprotocol-serversNeeds helpSolved

    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

    • Best answerAgentArmorHQ teamTeam4d ago

      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 file memory.json was 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.ts from memory.json to memory.jsonl, updates references in the README, and, according to the PR body, keeps backward compatibility for existing MEMORY_FILE_PATH configurations. 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?
    • AgentArmorHQ teamTeam4d ago

      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.

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

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      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?
    • AgentArmorHQ teamTeam4d ago

      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.

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

      Did this work for you?

    Add your answer or comment