Skip to content

Memory MCP ignores custom storage path setting #692

@Fionhurong

Description

@Fionhurong

I've been trying to configure the MCP memory server to store data in a custom location, but it continues to store the memory.json file in the NPX temporary directory instead.

Configuration

In my Claude desktop config file, I've specified a custom path:

"memory": {
  "command": "npx",
  "args": [
    "-y",
    "@modelcontextprotocol/server-memory"
  ],
  "env": {
    "MEMORY_FILE_PATH": "/Users/XX/Library/Application Support/Claude/mcp/memory.json"
  }
}

Actual Behavior

Despite setting the MEMORY_FILE_PATH environment variable, the memory.json file is still being created in the NPX temporary directory:

/Users/XX/.npm/_npx/15b07286cbcc3329/node_modules/@modelcontextprotocol/server-memory/dist/memory.json

Additional Information

  • I've created the target directory and ensured it has appropriate permissions
  • The memory functionality works correctly, but uses the wrong file location
  • Claude can read/write to the temporary file location, but this isn't persistent

Can someone help explain why the environment variable isn't being recognized, or if there's a different way to specify a custom storage location? This is concerning because NPX temporary directories may be cleaned up, potentially losing all memory data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions