MCP.so
Sign In

Memory MCP Server (Knowledge Graph)

@modelcontextprotocol

Basic information

Category

Memory & Knowledge

License

NOASSERTION

Transports

stdio

Author

modelcontextprotocol

About Memory MCP Server

Model Context Protocol Servers

Before you connect

Documentation reviewed 2026-10-25

When to choose this server

This reference server stores entities, observations and relations in a knowledge graph. Choose it for explicit facts and connections rather than a Markdown notebook or document-search system.

Setup and limitations

Set MEMORY_FILE_PATH to a deliberate persistent location. Different clients must use the same intended file to share memory. Start with a disposable entity, retrieve it in a new session, then remove it. The reference implementation is not a managed cloud memory account.

These notes check the linked documentation, not a live authenticated connection. Suggested checks are steps for you to run.

Memory MCP Server config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "memory": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "-v",
        "claude-memory:/app/dist",
        "--rm",
        "mcp/memory"
      ]
    }
  }
}

Memory MCP Server tools

9

Create multiple new entities in the knowledge graph

Create multiple new relations between entities

Add new observations to existing entities

Remove entities and their relations

Remove specific observations from entities

Remove specific relations from the graph

Read the entire knowledge graph

Search for nodes based on query

Retrieve specific nodes by name

Overview

What is Memory MCP Server (Knowledge Graph)?

Memory MCP Server (Knowledge Graph) is the reference MCP memory server from the Model Context Protocol project: it gives Claude and other clients persistent memory by storing entities, relations and observations in a local knowledge graph file, so facts carry over between chats.

It ships on npm as @modelcontextprotocol/server-memory and on Docker as mcp/memory, from the official modelcontextprotocol/servers repository (MIT License). It runs locally over stdio, with no API key and no external database.

How to use Memory MCP Server (Knowledge Graph)?

Prerequisites: Node.js (for npx) or Docker. No account or API key is required.

The only setting is the optional MEMORY_FILE_PATH environment variable, the path to the JSONL file that stores the graph. If it is not set, the server writes memory.jsonl in its own server directory.

Claude Desktop

Add this to claude_desktop_config.json:

{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-memory"],
      "env": {
        "MEMORY_FILE_PATH": "/path/to/custom/memory.jsonl"
      }
    }
  }
}

To use Docker instead, with the graph kept in a named volume:

{
  "mcpServers": {
    "memory": {
      "command": "docker",
      "args": ["run", "-i", "-v", "claude-memory:/app/dist", "--rm", "mcp/memory"]
    }
  }
}

On Windows, launch npx through cmd: set "command": "cmd" and "args": ["/c", "npx", "-y", "@modelcontextprotocol/server-memory"].

Claude Code

Register the same npx command with the Claude Code CLI:

claude mcp add memory -e MEMORY_FILE_PATH=/path/to/custom/memory.jsonl -- npx -y @modelcontextprotocol/server-memory

Cursor

Cursor reads the same mcpServers JSON shown for Claude Desktop. Put it in ~/.cursor/mcp.json (global) or .cursor/mcp.json (per project).

VS Code

The README offers one-click install buttons for VS Code and VS Code Insiders. To add it by hand, run MCP: Open User Configuration from the Command Palette, or create .vscode/mcp.json in your workspace. Note that VS Code uses a servers key:

{
  "servers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-memory"]
    }
  }
}

Tell the model when to remember

The server only stores what the model decides to write. The README includes an example system prompt for chat personalization. It tells the model to start each chat by retrieving its "memory", to watch for identity, behaviors, preferences, goals and relationships, and to save them as entities, relations and observations. Put a prompt like that in your project or custom instructions. It decides how often memories are created and what kind.

Key features of Memory MCP Server (Knowledge Graph)

  • Local knowledge graph: data stays in a plain JSONL file on your machine. There is no cloud service and no database.
  • Three-part data model: entities (a name, a type and observations), directed relations stored in active voice (for example works_at), and atomic observations, one fact each.
  • Full CRUD toolset: nine tools create, read, search and delete entities, relations and observations.
  • Readable MCP resource: the whole graph is exposed at memory://knowledge-graph (application/json). Write tools send notifications/resources/updated, so subscribed clients see changes live.
  • Configurable storage path: set MEMORY_FILE_PATH to keep the graph wherever you like.
  • Safe sharing between clients: every write takes an exclusive <memory file>.lock, so several client processes can share one file without losing writes. Stale locks are cleaned up automatically.

