Official Memory MCP setup

@modelcontextprotocol/server-memory npx setup guide

Install the official Memory MCP server with npx, add it to Claude Desktop or VS Code, set a reviewable MEMORY_FILE_PATH, and avoid unsafe local memory defaults.

Last reviewed on June 9, 2026 against the official Model Context Protocol servers repository and npm metadata.

Entities

Named nodes such as a person, team, project, product, or event. Each entity has a type and observations.

Relations

Directed links between entities, such as a project owned by a team or a user preferring a workflow.

Observations

Atomic facts attached to entities. Good observations are short, reviewable, and easy to remove later.

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.

Step 1

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.

Step 2

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.

Step 3

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.

Step 4

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.jsonl

Project memory file

Good when memory belongs to one repository and should be reviewed with that project.

/Users/you/projects/my-app/.mcp/memory.jsonl

Team-reviewed memory file

Good when a team needs a documented review loop before facts influence agent behavior.

/Users/you/team-memory/reviewed-memory.jsonl

Memory 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.

ServerUseBest whenMain risk
MemoryPersistent entities, relations, and observationsThe assistant needs durable context across chatsStale or sensitive facts can influence future work
FilesystemControlled local file operations inside allowed directoriesThe assistant needs to read or edit real filesBroad folder scope can expose private or unrelated files
EverythingReference server for protocol and client smoke testsYou are validating MCP client behaviorIt 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.

Frequently Asked Questions

What is @modelcontextprotocol/server-memory?

It is the official Model Context Protocol Memory reference server. It gives an MCP client persistent memory through a local knowledge graph made of entities, relations, and observations.

What is the exact npx command for Memory MCP?

The direct command is npx -y @modelcontextprotocol/server-memory. In normal use, you add that command to an MCP client configuration rather than running the server by itself.

Does @modelcontextprotocol/server-memory require an API key?

No official setup path for the local Memory reference server requires an API key. If another page claims an API key is required, verify that claim against the official repository before changing your config.

Where does Memory MCP store data?

The server stores memory in a local JSONL file. You can set MEMORY_FILE_PATH to choose a reviewable location for backup, portability, and privacy control.

How do I use Memory MCP on Windows?

If your desktop client cannot launch npx directly on Windows, set command to cmd and use args starting with /c, npx, -y, and @modelcontextprotocol/server-memory.

Should I use Memory MCP or Filesystem MCP?

Use Memory MCP when you want persistent facts, entities, and relationships. Use Filesystem MCP when the agent needs controlled access to real local files inside allowed directories.

Is Memory MCP safe for team use?

It can be safe in a reviewed pilot, but teams should set an explicit storage path, avoid secrets, review stale memory, and separate memory recall from permission to take actions.