---
title: "Memory MCP Server: Knowledge Graph Memory for Claude"
url: "https://mcpshelf.co/servers/memory"
description: "The reference Memory MCP server keeps a local knowledge graph of people, projects and facts so Claude remembers them across chats. npx config and settings."
updated: "2026-11-24"
site: "MCP Shelf"
---

# Memory MCP Server

> A local knowledge graph the assistant writes to, so it remembers you between chats.

Source: https://mcpshelf.co/servers/memory  
Markdown: https://mcpshelf.co/servers/memory.md  
Generated: 2026-11-24T21:04:31.120Z

## Facts

- **Name:** Memory MCP Server
- **Tagline:** A local knowledge graph the assistant writes to, so it remembers you between chats.
- **Description:** Memory MCP Server is the Model Context Protocol project's reference memory server: it stores people, projects and facts as a local knowledge graph so an assistant can remember them across chats.
- **Repository:** https://github.com/modelcontextprotocol/servers
- **Package:** @modelcontextprotocol/server-memory 2.2.1 (npm)
- **Install:** `claude mcp add memory -e MEMORY_FILE_PATH=/path/to/custom/memory.jsonl -- npx -y @modelcontextprotocol/server-memory`
- **Transport:** stdio (local)
- **Auth:** No required keys or settings listed
- **Tools exposed:** 9: `create_entities`, `create_relations`, `add_observations`, `delete_entities`, `delete_observations`, `delete_relations`, `read_graph`, `search_nodes`, `open_nodes`
- **Category:** Agent helpers and desktop control (https://mcpshelf.co/categories/agents-and-automation)
- **Stats:** 92.2K GitHub stars, last commit 24 Nov 2026, 0 upvotes on MCP Shelf
- **Install check:** Started in our test
- **Listed:** 2026-11-24
- **Page updated:** 2026-11-24

## Full description

### What is Memory MCP Server?

**Memory MCP Server is the Model Context Protocol project's reference memory server: it stores people, projects and facts as a local knowledge graph so an assistant can remember them across chats.**

Memory is the reference memory server from the Model Context Protocol project. It stores what the assistant learns as a small knowledge graph: entities such as a person or a project, the relations between them, and short facts called observations. The assistant can add, search and delete any of it, so the next chat can start from what the last one learned.

The graph is one JSON Lines file on your own machine, nothing goes to a service, and several clients can share the file safely. Set MEMORY_FILE_PATH to a path you own, because the default sits inside the npm cache, and add a system prompt that tells the model when to read and update its memory.

|  |  |
| --- | --- |
| Made by | Model Context Protocol project (modelcontextprotocol/servers) |
| GitHub | https://github.com/modelcontextprotocol/servers |
| Licence | Apache-2.0 and MIT |
| npm package | [@modelcontextprotocol/server-memory](https://www.npmjs.com/package/@modelcontextprotocol/server-memory) 2.2.1 (18 Nov 2026) |
| GitHub stars | 92.2K |
| Last commit | 24 Nov 2026 |
| Tools | 9 |
| Runs on | Your computer |
| Install check | Started in our test |
| Category | [Agent helpers and desktop control](https://mcpshelf.co/categories/agents-and-automation) |
| Works with | Claude Code, Cursor, Claude Desktop, VS Code, Codex, Windsurf |
| Setup checked | 24 Nov 2026 |
| Page updated | 24 Nov 2026 |

**Our check:** We ran this exact config on 24 Nov 2026: it started and answered with 9 tools.

#### Try asking Memory MCP Server

- "Remember that I prefer TypeScript and that my main project is called Atlas."
- "What do you remember about my Atlas project?"
- "Forget everything you stored about my old job."

#### MCP Shelf take

> We started Memory on our own test machine on 24 Nov 2026 and it answered with 9 tools. 3 of the 9 only read; the other 6 can change things. Every tool comes with a useful description, all of them say whether they change things, and the tool list costs about 400 tokens of context before you ask a thing. It is the most-starred of the 6 servers in its category on our shelf (92.2K stars).

— MCP Shelf tests (numbers from our own runs), tested on 24 Nov 2026

### What tools does Memory MCP Server have?

We listed 9 tools on 24 Nov 2026. 3 only read; the rest can change things or run commands.

| Tool | Kind | What it is for |
| --- | --- | --- |
| `create_entities` | changes | Adds new entities, each with a name, a type such as person or project, and facts. Names that already exist are skipped. |
| `create_relations` | changes | Links two entities with a relation in active voice, such as works_at. |
| `add_observations` | changes | Adds new facts to entities that already exist. |
| `delete_entities` | changes | Removes entities with all their facts and every relation that touches them. |
| `delete_observations` | changes | Removes particular facts from an entity. |
| `delete_relations` | changes | Removes particular links, keeping the entities. |
| `read_graph` | reads | Returns the whole graph, optionally only some entity types, or names and counts only for a cheap overview. |
| `search_nodes` | reads | Finds entities whose name, type or facts match a query, with their relations. |
| `open_nodes` | reads | Returns named entities and the relations between them. |

#### How clearly it describes its tools

9 of 9 tools have a description and 9 of 9 say whether they change things. The tool list takes at least ~400 tokens of context. Every tool says whether it only reads or can change things, so a client can ask before the risky ones.

### How do I install Memory MCP Server?

#### Install steps from the Memory MCP Server README

Copied from the project's [README on GitHub](https://github.com/modelcontextprotocol/servers/tree/HEAD/src/memory#readme) on 24 Nov 2026 under its Apache-2.0 and MIT licence.

##### Usage with Claude Desktop

###### Setup

Add this to your claude_desktop_config.json:

###### Docker

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

###### NPX

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

On Windows, use `cmd /c` to launch `npx`:

```
{
  "mcpServers": {
    "memory": {
      "command": "cmd",
      "args": ["/c", "npx", "-y", "@modelcontextprotocol/server-memory"]
    }
  }
}
```

###### NPX with custom setting

The server can be configured using the following environment variables:

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

On Windows, use:

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

- `MEMORY_FILE_PATH`: Path to the memory storage JSONL file (default: `memory.jsonl` in the server directory). A leading `~` expands to your home directory; a relative path resolves against the server directory. Set it to an absolute path you own; see Choosing where the graph is stored.
- `MEMORY_MAX_ENTITIES`: The most entities the graph may hold. Unset by default (no limit).
- `MEMORY_MAX_RELATIONS`: The most relations the graph may hold. Unset by default (no limit).
- `MEMORY_MAX_FILE_BYTES`: The most bytes the memory file may hold. Unset by default (no limit).

The three limits are opt-in, and each is described under Limiting how large the graph grows. A variable that is set must hold a positive whole number; any other value, an empty one included, stops the server at startup with an error naming the variable.

When `MEMORY_FILE_PATH` is not set and the server directory still holds a legacy `memory.json` but no `memory.jsonl`, the server renames `memory.json` to `memory.jsonl` at startup. If that rename fails, the server exits with an error naming both paths and the cause, rather than starting on an empty graph; fix the cause (a permission problem, say) and restart, or set `MEMORY_FILE_PATH` to choose a file explicitly.

###### Choosing where the graph is stored

**Set `MEMORY_FILE_PATH` to an absolute path you own**, such as `~/memory.jsonl`, as in the configuration above. The default `memory.jsonl` sits in the server's own directory, next to its code. Under `npx` or an npm install, that directory is inside a `node_modules` tree, which npm manages as its own: reinstalling or updating the server, or clearing the npx cache, can delete the file and the knowledge graph in it. A relative `MEMORY_FILE_PATH` resolves against that same directory, so it has the same problem.

- When the memory file it resolves is inside a `node_modules` directory, the server prints a warning on stderr at startup naming the file; most clients show a server's stderr in its log. Move the file to the new path when you set the variable, or the server starts on an empty graph.
- The directory must already exist: the server creates the memory file, not the directories above it.
- The default stays where it is so that existing graphs keep loading. The Docker setup above keeps it in a named volume mounted over `/app/dist`, so the graph there survives restarts and draws no warning.

Saves are atomic. Every write tool writes the whole graph to a temporary file in the same directory and renames it over the memory file, so a server stopped or killed mid-save leaves the previous graph intact rather than a half-written file. The file's permission bits are kept across the rename. Writes from several processes are serialized by a lock, described next.

###### Sharing one memory file between clients

Each MCP client starts its own server process, so two clients using the same `MEMORY_FILE_PATH` (or both using the default) are two processes writing one file. Every write tool takes an exclusive lock file, `.lock`, next to the memory file while it reads, changes and saves the graph, so writes from different processes take turns and none is lost. The lock file exists only while a write is in progress, so the directory holding the memory file must be writable (it already must be, for the atomic save).

- A server stopped mid-write by `SIGINT` or `SIGTERM` (Ctrl-C, `docker stop`, a client shutting it down), or exiting normally, removes the lock it holds before it exits, so the next writer does not wait on it.
- A lock left behind by a server that crashed mid-write is removed automatically: at once if its process is known to have exited on the same machine, otherwise once it has gone 30 seconds without being refreshed (a server holding the lock refreshes it every 15 seconds while it works). Only one waiting server breaks a stale lock at a time, guarded by a momentary `.lock.break` file. It never deletes the lock where it stands: it renames it aside to a momentary `.lock..stale` file, checks that what it took is the very file it judged stale, and only then deletes it. A live lock that replaced the stale one in between is put straight back, untouched, and the breaker goes on waiting.
- A write that cannot get the lock within 60 seconds fails with a tool error rather than overwriting the file.
- The lock relies on exclusive file creation, which local filesystems provide; a network filesystem that does not honour it cannot be shared safely this way.

###### Limiting how large the graph grows

Every write tool reads the whole memory file, changes the graph and writes the whole file back, holding the lock throughout. Its cost, and how long other servers sharing the file wait for the lock, therefore grow linearly with the file, however small the change: adding one entity to a graph of 100,000 entities rewrites the whole file, about 24 MB at around 240 bytes per entity, in roughly 0.4 seconds on a laptop (#5525). The read tools load the whole file too. Size a shared file with that in mind.

By default nothing caps the graph. Set `MEMORY_MAX_ENTITIES`, `MEMORY_MAX_RELATIONS` or `MEMORY_MAX_FILE_BYTES` to put a ceiling on it:

- `create_entities`, `create_relations` and `add_observations` refuse a call that would leave the graph over a limit, with a tool error naming the variable. The whole call is refused and nothing is saved, not just the part past the limit.
- A call that adds nothing new (every entity or relation already exists, say) is still answered, even when the graph is at or over a limit.
- The delete tools are never refused, so a graph over a limit (one that grew before the limit was set, or lowered) can always be shrunk. While it is over, calls that would grow it further on that dimension are refused.
- `MEMORY_MAX_FILE_BYTES` counts the bytes of the file as it would be saved, unreadable lines included, so it bounds the cost of each write directly. The counts are easier to reason about but do not bound how long each entity's observations grow.

#### What you need first

- Node.js 24 or newer (or Docker)
- Nothing else: no account or key

#### Claude Code

Where: Your terminal, in the project folder

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

#### Cursor

Where: ~/.cursor/mcp.json, or .cursor/mcp.json in a project

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

#### Claude Desktop

Where: claude_desktop_config.json (Settings → Developer → Edit Config)

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

#### VS Code

Where: .vscode/mcp.json in your project

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

#### Codex

Where: ~/.codex/config.toml, shared by the Codex CLI, IDE extension and ChatGPT desktop app

```
[mcp_servers.memory]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-memory"]

[mcp_servers.memory.env]
MEMORY_FILE_PATH = "/path/to/custom/memory.jsonl"
```

Or run: `codex mcp add memory --env MEMORY_FILE_PATH=/path/to/custom/memory.jsonl -- npx -y @modelcontextprotocol/server-memory`

#### Windsurf

Where: ~/.codeium/windsurf/mcp_config.json

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

#### ChatGPT

Where: Not supported

ChatGPT on the web only connects to servers by URL. This one runs on your computer: the ChatGPT desktop app can start it from its MCP servers settings, with the same config as the Codex tab.

Point MEMORY_FILE_PATH at a file in a folder that exists, such as your home folder. MEMORY_MAX_ENTITIES, MEMORY_MAX_RELATIONS and MEMORY_MAX_FILE_BYTES cap how large the graph can grow.

Checked against the project's own install docs on 24 Nov 2026: https://github.com/modelcontextprotocol/servers/tree/main/src/memory#readme, https://www.npmjs.com/package/@modelcontextprotocol/server-memory

### How do I configure Memory MCP Server?

| Setting | Kind | Required | What it does |
| --- | --- | --- | --- |
| `MEMORY_FILE_PATH` | env | no | Where the graph is saved, as a JSON Lines file. A leading ~ means your home folder. Set it: the default sits next to the package, inside the npm cache. Example: `/path/to/custom/memory.jsonl` |
| `MEMORY_MAX_ENTITIES` | env | no | The most entities the graph may hold. Calls that would go over are refused whole. |
| `MEMORY_MAX_RELATIONS` | env | no | The most relations the graph may hold. |
| `MEMORY_MAX_FILE_BYTES` | env | no | The largest the memory file may grow, which also bounds how slow each save gets. |
| `--transport streamable-http` | flag | no | Starts a local streamable HTTP endpoint on 127.0.0.1:3001/mcp, so clients connect by URL rather than over stdio. |

### What can Memory MCP Server read and change?

**It can read**

- Its own memory file and nothing else
- The graph is also offered as the resource memory://knowledge-graph

**It can change**

- Adds and deletes entities, relations and facts in the memory file
- Creates the memory file, and a short-lived lock file beside it while saving

**Safer setup:** Keep the file somewhere you back up, and set the MEMORY_MAX_ variables so a runaway agent cannot grow the graph without limit. Delete tools are never blocked, so you can always shrink it.

### Good for

- Keeping your preferences, projects and contacts known across chats
- Giving an agent a running record of decisions on a long project
- Trying out agent memory without an account or a database

### Memory MCP Server not working? Common fixes

**Memories vanish after an update**
Without MEMORY_FILE_PATH the file lives inside the npm cache, which can be replaced. Set MEMORY_FILE_PATH to a file in your home folder and move the old memory.jsonl there.

**It fails to start after you set MEMORY_FILE_PATH**
The folder must already exist; the server creates the file, not the folders. A MEMORY_MAX_ variable that is empty or not a whole number also stops it at startup.

**The assistant never uses its memory**
The server only stores what the model sends it. Add instructions, for example in a Claude project or system prompt, telling the model to search its memory at the start of a chat and save new facts as it learns them.

**A write fails waiting for a lock**
Another client is saving to the same file. Locks left by a crashed server clear by themselves after 30 seconds; on a network drive that does not support exclusive file creation, give each client its own file.

### What are the alternatives to Memory MCP Server?

| Server | What it does | Tools | Runs on | Licence | Stars |
| --- | --- | --- | --- | --- | --- |
| [Memory MCP Server](https://mcpshelf.co/servers/memory) | A local knowledge graph the assistant writes to, so it remembers you between chats. | 9 | Your computer | Apache-2.0 and MIT | 92.2K |
| [Notion](https://mcpshelf.co/servers/notion) | Notion's own server: search, read and update pages and databases. | 24 | Hosted or your computer | MIT | 4.7K |
| [Obsidian MCP](https://mcpshelf.co/servers/obsidian) | Search, read and edit the notes in your Obsidian vault. | 15 | Your computer | MIT | 4.5K |
| [MCP Atlassian (Jira and Confluence)](https://mcpshelf.co/servers/atlassian) | Jira issues and Confluence pages, Cloud or self-hosted. | 98 | Your computer | MIT | 6.1K |
| [Airtable MCP Server](https://mcpshelf.co/servers/airtable) | Read schemas, search and edit records, and comment in your Airtable bases. | 15 | Your computer | MIT | 456 |
| [Basic Memory](https://mcpshelf.co/servers/basic-memory) | Long-term memory as plain Markdown files you own. | 27 | Your computer | AGPL-3.0-or-later | 4.4K |

### Memory MCP Server FAQ

#### Is the Memory MCP Server official?

Yes. It is a reference server from the Model Context Protocol project, in the modelcontextprotocol/servers repository, published on npm as @modelcontextprotocol/server-memory and on Docker Hub as mcp/memory.

#### Where does the Memory MCP Server store its data?

In one JSON Lines file on your computer. Set MEMORY_FILE_PATH to choose where; otherwise it goes next to the package, inside the npm cache, which is easy to lose. Nothing is sent to a service.

#### How does the Memory server decide what to remember?

It does not decide anything. The model chooses what to save through the tools, so give it instructions: search memory at the start of a chat, and save facts about you, your projects and your preferences as they come up.

#### Can two apps share the same memory?

Yes. Point both at the same MEMORY_FILE_PATH. Each save takes a lock file, so two servers do not overwrite each other, as long as the file is on a local disk.

#### How is it different from Basic Memory?

This server keeps a graph of entities, relations and short facts in one file. Basic Memory writes Markdown notes you can open and edit yourself, for example in Obsidian.

#### How do I add the Memory MCP Server to Claude Desktop?

In claude_desktop_config.json, add an entry named memory with the command npx, the args -y and @modelcontextprotocol/server-memory, and MEMORY_FILE_PATH in env, then restart Claude Desktop.

#### How do I add the Memory MCP Server to Cursor?

Add an entry named memory to ~/.cursor/mcp.json with npx, the args -y and @modelcontextprotocol/server-memory, and MEMORY_FILE_PATH set in env to a file you own.

#### Can I use the Memory MCP Server in VS Code?

Yes, with GitHub Copilot in Agent mode. Add a server named memory running npx -y @modelcontextprotocol/server-memory under servers in .vscode/mcp.json or your user MCP configuration.

#### Does the Memory MCP Server work with Codex?

Yes. Run codex mcp add memory --env MEMORY_FILE_PATH=~/memory.jsonl -- npx -y @modelcontextprotocol/server-memory, or add an [mcp_servers.memory] table to ~/.codex/config.toml.

Full docs on GitHub: https://github.com/modelcontextprotocol/servers

## Notes for agents

Fetch these instead of parsing the HTML page:

- llms.txt: https://mcpshelf.co/llms.txt
- llms-full.txt: https://mcpshelf.co/llms-full.txt
- ai.txt: https://mcpshelf.co/ai.txt
- Full catalog (.md): https://mcpshelf.co/catalog.md
- API spec: https://mcpshelf.co/openapi.json
- MCP server: https://mcpshelf.co/mcp
- MCP manifest: https://mcpshelf.co/.well-known/mcp.json
- Developer docs: https://mcpshelf.co/developers

MCP endpoint (Streamable HTTP, no key): https://mcpshelf.co/mcp. REST API: https://mcpshelf.co/api/v1.

