Memory MCP server for Claude

Set up the Memory MCP reference server for Claude and choose where its local knowledge graph file persists between sessions.

How to set up the Memory MCP server in Claude

  1. Install Node.js 24 or newer. Replace the path with a file in a writable folder before using the command or JSON configuration.
  2. In Claude Code run the matching command. For Claude Desktop, merge the relevant JSON entry into your existing MCP configuration and restart the app.
  3. Confirm the server appears in /mcp in Claude Code or the tools menu in Claude Desktop, then try the small task below.
Claude Code · macOS and Linux
claude mcp add --env "MEMORY_FILE_PATH=/absolute/path/to/local-demo-memory.jsonl" --transport stdio memory -- npx -y @modelcontextprotocol/server-memory
Claude Code · Windows
claude mcp add --env "MEMORY_FILE_PATH=/absolute/path/to/local-demo-memory.jsonl" --transport stdio memory -- cmd /c npx -y @modelcontextprotocol/server-memory
Claude Desktop · macOS and Linux JSON
{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-memory"
      ],
      "env": {
        "MEMORY_FILE_PATH": "/absolute/path/to/local-demo-memory.jsonl"
      }
    }
  }
}
Download configuration
Claude Desktop · Windows JSON
{
  "mcpServers": {
    "memory": {
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "-y",
        "@modelcontextprotocol/server-memory"
      ],
      "env": {
        "MEMORY_FILE_PATH": "/absolute/path/to/local-demo-memory.jsonl"
      }
    }
  }
}
Download configuration

Verify that a test entity persists

Store a made-up project called Sample Garden with a single relationship to a test owner. Start a fresh Claude session using the same server configuration. Ask for the relationship, and check that the JSONL file you selected exists.

Check your configuration and results

Set `MEMORY_FILE_PATH` to an absolute path in a writable folder you own. A package-local file can be lost when an npm cache is cleared or the package is updated. Use separate files for tests and everyday use.

Claude Code MCP configuration reference

Browse MCP servers