Skip to content

MCP memory server NO persistent memory.json location! #220

Closed

Description

@shaneholloman

Persistent Data Location

Is your feature request related to a problem? Please describe.

It's in the title:

Caution

Code version updates will destroy that json file!

I am very relieved I had anticipated that happening and add backup my json yesterday before a restart. Incidentally that will super hard to find that jsonfile ! lol!

current location example: C:\Users\shane\AppData\Local\npm-cache\_npx\15b07286cbcc3329\node_modules\@modelcontextprotocol\server-memory\dist\memory.json

Describe the solution you'd like

For persistent data we need to have server code that will respect a location constant:

    "memory": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-memory"]
      "env": {
        "MCP_MEMORY_DATA_FILE": "c:\\super\\safe\\persistent\\location\\memory.jsonl"
    },

Describe alternatives you've considered

n/a

Additional context

you're doing incredible work! Love the protocol so much ...

Activity

  1. changed the title [-]MCP `memory` server has a poor persistent memory.json location![/-] [+]MCP `memory` server NO persistent memory.json location! Complete Failure[/+] on Dec 6, 2024
  2. greenforestpath commented on Dec 7, 2024

    @greenforestpath

    im also having trouble figuring out how to save to memory.json

    create_entities seems to do nothing to actually save the file.

    so close :) - but currrently not functional

  3. shaneholloman commented on Dec 9, 2024

    @shaneholloman
    Author
  4. shaneholloman commented on Dec 10, 2024

    @shaneholloman
    Author

    I updated the server name, as I intend to develop my own version from here;

        "mcp-knowledge-graph": {
          "command": "npx",
          "args": ["-y", "mcp-knowledge-graph", "--memory-path", "C:/Users/shane/Desktop/memory/memory.jsonl"]
        },

    these are now separate servers - DONT run them together yet as I will need to use unique function name before you can do that.

    image

    so remove the original if you want to use mine

  5. JBHarvey commented on Feb 7, 2025

    @JBHarvey

    Hi!
    Is 'memory persistence' something planned in the pipeline?
    I would really love to have the memory graph persisted!

  6. s2005 commented on Feb 10, 2025

    @s2005
    Contributor

    Hi

    Hi! Is 'memory persistence' something planned in the pipeline? I would really love to have the memory graph persisted!

    kind of persistance should be working, if you specify env variable - take a look - NPX with custom setting
    https://github.com/modelcontextprotocol/servers/tree/main/src/memory#npx-with-custom-setting

    but seems there is a glitch between version publish in npm and repo version.
    tested by running these commands -

    """
    ❯ npm view @modelcontextprotocol/server-memory version
    0.6.2
    """

    while version in repo is newer -
    https://github.com/modelcontextprotocol/servers/blob/main/src/memory/package.json
    """
    "version": "0.6.3",
    """

    Please check version your are using and let me know about your config.

  7. JBHarvey commented on Feb 11, 2025

    @JBHarvey

    Hi,
    In the end, after debugging it intensively with cline and a Claude Sonet-3.5 key, I ended up with Claude confirming that while there was an environment variable, the MCP server was indeed not actually storing data in the specified file.

    I don't mean to say that this is the truth my any means, but since I needed some kind of local data storage and I was talking about it with Claude, it ended up locally rewriting the mcp with sqlite for storage. Since I'm doing this for a corporate need, I can't share the implementation though :/

    So while it's very possible that you're right, that it can save to a file given the right version, I no longer have this mcp installed and I've moved on to other tasks.

    Thanks for the answer anyway, I hope it can help others if they find themselves in the same situation :)

  8. s2005 commented on Feb 12, 2025

    @s2005
    Contributor

    Hi!

    Glad that you have found way to workaround the issue!

    Based on my experience, if you clone the repository directly and use version 0.6.3, you can successfully utilize MEMORY_FILE_PATH environment variable to store memory.json permanently in a secure location. However, the standard approach using the npm package (as per documentation) won't work since npm still on version 0.6.2. Not sure who should push new version to npm. I do not have such permissions. Hence, my workaround to build directly from the repository.

  9. s2005 commented on Feb 12, 2025

    @s2005
    Contributor

    here is my steps:

    npm uninstall -g @modelcontextprotocol/server-memory
    cd /d/mcp/github_repositories/

    git clone https://github.com/modelcontextprotocol/servers.git

    cd modelcontextprotocol_servers/src/memory
    npx tsc
    npm install -g .
    npm ls -g --depth=0
    C:\Program Files\nodejs -> .
    @modelcontextprotocol/[email protected] -> .\D:\mcp\github_repositories\modelcontextprotocol_servers\src\memory


    not sure if I provided all steps. maybe some additional are still needed ...

  10. edobez commented on Feb 13, 2025

    @edobez

    I've also fell on the version trap... v0.6.3 does provide the memory location argument, but that specific version is not yet published.

    Part as an exercise, part of the need to have a published package available, I created a Python port of such MCP server that behaves in the same way as the original and provides the MEMORY_FILE_PATH env variable.
    Here is the repo: https://github.com/edobez/mcp-memory-py

    It doesn't need to be cloned, as the solution above, since the package is published on PyPI.
    It can be simply used as:

    {
      "mcpServers": {
        "memory-python":
        {
          "command": "uvx",
          "args": [
            "--refresh",
            "--quiet",
            "mcp-memory-py"
          ],
        "env": {
            "MEMORY_FILE_PATH": "/path/to/custom/memory.json"
          }
        }
    }
    

    I might add other functionalities in the future, if you are interested.

  11. changed the title [-]MCP `memory` server NO persistent memory.json location! Complete Failure[/-] [+]MCP `memory` server NO persistent memory.json location![/+] on Feb 13, 2025
  12. thesobercoder commented on Feb 14, 2025

    @thesobercoder

    Hi @jspahrsummers any idea when the new version of memory server will be published? Seems like every new adopter of the memory server is facing this issue because of the lack of being able to pass the MEMORY_FILE_PATH.

  13. morrelljd commented on Mar 10, 2025

    @morrelljd

    Is there a place on my computer where this is stored? I'd really like to back up my knowledge graph

  14. BRO3886 commented on Mar 14, 2025

    @BRO3886

    https://github.com/BRO3886/mcp-memory-custom/

    Went ahead and modified the code a bit to power the following use-cases:

    • project specific memories
    • timestamp recording

    the example prompt I am using is attached in the README

    @jerome3o-anthropic please let me know if these changes can be pushed to the official repo, been working well for me across 3 different projects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions