What Is @modelcontextprotocol/server-memory?
@modelcontextprotocol/server-memory is the official Memory reference server from the Model Context Protocol servers repository. It gives an MCP client persistent memory by storing entities, relations, and observations in a local knowledge graph. The point is not to read your whole filesystem or call a remote database. The point is to let an assistant retrieve stable facts across sessions.
The search query @modelcontextprotocol/server-memory npx is therefore a setup query. The user needs the correct package name, a working client JSON shape, a Windows-safe command wrapper, and a memory file location that can be reviewed later. A broad memory architecture article is useful, but it should not replace the direct install answer.
How to Calculate the Right Memory MCP Setup
The setup decision has four parts: package, client, operating system, and storage path. The package should stay exactly @modelcontextprotocol/server-memory. The client decides whether the outer JSON key is mcpServers or servers. Windows may require cmd /c. The storage path decides whether the memory file is easy to back up, review, or isolate by project.
Verify the package and source
Confirm the package name is exactly @modelcontextprotocol/server-memory and that the source points back to the official modelcontextprotocol/servers repository.
Choose a memory file location
Set MEMORY_FILE_PATH when you care about backup, review, or portability. Avoid hidden defaults if a team will depend on the memory later.
Add the client config
Use Claude Desktop or VS Code config syntax. On Windows, use the cmd /c wrapper when the desktop client cannot launch npx directly.
Restart and inspect tools
After restart, confirm memory tools such as read_graph, search_nodes, open_nodes, create_entities, and add_observations are visible.
Claude Desktop config
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
}
}
}Use this when the client can launch npx directly.
Windows Claude Desktop config
{
"mcpServers": {
"memory": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@modelcontextprotocol/server-memory"]
}
}
}Use this wrapper when a Windows desktop client needs cmd to launch npx reliably.
VS Code MCP config
{
"servers": {
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
}
}
}Use this shape for VS Code style MCP server configuration.
Custom MEMORY_FILE_PATH config
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"],
"env": {
"MEMORY_FILE_PATH": "/Users/you/mcp-memory/project-memory.jsonl"
}
}
}
}Use an explicit JSONL path when backup, portability, or review matters.
Choose a Safe Memory File Location
The memory file is the durable record. A hidden default can be fine for a quick personal test, but it is weak for a team workflow because no one knows where the data lives, when to back it up, or how to review old facts. Use MEMORY_FILE_PATH when the memory should survive reinstalls, travel with a project, or enter a review process.
Personal memory file
Good when one person wants durable preferences and project context across chats.
/Users/you/mcp-memory/personal.jsonlProject memory file
Good when memory belongs to one repository and should be reviewed with that project.
/Users/you/projects/my-app/.mcp/memory.jsonlTeam-reviewed memory file
Good when a team needs a documented review loop before facts influence agent behavior.
/Users/you/team-memory/reviewed-memory.jsonlMemory vs Filesystem vs Everything
These official reference-server queries can look similar in search data, but the user jobs are different. Keep the pages separate and connect them with decision links instead of folding every package into one generic MCP article.
| Server | Use | Best when | Main risk |
|---|---|---|---|
| Memory | Persistent entities, relations, and observations | The assistant needs durable context across chats | Stale or sensitive facts can influence future work |
| Filesystem | Controlled local file operations inside allowed directories | The assistant needs to read or edit real files | Broad folder scope can expose private or unrelated files |
| Everything | Reference server for protocol and client smoke tests | You are validating MCP client behavior | It is not a workflow-specific production integration |
Worked Examples
Personal coding assistant memory
Use a personal JSONL path, store stable preferences and project names, and avoid sensitive credentials. After restart, ask the client what memory tools are available and create one test entity with a harmless observation.
Project-specific memory
Use a memory file under a project-owned folder when facts should apply only to that repository. Review the file before sharing the workspace, and keep personal context in a different memory file.
Team pilot memory
Start with a reviewed team file, define who may add observations, and schedule cleanup. Treat memory as context, not permission. A remembered deployment rule still needs the normal approval path.
Common Errors and Fixes
The client does not show memory tools.
Likely cause: The config was not saved in the right client file, or the client was not fully restarted.
Fix: Save the config, quit the client completely, reopen it, and inspect the MCP tools list again.
npx works in a terminal but not in the desktop app.
Likely cause: The app has a different PATH, or Windows needs cmd /c to launch npx.
Fix: Use the Windows wrapper on Windows, or provide the full npx path if your client requires it.
Memory appears in an unexpected location.
Likely cause: MEMORY_FILE_PATH was not set, so the server used its default storage path.
Fix: Set MEMORY_FILE_PATH to a stable JSONL path, restart the client, and document where the file lives.
The assistant remembers a wrong fact.
Likely cause: An old observation remains in the graph, or a broad prompt saved a low-quality memory.
Fix: Use search_nodes or open_nodes to inspect the entity, then remove or replace the bad observation.