Memory MCP Server
Published · Updated
At a glance
- Category
- AI & web search
- GitHub repository
- modelcontextprotocol/servers/tree/main/src/memory
- Watch out for
- The servers repository describes its reference servers as educational examples that demonstrate MCP features and SDK usage, not as production-ready solutions, so you are expected to review the security fit yourself.
The Memory server is the knowledge graph reference server from the modelcontextprotocol/servers repository, published on npm as @modelcontextprotocol/server-memory. Its README calls it a basic implementation of persistent memory, meant to let Claude remember information about a user across chats.
The model stores entities (a name, a type and a list of observations) and directed relations between them, written in active voice. Everything lives in a single local JSONL file. The server runs on Node.js 24 or later, talks stdio by default, and can serve Streamable HTTP on 127.0.0.1:3001/mcp with --transport streamable-http.
It has grown more careful about storage over time. Saves are atomic, writes from several client processes take turns through a lock file, and you can cap the graph with environment variables. The full graph is also exposed as the memory://knowledge-graph resource, with update notifications when it changes.
How it connects
Your AI app
An assistant or agent that supports MCP
Memory MCP Server
Runs as
- npx (Node.js)
- Docker
Gives the agent
- Create entities and relations
- Add and remove facts
- Delete graph parts
- Read the graph
- Search and open nodes
- Live resource
Memory
The data or system the tools act on
What it can do
- Create entities and relations
- create_entities adds named, typed nodes with observations, and create_relations links existing entities with a relationType.
- Add and remove facts
- add_observations appends strings to existing entities, and delete_observations removes specific ones.
- Delete graph parts
- delete_entities removes entities and cascades to their relations, while delete_relations removes only exact-match links.
- Read the graph
- read_graph returns everything, optionally filtered by entityTypes and trimmed with observationLimit for a cheap overview.
- Search and open nodes
- search_nodes matches a query against names, types and observations, and open_nodes fetches specific entities by name.
- Live resource
- The memory://knowledge-graph resource returns the graph as JSON and emits update notifications after each write.
Setting it up
For Claude Desktop, add a memory entry to claude_desktop_config.json with "command": "npx" and "args": ["-y", "@modelcontextprotocol/server-memory"]; on Windows use "command": "cmd" with "/c" in front of the npx arguments. Set MEMORY_FILE_PATH in env to an absolute path you own, such as ~/memory.jsonl, because the default file sits inside the npx cache and can be deleted on update. The directory must already exist. Optional MEMORY_MAX_ENTITIES, MEMORY_MAX_RELATIONS and MEMORY_MAX_FILE_BYTES cap the graph. A Docker form runs mcp/memory with a named volume (claude-memory:/app/dist). In VS Code with Copilot, edit ~/.copilot/mcp-config.json or the workspace-root .mcp.json and add the same npx command under mcpServers.
Where each client keeps its MCP config file, and the JSON it expects (cheat sheet)
Where it helps
- Keep a user's preferences, such as communication style or preferred language, as observations that persist between chats.
- Record people, organisations and projects as entities with works_at style relations, then query them with search_nodes.
- Get a cheap outline of a large graph with read_graph and observationLimit 0, then open_nodes for the entities that matter.
- Share one memory file between two MCP clients, relying on the lock file to serialise writes.
Limitations and things to watch
- The servers repository describes its reference servers as educational examples that demonstrate MCP features and SDK usage, not as production-ready solutions, so you are expected to review the security fit yourself.
- Every write reads and rewrites the whole file, so cost grows linearly with graph size, and nothing caps the graph unless you set the MEMORY_MAX_* variables.
- The lock depends on exclusive file creation, so the README says a network filesystem that does not honour it cannot be shared safely.
- The delete tools change stored memory with no undo, and how often the model writes memories depends on the system prompt you give it.
- The Docker setup mounts code and data in one volume, so upgrading the image needs a manual copy step described in the README.
Sources
Written from the project's own documentation, checked November 2026.
- github.com /modelcontextprotocol/servers/tree/main/src/memory
- raw.githubusercontent.com /modelcontextprotocol/servers/main/src/memory/README.md
- github.com /modelcontextprotocol/servers
How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.