Skip to content
MCP Shelf

Memory MCP Server

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

View on GitHub
  • Started in our test
  • ★ 92.2K GitHub stars
  • Last commit 24 Nov 2026

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.

Tools
9
Runs on
Your computer
Licence
Apache-2.0 and MIT
GitHub stars
92.2K

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

You'll need

  • Node.js 24 or newer (or Docker)
  • Nothing else: no account or key
Works withClaude CodeCursorClaude DesktopVS CodeCodexWindsurfEach has a ready-made config on the Install tab, built from the README.

Started in our testWe ran this exact config on 24 Nov 2026: it started and answered with 9 tools.

Try asking Memory MCP Server

Once it is installed, ask your assistant things like:

  • 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, not the README · tested on 24 Nov 2026

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.

Memory MCP Server in more detail

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)
Latest version
2.2.1 (18 Nov 2026)
Last commit
24 Nov 2026
Setup checked
24 Nov 2026
Page updated
24 Nov 2026

What's in the pod

What tools does Memory MCP Server have?

We found 9 tools when we started it on 24 Nov 2026. 3 only read. The rest can change things, so keep your app's "ask before each tool call" setting on for them.

Changes things6 tools · Can create, edit, send or delete.

ToolWhat it is for
add_observationsAdds new facts to entities that already exist.
create_entitiesAdds new entities, each with a name, a type such as person or project, and facts. Names that already exist are skipped.
create_relationsLinks two entities with a relation in active voice, such as works_at.
delete_entitiesRemoves entities with all their facts and every relation that touches them.
delete_observationsRemoves particular facts from an entity.
delete_relationsRemoves particular links, keeping the entities.

Only reads3 tools · Looks things up and changes nothing.

ToolWhat it is for
open_nodesReturns named entities and the relations between them.
read_graphReturns the whole graph, optionally only some entity types, or names and counts only for a cheap overview.
search_nodesFinds entities whose name, type or facts match a query, with their relations.

Grouped and described by us. The README on GitHub lists the inputs each tool takes.

How clearly it describes its tools to your assistant

Tools with a description
9 of 9
Say if they change things
9 of 9
Context it takes, at least
~400 tokens

Every tool says whether it only reads or can change things, so a client can ask before the risky ones.

From the tool list it sent us. The token figure counts names, descriptions and input names; the full schemas your client loads add more.

How do I install Memory MCP Server?

Quick install

Pick your app and paste this in. It follows the README's own install steps below.

Where it goes: Your terminal, in the project folder

Claude Code
claude mcp add memory -e MEMORY_FILE_PATH=/path/to/custom/memory.jsonl -- npx -y @modelcontextprotocol/server-memory
Codex, Windsurf, ChatGPT and more →

Install steps from the Memory MCP Server README

The project's own instructions, copied from its README on GitHub on 24 Nov 2026 under its Apache-2.0 and MIT licence. They are the source of truth; the ready-made configs further down are built from them. The full README is on GitHub.

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, <memory 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 <memory file>.lock.break file. It never deletes the lock where it stands: it renames it aside to a momentary <memory file>.lock.<random>.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

Add Memory MCP Server to your app

Pick your app for a ready-to-paste snippet and where it goes, built from the steps above.

Where it goes: Your terminal, in the project folder

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

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: github.com/modelcontextprotocol/servers/tree/main/src/memory, www.npmjs.com/package/@modelcontextprotocol/server-memory.

Did this work for you?

Projects change their install steps often. If Memory MCP Server did not install, or something here no longer matches the project, tell us and we will check it against the README and fix the page.

New to this? See the setup guides for Claude Code, Cursor, Claude Desktop, VS Code, Codex and ChatGPT. If it will not start, test it in MCP Inspector and look up the error in Fixing MCP server errors.

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.

How do I configure Memory MCP Server?

Names are exactly as the project spells them. Required ones are marked.

SettingWhat it does
MEMORY_FILE_PATHEnvironment variableWhere 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./path/to/custom/memory.jsonl
MEMORY_MAX_ENTITIESEnvironment variableThe most entities the graph may hold. Calls that would go over are refused whole.
MEMORY_MAX_RELATIONSEnvironment variableThe most relations the graph may hold.
MEMORY_MAX_FILE_BYTESEnvironment variableThe largest the memory file may grow, which also bounds how slow each save gets.
--transport streamable-httpCommand line flagStarts a local streamable HTTP endpoint on 127.0.0.1:3001/mcp, so clients connect by URL rather than over stdio.

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.

Two peas, one chat

Chat with AI about Memory

Opens a chat primed with Memory’s README and setup docs from this page, or add it in Cursor to use its tools.

The Cursor button opens Cursor and asks before it adds the server. Fill in any keys it needs in Cursor’s MCP settings.

Peas in a pod

What are the alternatives to Memory MCP Server?

How Memory MCP Server lines up against its neighbours on the shelf. See every agent helpers and desktop control server.

  • Memory MCP ServerThis pea

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

    Tools
    9
    Runs on
    Your computer
    Licence
    Apache-2.0 and MIT
    Stars
    92.2K
  • Notion

    Notion's own server: search, read and update pages and databases.

    Tools
    24
    Runs on
    Hosted or your computer
    Licence
    MIT
    Stars
    4.7K
  • Obsidian MCP

    Search, read and edit the notes in your Obsidian vault.

    Tools
    15
    Runs on
    Your computer
    Licence
    MIT
    Stars
    4.5K
  • MCP Atlassian (Jira and Confluence)

    Jira issues and Confluence pages, Cloud or self-hosted.

    Tools
    98
    Runs on
    Your computer
    Licence
    MIT
    Stars
    6.1K
  • Airtable MCP Server

    Read schemas, search and edit records, and comment in your Airtable bases.

    Tools
    15
    Runs on
    Your computer
    Licence
    MIT
    Stars
    456
  • Basic Memory

    Long-term memory as plain Markdown files you own.

    Tools
    27
    Runs on
    Your computer
    Licence
    AGPL-3.0-or-later
    Stars
    4.4K
Full docs on GitHubmodelcontextprotocol/servers

Something wrong on this page? Tell us.

For bots & AI agents

Machine-readable versions of Memory MCP Server and MCP Shelf. Fetch these instead of parsing this page.

This listing (.md)llms.txtllms-full.txtai.txtFull catalog (.md)API specMCP serverMCP manifestDeveloper docs