How to set up the Memory MCP server in Claude
- Install Node.js 24 or newer. Replace the path with a file in a writable folder before using the command or JSON configuration.
- In Claude Code run the matching command. For Claude Desktop, merge the relevant JSON entry into your existing MCP configuration and restart the app.
- Confirm the server appears in /mcp in Claude Code or the tools menu in Claude Desktop, then try the small task below.
claude mcp add --env "MEMORY_FILE_PATH=/absolute/path/to/local-demo-memory.jsonl" --transport stdio memory -- npx -y @modelcontextprotocol/server-memoryclaude mcp add --env "MEMORY_FILE_PATH=/absolute/path/to/local-demo-memory.jsonl" --transport stdio memory -- cmd /c npx -y @modelcontextprotocol/server-memory{
"mcpServers": {
"memory": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-memory"
],
"env": {
"MEMORY_FILE_PATH": "/absolute/path/to/local-demo-memory.jsonl"
}
}
}
}{
"mcpServers": {
"memory": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"@modelcontextprotocol/server-memory"
],
"env": {
"MEMORY_FILE_PATH": "/absolute/path/to/local-demo-memory.jsonl"
}
}
}
}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.