Memory MCP Server (Knowledge Graph) tools

The tools fall into three groups:

  • Write: create_entities adds new nodes and skips names that already exist. create_relations links two existing entities and skips duplicates. add_observations appends facts to an existing entity.
  • Delete: delete_entities removes entities and, in cascade, their relations. delete_observations and delete_relations remove specific items. None of the three fails on a missing target; each reports what was found or deleted.
  • Read: read_graph returns the full graph. search_nodes matches a query against entity names, types and observation text. open_nodes fetches specific entities by name, along with the relations between them.

Use cases of Memory MCP Server (Knowledge Graph)

  • Chat personalization: keep a user's name, role, location and communication style across sessions. "Remember that I prefer short answers and work in Berlin."
  • Preferences and habits: record recurring interests and working habits so you don't have to repeat them. "Note that I review pull requests every morning."
  • Goals tracking: store personal or team goals and check them later. "What goals have I told you about this quarter?"
  • Relationship context: map people and organizations as entities and relations. "John_Smith works_at Anthropic and reports to Jane."
  • Project knowledge for coding agents: in Claude Code or Cursor, save decisions and conventions as observations. "Remember that this repo uses pnpm and Drizzle ORM."

Memory MCP Server (Knowledge Graph) vs alternatives

As an MCP memory option, it is deliberately basic: a JSONL graph, text search over names, types and observations, and no embeddings. That keeps it easy to inspect and back up. Among related servers, the Filesystem MCP Server lets a model read and write ordinary files, and the Obsidian MCP Server uses an Obsidian vault as long-term notes. Choose those if you want memory as human-readable documents instead of a graph. Community forks of the memory MCP server add features such as per-project files or timestamps.

Troubleshooting Memory MCP Server (Knowledge Graph)

  • npx fails to start on Windows: launch it through cmd /c npx -y @modelcontextprotocol/server-memory, as the README shows.
  • Memories seem to disappear or are hard to find: by default the file is memory.jsonl in the server directory. Set MEMORY_FILE_PATH to an absolute path you know, so every client uses the same file.
  • The model never saves anything: the server is passive. Add a system prompt or custom instructions telling the model when to retrieve and update memory.
  • Write tool times out with a lock error: a write that can't get the lock within 60 seconds fails instead of overwriting the file. Keep the memory file in a writable folder on a local disk, not a network filesystem.
  • Upgrading the Docker image: an older mcp/memory volume contains an index.js file that the new container could overwrite. Delete that file from the old volume before starting the new container.

Frequently asked questions

1

Is the Memory MCP server official?

Yes. It is one of the reference servers in the official `modelcontextprotocol/servers` repository. It is published as `@modelcontextprotocol/server-memory` on npm and `mcp/memory` on Docker.

2

Is it free, and does it need an API key?

It is free and open source under the MIT License. It needs no API key or account, because everything runs locally.

3

Where does this MCP memory server store data?

In a JSONL file: `memory.jsonl` in the server directory by default, or any path you set with `MEMORY_FILE_PATH`. The Docker config keeps it in the `claude-memory` volume.

4

Does it work with Claude Code, Cursor and VS Code?

Yes. It is a standard stdio MCP server, so any MCP client can launch it with the npx or Docker command. VS Code uses a `servers` key instead of `mcpServers`.

5

Is it a remote or a local server?

Local. It runs as a process started by your MCP client over stdio. Your data does not leave your machine through the server.

6

Can two clients share the same knowledge graph memory MCP file?

Yes. Point both at the same `MEMORY_FILE_PATH`. Each write takes an exclusive lock file, so writes from different processes take turns. This relies on a local filesystem.

7

Does it use embeddings or vector search?

No. `search_nodes` matches the query against entity names, entity types and observation content. It does not do semantic search.

8

What are the security considerations?

The model can create and delete anything in the graph, and the data is stored as plain text. Don't let it record secrets, and protect or back up the JSONL file like any other personal data.

Comments

More Memory & Knowledge MCP servers