You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Running the server locally with no changes to the repo, have env set to a custom MEMORY_FILE_PATH. I have tried starting the server with the memory.json being both an empty JSON Object and Array. When a new entity is created, it removes the existing structure of the empty file and adds a new entity, then when another entity is created it just adds a new JSON Object so there are 2 JSON Objects in the file but nothing wrapping them so the file is invalid
To Reproduce
Steps to reproduce the behavior:
Have one entity created
Have a second entity created
See that the .json file is errored
Expected behavior
I expect multiple entities to go into and be pulled from a valid JSON Array
Logs
{"type":"entity","name":"Brandon","entityType":"User","observations":["Primary user as provided by himself."]}
{"type":"entity","name":"MCP","entityType":"Self","observations":["This is the self entity for the assistant, created as per server instructions."]}
Additional context
Client created to use OpenAI API, other tools are working as expected, when only one entity is present the Memory tools work as well.
Reacted by Andrew Noblet, Olaoluwa (Ola) Mustapha and Ondrej Pekacek
In my case the memories being saved (not sure where) because Claude recalls those memories across sessions. But it's not clear where they are being stored. They are certainly not being stored in the location I specified.
I think my knowledge graph is empty now, but at some point Claude was steadily filling it up, and I asked Claude where he was writing it, because it was not at C:\Users\taket\Documents\GitHub\claude-memory\memory.json.
After some investigating we found that the file is being saved to the dist folder in my local install of @modelcontextprotocol/server-memory. Note that I've installed all of my MCP servers to my Windows PC's home folder; so if you haven't done that, then you might not have the directory.
cd ~
npm install @modelcontextprotocol/server-memory
...
So, the memory file for me is: C:\Users\taket\node_modules\@modelcontextprotocol\server-memory\dist\memory.json
(if you run npm install * in a different directory, I think ./node_modules/ will be created there)
Unfortunately, I don't know if this file in ./dist/ is persistent.
Claude had previously saved a lot of memories to that graph, but they've since been erased. I had to ask him to recreate the file just now, to verify its creation in ./dist/. Maybe restarting the server with a new npx command clears the ./dist/ directory.
Thanks. I found it and replaced it with a sym link pointing to the actual file in my Dropbox so that my memories can be accesses by Claude across multiple machines.
Seems like when memory server was running locally, it was storing here /Users/lamba/.npm/_npx/15b07286cbcc3329/node_modules/@modelcontextprotocol/server-memory/dist/memory.json
When i installed it globally, it started storing here /usr/local/lib/node_modules/@modelcontextprotocol/server-memory/dist/memory.json
In my case the memories being saved (not sure where) because Claude recalls those memories across sessions. But it's not clear where they are being stored. They are certainly not being stored in the location I specified.
I've also been unable to get my memory.json saved to the specified path. Here's my config:
My understanding was that version 2025.4.25 finally included the fix for this, if you're still having this issue could you try adding @latest to your package version eg in your config use: @modelcontextprotocol/server-memory@latest?
My understanding was that version 2025.4.25 finally included the fix for this, if you're still having this issue could you try adding @latest to your package version eg in your config use: @modelcontextprotocol/server-memory@latest?
I just did set it to @latest and did reset the MCP server cache, though it still doesn't work as I expected. When I set "MEMORY_FILE_PATH": "memory.jsonl" I expect it to access the memory.jsonl in the project root, just like everything else in VS Code. server-memory@latest is not writing to memory.jsonl in the project but to somewhere else, not sure where. At least it's not throwing an error, so I assume it's writing to somewhere else. I've been looking for the file, but I couldn't find it on my box. Do I misunderstand how the server works? Does it not interpret "memory.jsonl" as a relative path? The file does exist and when it set MEMORY_FILE_PATH to the absolute path, everything works.
Was this fixed? I can NOT confirm that it works with relative and absolute path on Windows: "MEMORY_FILE_PATH": "c:\\path\\to\\dir\\memory.json" I also expected to have something like this work: "MEMORY_FILE_PATH": "%USERPROFILE%\\memory.json" on Windows
The memory file is JSON Lines by design: one JSON object per line, not a JSON array (9d8c2dfc changed the default filename to memory.jsonl to make that explicit). Reading it with a plain JSON parser will fail as described. Windows absolute paths in MEMORY_FILE_PATH work; %USERPROFILE% does not because the server does not expand shell variables, and ~ expansion is proposed in #4447. Closing.
Activity
lamba commentedon Apr 19, 2025
In my case the memories being saved (not sure where) because Claude recalls those memories across sessions. But it's not clear where they are being stored. They are certainly not being stored in the location I specified.
Here's my config file
leependu commentedon Apr 19, 2025
I've also been unable to get my
memory.jsonsaved to the specified path. Here's my config:I think my knowledge graph is empty now, but at some point Claude was steadily filling it up, and I asked Claude where he was writing it, because it was not at
C:\Users\taket\Documents\GitHub\claude-memory\memory.json.After some investigating we found that the file is being saved to the
distfolder in my local install of@modelcontextprotocol/server-memory. Note that I've installed all of my MCP servers to my Windows PC's home folder; so if you haven't done that, then you might not have the directory.So, the memory file for me is:
C:\Users\taket\node_modules\@modelcontextprotocol\server-memory\dist\memory.json(if you run
npm install *in a different directory, I think./node_modules/will be created there)Unfortunately, I don't know if this file in
./dist/is persistent.Claude had previously saved a lot of memories to that graph, but they've since been erased. I had to ask him to recreate the file just now, to verify its creation in
./dist/. Maybe restarting the server with a newnpxcommand clears the./dist/directory.lamba commentedon Apr 19, 2025
Thanks. I found it and replaced it with a sym link pointing to the actual file in my Dropbox so that my memories can be accesses by Claude across multiple machines.
Seems like when memory server was running locally, it was storing here
/Users/lamba/.npm/_npx/15b07286cbcc3329/node_modules/@modelcontextprotocol/server-memory/dist/memory.jsonWhen i installed it globally, it started storing here
/usr/local/lib/node_modules/@modelcontextprotocol/server-memory/dist/memory.jsonruiwarn commentedon Apr 22, 2025
I have the same issue, please deal with this bug
kc0ed commentedon Apr 22, 2025
所以这应该是个bug....我的天, 有没有其他memoryMCP代替品lol
sascharo commentedon Jun 4, 2025
例如 https://github.com/doobidoo/mcp-memory-service
sascharo commentedon Jun 4, 2025
It might be related to #1846, #1600, and #1018.
olaservo commentedon Jun 7, 2025
My understanding was that version
2025.4.25finally included the fix for this, if you're still having this issue could you try adding@latestto your package version eg in your config use:@modelcontextprotocol/server-memory@latest?sascharo commentedon Jun 7, 2025
I just did set it to
@latestand did reset the MCP server cache, though it still doesn't work as I expected. When I set"MEMORY_FILE_PATH": "memory.jsonl"I expect it to access thememory.jsonlin the project root, just like everything else in VS Code.server-memory@latestis not writing tomemory.jsonlin the project but to somewhere else, not sure where. At least it's not throwing an error, so I assume it's writing to somewhere else. I've been looking for the file, but I couldn't find it on my box. Do I misunderstand how the server works? Does it not interpret"memory.jsonl"as a relative path? The file does exist and when it setMEMORY_FILE_PATHto the absolute path, everything works.skynet commentedon Aug 26, 2025
Was this fixed? I can NOT confirm that it works with relative and absolute path on Windows:
"MEMORY_FILE_PATH": "c:\\path\\to\\dir\\memory.json"I also expected to have something like this work:"MEMORY_FILE_PATH": "%USERPROFILE%\\memory.json"on WindowsActually NOT:
ferhimedamine commentedon Jun 12, 2026
fix(memory): atomic save + per-line parse guard against corruption (m…
fix(memory): atomic save + per-line parse guard against corruption (m…
olaservo commentedon Sep 3, 2026
The memory file is JSON Lines by design: one JSON object per line, not a JSON array (
9d8c2dfcchanged the default filename tomemory.jsonlto make that explicit). Reading it with a plain JSON parser will fail as described. Windows absolute paths inMEMORY_FILE_PATHwork;%USERPROFILE%does not because the server does not expand shell variables, and~expansion is proposed in #4447. Closing.