
MCP Memory: What It Is and How to Give Any MCP Client Persistent Memory
MCP memory is a Model Context Protocol server pattern that gives an AI client a place to store and retrieve information that outlives the current conversation. Instead of re-explaining a project, a preference or a decision at the start of every session, the client calls a memory tool, and the server persists the fact in a file, a vector index or a knowledge graph. This guide is for engineers who already use at least one MCP client and want to understand how a memory MCP server works, what the reference knowledge graph server does and does not do, what "codebase memory MCP" means for coding agents, how the main servers compare, and how to run one locally.
What is MCP memory?
MCP memory is a server that speaks the Model Context Protocol and exposes memory operations as tools. A client such as Claude Code, Cursor or Claude Desktop discovers those tools through tools/list, and the model calls them to store facts (remember, add_memory, create_entities), find them again (recall, search_memories, search_nodes) and delete them (forget, delete_memory). Because the protocol is standard, the same memory server works with every MCP client, and the client does not need to know whether the backend is a JSON file, a vector database or a graph.
The phrase covers three things that often get mixed up:
- The protocol. MCP defines how a client and a server exchange JSON-RPC messages over a transport, how tools are described and how results come back. It says nothing about memory specifically.
- A memory server. Any MCP server whose tools happen to implement storage and retrieval. The reference implementation is
@modelcontextprotocol/server-memory; community and vendor servers includemcp-memory-service, Mem0 MCP, Zep's Context MCP Server and Cognee MCP. - The memory itself. The stored data and the model used to organize it: flat notes, embeddings, entities and relations, or a temporal knowledge graph. This is what decides recall quality, not the protocol.
A useful mental split is that MCP solves the plumbing problem (how does Claude Code call the store) and the memory server solves the memory problem (what gets stored, how it is retrieved, what happens when facts change). Most of the hard decisions live in the second half.
How does an MCP memory server work?
A memory MCP server is a normal MCP server. It runs as a process, declares a set of tools and optionally resources, and communicates with the client over one of the protocol's transports. The client's model decides when to call the tools, usually guided by a system prompt, a plugin skill or an agent rule that says when to save and when to search.
Tools, resources and the tool list
Tools are the primary surface. A memory server typically exposes a small write set, a read set and a delete set. The reference server has nine tools (create_entities, create_relations, add_observations, delete_entities, delete_observations, delete_relations, read_graph, search_nodes, open_nodes). Cognee MCP pins three (remember, recall, forget) in tools/list and keeps the rest discoverable through tool search. Mem0's hosted MCP server lists eleven. The size of this list matters more than it looks: every tool description is injected into the model's context on every session, so a memory server with thirty verbs competes with the application tools the agent actually needs.
Resources are a secondary surface. The reference server publishes the whole graph as a memory://knowledge-graph resource with MIME type application/json, and emits notifications/resources/updated when a mutation tool runs, so subscribed clients see changes live. Zep's Context MCP Server exposes a paginated zep://graphs/directory resource that lists the shared graphs a user may select. Resources are useful for bulk reads and for letting a client render memory in a UI; tools are what the model calls turn by turn.
Transports: stdio, Streamable HTTP and SSE
The MCP transport specification defines two standard transports. stdio runs the server as a child process of the client and exchanges messages over standard input and output. It is the simplest, keeps everything on the local machine, and is what npx -y @modelcontextprotocol/server-memory uses. Streamable HTTP runs the server as an independent process that accepts JSON-RPC over HTTP POST and can stream responses with Server-Sent Events; it supports session IDs through the Mcp-Session-Id header and is the transport for anything shared or remote. The older HTTP+SSE transport is deprecated in the specification but still widely supported for backwards compatibility; Cursor and Claude Code both accept it, and Claude Code tries HTTP first and falls back to SSE automatically from v2.1.265.
The practical rule: stdio for a single developer whose memory lives on one laptop; Streamable HTTP when two clients, two machines or two people need the same memory.
Client configuration
Every MCP client has a config file that maps a server name to either a command (stdio) or a URL (HTTP/SSE). Claude Desktop reads claude_desktop_config.json. Claude Code reads .mcp.json at project scope and ~/.claude.json at user and local scope, and is usually configured with claude mcp add (see the Claude Code MCP docs). Cursor reads .cursor/mcp.json in a project and ~/.cursor/mcp.json globally (see the Cursor MCP docs). Codex reads TOML from ~/.codex/config.toml. The mcpServers JSON shape is the same across Claude Desktop, Claude Code and Cursor, so a snippet written for one usually works in the others.
What is the reference knowledge graph memory MCP server?
@modelcontextprotocol/server-memory is the memory server shipped in the official modelcontextprotocol/servers repository. Its README describes it as "a basic implementation of persistent memory using a local knowledge graph," and that is an accurate summary. It stores three kinds of objects:
- Entities: nodes with a unique
name, anentityTypesuch aspersonororganization, and a list of observations. - Relations: directed edges between two entities with a
relationTypewritten in active voice (works_at,prefers). - Observations: atomic string facts attached to an entity, added and removed independently.
Everything is persisted to a single JSONL file, memory.jsonl in the server directory by default, overridable with the MEMORY_FILE_PATH environment variable. Retrieval is search_nodes, which matches a query string against entity names, entity types and observation text, plus open_nodes for exact names and read_graph for everything. There are no embeddings and no ranking beyond that match.
The canonical Claude Desktop configuration is:
Two details from the current README are worth knowing. First, the package requires Node.js 24 or later when run through npx. Second, since each MCP client starts its own server process, two clients pointed at the same MEMORY_FILE_PATH are two processes writing one file; the server now takes an exclusive <memory file>.lock around every write, refreshes it every 15 seconds, breaks stale locks after 30 seconds and fails a write that cannot acquire the lock within 60 seconds. That makes same-machine sharing between, say, Claude Desktop and Cursor safe on a local filesystem. It does not make the server a network service; there is no HTTP transport, no authentication and no multi-user model.
Where the reference server stops being enough
The reference server is deliberately minimal, and the limits follow from the design:
- Literal-match recall.
search_nodesfinds "PostgreSQL" but not "Postgres" or "the database we picked." Paraphrases and synonyms miss. - No notion of time. Observations are strings. "Prefers morning meetings" and "Prefers afternoon meetings" coexist until something deletes one.
- Flat schema. Entities, relations and observations are enough for personal facts, not for code structure, documents or evolving project state.
- Whole-graph reads.
read_graphreturns everything, which is fine at 200 entities and a context problem at 20,000. - Single machine. stdio only. Sharing across machines or teammates means syncing a file.
For a single person who wants Claude to remember their name, role and a few preferences, it works and costs nothing. For a coding agent that needs to remember a repository, it is the wrong shape.
Codebase memory MCP: giving coding agents memory of a repository
"Codebase memory MCP" is the fastest-growing part of this search space because it names a specific pain: Claude Code, Cursor and Codex forget a repository between sessions. Each new session re-reads files, re-discovers module boundaries, re-learns which patterns the team actually uses, and sometimes re-makes a decision the team already rejected. CLAUDE.md, .cursor/rules and AGENTS.md carry instructions forward, but they are hand-written, static and limited to what someone remembered to write down. A codebase memory MCP server is a memory server whose stored knowledge is about the code.
What codebase memory means
Codebase memory is persistent knowledge of a repository that survives sessions and is shared across the tools that work on it. In practice that is four layers:
- Structure: modules, symbols, call relationships, dependencies, entry points. Where does a request enter, which functions does it touch, what would break if a signature changed.
- Decisions: why the team chose a library, rejected a pattern, or left a workaround in place. These rarely live in code and are the first thing an agent gets wrong.
- Conventions: how errors are handled, how tests are organized, naming rules, what "done" means in this repo.
- Session history: what the agent did last time, what it learned, what was left open.
The reason to put this behind MCP rather than in a markdown file is reach. One memory server, written to by Claude Code during a refactor, read by Cursor the next morning and by Codex in CI, keeps a single view of the repository instead of three partial ones. The sibling guides on Claude Code memory, Cursor memory and Codex memory cover each client's native surface and where it stops.
Notes versus a code graph
There are two architectures for codebase memory, and the difference shows up the first time an agent asks a structural question.
A notes-based server stores text: "The auth module uses JWT with a 15-minute expiry," "Tests live under tests/ and use pytest fixtures." Retrieval is embedding similarity. It is easy to build, works with any memory server in the comparison below, and is good for decisions and conventions. It is weak for structure, because a note about a function is not the function; when the code changes, the note is stale and nothing knows.
A code-graph server indexes the repository itself. Files become nodes, symbols become nodes, imports and calls become edges, and the graph is rebuilt or diffed when the code changes. Retrieval can then answer "who calls parse_config" or "what depends on this module" deterministically, without an LLM, and the agent can combine that with notes about why things are the way they are. Cognee's code_search tool is one implementation of this; it runs operations such as impact_analysis, find_path, architecture and delta against an indexed code dataset. mcp-memory-service takes a middle path, extracting @mentions, #tags, URLs and file paths from stored memories into an entity graph.
What to look for in a codebase memory MCP
- Does it index code or only store notes about code? Ask whether it can answer a caller/callee question without guessing.
- How does it handle change? A repository moves daily. Look for incremental re-indexing or a delta operation, not a full rebuild.
- Is memory scoped per project? A fact about repo A should not surface in repo B. Dataset or project scoping, and per-client defaults, matter here.
- Can several clients share it? The whole point is that Claude Code and Cursor see the same repository memory.
- Does it run locally? Code is sensitive. Local indexing and local embeddings avoid sending the repository to a third party.
- What does it cost at repo scale? Indexing a large monorepo through an LLM-based pipeline is not free; check whether structural indexing is LLM-free.
Memory MCP server comparison
The table compares the five servers that show up most often when people search for a memory MCP server. Each row was checked against the project's README or official documentation in October 2026; where the documentation does not state something, the cell says so.
| Server | Storage model | Retrieval | Temporal / supersession | Local-first? | Multi-client sharing | License / pricing | Best for |
|---|---|---|---|---|---|---|---|
@modelcontextprotocol/server-memory (MCP project) | Entities, relations, observations in one local JSONL file (MEMORY_FILE_PATH) | search_nodes string match on names, types, observation text; open_nodes; read_graph | Not documented; observations are plain strings, deleted explicitly | Yes, stdio only, Node 24+ | Same-machine processes can share one file via lock file; no network transport or auth | MIT; free | Personal facts for one user on one machine |
mcp-memory-service (doobidoo) | SQLite with local ONNX embeddings by default; Cloudflare, Hybrid and Milvus backends; knowledge graph with typed edges | Semantic + BM25 keyword search, tag filters, natural-language time ranges, ranked mode | Heuristic contradiction detection can mark older memories superseded; scheduled consolidation and controlled forgetting | Yes; binds to 127.0.0.1 by default | REST API + MCP over HTTP; Remote MCP with OAuth 2.0; X-Agent-ID scoping; SSE events | Apache 2.0; free self-hosted | Self-hosters who want a dashboard, REST API and many clients on one service |
| Mem0 MCP (Mem0) | Hosted on Mem0 Platform at https://mcp.mem0.ai/mcp; memories live in the Mem0 account | search_memories semantic search with filters; get_memories with structured filters | update_memory and list_events exist; supersession behavior is not documented on the MCP page | No; the docs state nothing runs on your machine. The open-source Mem0 library is Apache 2.0 and self-hostable, but the documented MCP path is hosted | Any client over HTTPS with browser sign-in or API key; npx mcp-add writes config for several clients | Platform account required; Hobby free (10,000 add / 1,000 retrieval requests per month), Starter $19/mo, Pro $249/mo, according to Mem0's pricing page | Zero-ops personal memory across many clients |
| Zep Context MCP Server (Zep) | Zep managed cloud or BYOC; per-user graph plus optional shared Context Graphs | search_graph with scopes (observations, thread_summaries, episodes, nodes, edges); get_subgraph, get_node_neighbors | Backed by Zep's temporal context graph; supersession controls are not exposed as MCP tool parameters in the docs | No (https://api.getzep.com/mcp); the separate open-source Graphiti MCP server runs locally on FalkorDB or Neo4j and is marked experimental | Claude, ChatGPT, Claude Code, Codex, Cursor via SSO (Google Workspace or OIDC) and OAuth 2.1 | Per-account MCP seats: Free 1 seat, Flex $125/mo 5 seats, Flex Plus $375/mo 15 seats, according to Zep's pricing page | Enterprises that want identity-gated, per-user memory |
| Cognee MCP (Topoteretes) | Knowledge graph + vector index; SQLite, LanceDB and embedded Kuzu by default; Neo4j, Postgres/pgvector, FalkorDB options | recall auto-routes across session cache and permanent graph, hybrid graph + vector; code_search for indexed repositories | Temporal mode keeps superseded facts with validity windows | Yes: direct mode with local databases over stdio, HTTP or SSE; Docker image cognee/cognee-mcp | API mode shares one graph across clients; per-client datasets by default (COGNEE_MCP_AGENT_SCOPED) | Apache 2.0; Cloud free tier 1M tokens, then $1 per 1M tokens processed | Graph-structured project and codebase memory shared across IDEs |
A few observations from the table. Only two of the five are fully local by default: the reference server and mcp-memory-service, with Cognee MCP local in direct mode and Graphiti as Zep's local option. Only two document supersession of contradicting facts. And the pricing axis is not comparable: the reference server is free, two are open source with optional cloud, and two are hosted products where the MCP server is a feature of a paid platform. For a longer feature-by-feature treatment of hosted options see the Mem0 vs Zep vs Letta vs Cognee comparison.
How to run a local MCP memory server
A fully local setup means the memory server, its storage and ideally its embeddings all run on your machine, and nothing about your projects leaves it. Below are two paths: the reference server for personal facts, and a Docker graph-and-vector server for project and codebase memory. The config snippets are for Claude Desktop, Claude Code and Cursor; each is taken from the client's own documentation.
Option A: the reference knowledge graph server over stdio
Claude Desktop, in claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):
Claude Code, from a terminal (the -- separates Claude's options from the server command):
Cursor, in .cursor/mcp.json at the project root or ~/.cursor/mcp.json globally:
Pointing all three at the same MEMORY_FILE_PATH gives you one shared JSONL graph on the machine, protected by the lock file described above. Restart each client after editing its config.
Option B: a local graph-and-vector server in Docker
For project or codebase memory you want embeddings and a graph. The example below uses the cognee/cognee-mcp image because it is the one this site's authors maintain; mcp-memory-service (pip install mcp-memory-service, then memory server --http) is a comparable self-hosted alternative with its own dashboard on port 8000.
Create a .env with your LLM key, pull the image and start it with the Streamable HTTP transport:
The MCP endpoint is http://localhost:8000/mcp. Register it with Claude Code at project scope so the binding ships with the repository:
Cursor, in .cursor/mcp.json:
Claude Desktop does not take an HTTP URL in claude_desktop_config.json the way Cursor does; the simplest route is to run the same server with TRANSPORT_MODE=stdio and configure it with "command": "docker" and the run arguments, or to add it as a custom connector through Settings. Both the HTTP and SSE transports validate Host and Origin headers against DNS rebinding, so reaching the container by LAN IP returns 421 Misdirected Request until you allow the host with MCP_ALLOWED_HOSTS="192.168.1.50:*".
Running without a cloud LLM
Local storage is only half of "local." The reference server needs no LLM at all. Graph-based servers use a model to extract entities and relations and an embedding model to index them, which by default means an API call. Both mcp-memory-service and Cognee MCP document local alternatives: mcp-memory-service runs embeddings through ONNX on the local machine and accepts any OpenAI-compatible endpoint including Ollama for quality scoring; Cognee MCP has ollama and huggingface dependency groups and reads the provider from .env. Expect slower ingestion and lower extraction quality from small local models; the trade is worth it for private repositories and not worth it for a personal preferences file.
What are the common failure modes of MCP memory?
Memory servers fail in predictable ways, and most of the failures are about the memory model rather than the protocol.
Stale facts. The most common complaint. A fact was true in March, the code changed in April, and the memory server still returns the March version with the same confidence. Notes-based servers have no way to know. Mitigations: timestamps on every write, a retrieval layer that prefers recent facts, and for code, an index that is rebuilt from the repository rather than described by hand.
Duplicates and near-duplicates. The agent saves "we use pytest" on Monday and "tests are written with pytest" on Wednesday. Embedding search returns both, the context fills with redundancy, and nothing consolidates them. Servers that handle this do it with deduplication at write time (Mem0's update_memory, mcp-memory-service's consolidation runs, Cognee's improve step), not at read time.
No temporal handling. Related to stale facts but worse: contradictory facts coexist. "The API key lives in .env" and "the API key lives in the secrets manager" are both retrieved and the model picks one. A server that treats time as data can supersede the old fact while keeping it for history; a server that stores strings cannot.
Context bloat. Two sources. First, the tool list itself: every advertised tool costs tokens on every turn, which is why Cognee MCP pins three tools by default and Zep ships a plugin skill rather than more tools. Second, recall results: read_graph on a large reference-server file, or a top_k=50 semantic search, can push thousands of tokens into context for one question. Cap results, return summaries first, and expose "read more" as a separate call.
Isolated state per client. A memory written from Claude Desktop that Cursor cannot see. Over stdio this is the default, because each client launches its own server process and, unless they share a file or a database, its own store. The fix is an HTTP server with one backend, or at minimum one shared file path.
Authentication and host checks. Moving from stdio to HTTP introduces auth. Hosted servers use OAuth (Mem0 and Zep both do browser sign-in with API-key fallback); self-hosted servers either run on localhost with no auth or need a token. A frequent surprise is DNS-rebinding protection returning 421 or 403 when a server is reached by a hostname it does not recognize. The companion piece on why the Cognee CLI replaced MCP OAuth for the Claude Code plugin goes into the auth trade-offs in detail.
Literal-match recall. Covered above for the reference server, but it also affects any server where the query is embedded and the stored text uses different vocabulary. Hybrid retrieval (embeddings plus keyword plus graph neighborhood) is the standard answer, and mcp-memory-service, Zep and Cognee all implement some form of it.
How to choose an MCP memory server
The right choice depends on what you are remembering and who needs to read it. The criteria below are vendor-neutral; the comparison table above fills them in for five servers.
- What is the unit of memory? Personal preferences fit entities and observations. Project knowledge needs documents, decisions and their relationships. Code needs symbols and edges. Pick a storage model that matches the unit, because retrofitting a graph onto a notes store is harder than the reverse.
- How does retrieval work? Exact match, embeddings, graph traversal, or a hybrid. Test with a paraphrased question and with a "what depends on X" question; the two expose different weaknesses.
- What happens when a fact changes? Ask whether the server can supersede, not just add and delete. This single question separates the servers that survive six months of use from the ones that fill with contradictions.
- Where does the data live? Local file, local database, your cloud, the vendor's cloud. For code, prefer local or BYOC.
- Which clients share it? stdio means one client per process. If Claude Code, Cursor and a CI agent all need the same memory, you need HTTP and a shared backend.
- How large is the tool list? Count the tools advertised in
tools/listand multiply by the number of sessions per day. - What does it cost at your volume? Per-request (Mem0), per-episode credit (Zep), per-token processed (Cognee Cloud) or free self-hosted. Model a month of real usage; the shape of the pricing matters more than the headline number.
- Is it maintained?
mcp-memory-servicestates it is maintained by one person. The reference server is maintained by the MCP project. Vendor servers follow the vendor's roadmap. None of these is wrong, but they are different risks.
For most individual developers, the honest answer is: start with the reference server for personal facts and add a graph-based local server once you want the agent to remember a repository. For teams, start with the shared-backend question and work backwards. Best MCP memory servers for AI coding assistants goes deeper on the coding-agent case.
How Cognee implements MCP memory
Cognee is an open-source AI memory engine, Apache 2.0, with about 32.5k stars on GitHub. Its MCP server, cognee-mcp, exposes the memory engine to any MCP client and is documented in the Cognee MCP memory server guide.
Tools. The server pins three tools in tools/list: remember, recall and forget. remember stores text or an uploaded file (up to 10 MB) as permanent graph memory, or as a fast session-cache entry when a session_id is passed; remember(background=True) returns immediately and cognify_status reports progress. recall searches the session cache first, then the permanent graph, and prefixes every response with a one-line summary such as 3 memories found (2 from sessions, 1 from project docs), with machine-readable count and state in _meta. forget deletes a dataset, a single item by data_id, or everything the user owns. Operational tools (cognify, search, prune, improve, code_search) remain callable by name and discoverable through search_tools, so the advertised list stays at three. COGNEE_MCP_TOOL_MODE=all restores the full listing.
Storage and retrieval. Memory is a knowledge graph plus a vector index. Out of the box it runs on SQLite, LanceDB and the embedded Kuzu graph store; Neo4j, Postgres with pgvector, FalkorDB and a single-Postgres deployment are supported backends. recall routes over both indexes, so paraphrased questions resolve through embeddings and structural questions resolve through graph edges. Temporal mode keeps superseded facts with validity windows instead of overwriting them, and dataset-level permissions (read, write, delete, share) govern who sees what.
Codebase memory. code_search runs deterministic queries against an indexed repository with no LLM call: query_facts, explore, traverse, find_path, impact_analysis, insights, architecture and delta, plus navigation operations such as neighbors, subgraph, hubs and ask. This is the code-graph architecture described in the codebase memory section, and it is what lets a coding agent answer "what breaks if I change this signature" from memory rather than from a fresh grep.
Transports and modes. stdio (default), SSE and Streamable HTTP. Direct mode runs the whole pipeline locally. API mode points the MCP server at a running Cognee API so several clients share one graph; cloud mode points it at Cognee Cloud with COGNEE_SERVICE_URL and COGNEE_API_KEY. The Docker image is cognee/cognee-mcp, with TRANSPORT_MODE selecting the transport and EXTRAS=postgres,neo4j,ollama installing optional backends at start.
Client scoping. By default each client gets its own dataset (claude_code_memory, cursor_vscode_memory), so two agents do not share memory by accident; COGNEE_MCP_AGENT_SCOPED=false makes every client write to main_dataset. At the storage layer, ENABLE_BACKEND_ACCESS_CONTROL=true gives each dataset its own Kuzu and LanceDB files.
Claude Code plugin. For Claude Code specifically, the plugin bundles the MCP server with the hooks and skills that decide when to save and recall:
The same server also works with Cursor, Claude Desktop, Codex, Cline and Continue, and the engine has integrations for the Claude Agent SDK, OpenAI Agents SDK, LangGraph, Google ADK, CrewAI and others. A Mem0Source adapter imports existing Mem0 memories. Cognee Cloud's free tier includes 1M tokens and one workspace; Standard is $1.00 per 1M tokens processed plus $5 per additional workspace; self-hosting is free; Enterprise is BYOC (see pricing).
Next steps
If you have never run a memory MCP server, start with the reference server over stdio; it takes two minutes and teaches the tool-calling loop. When you want a coding agent to remember a repository rather than a person, move to a graph-based server with local storage and point Claude Code and Cursor at the same endpoint. The Cognee MCP server is one way to do that: docker run -e TRANSPORT_MODE=http --env-file ./.env -p 8000:8000 cognee/cognee-mcp:main, then claude mcp add --transport http cognee http://localhost:8000/mcp. For a broader view of the memory problem across assistants, see Claude memory, Claude Code memory, Cursor memory, Codex memory, Hermes Agent memory, OpenClaw memory and AI agent memory. Codebase memory covers the code-graph tools in more depth, and building self-improving skills for agents shows memory feeding back into the skills an agent runs. The server itself is documented in the MCP overview, MCP tools reference, quickstart and local setup pages, with per-client guides for Cursor, Claude Code, Codex, Cline, Continue and Claude Desktop.
FAQ
What is MCP memory?
MCP memory is a Model Context Protocol server that exposes memory operations as tools, typically remember, recall, search and forget, so an MCP client such as Claude Code, Cursor or Claude Desktop can store information and retrieve it in later sessions. MCP standardizes how the client calls the server; the server decides how memory is stored, whether as a JSON file, a vector index or a knowledge graph. The same memory server works with every MCP client, which is what makes it useful for sharing context across tools.
What is the best memory MCP server?
There is no single best memory MCP server; it depends on what you store and who reads it. For personal facts on one machine, the reference @modelcontextprotocol/server-memory is free and sufficient. For self-hosted memory with a dashboard and REST API, mcp-memory-service is a strong open-source option. For hosted, zero-ops memory, Mem0 MCP and Zep's Context MCP Server are paid platforms with different pricing shapes. For graph-structured project and codebase memory that runs locally and is shared across IDEs, Cognee MCP fits. Judge by storage model, retrieval quality, supersession, locality, multi-client sharing and cost.
What is a codebase memory MCP?
A codebase memory MCP is a memory MCP server whose stored knowledge is about a repository: its structure (modules, symbols, call and dependency edges), the decisions behind it, its conventions and what the agent did in past sessions. It lets Claude Code, Cursor and Codex start a session already knowing the repo instead of re-reading it. Notes-based servers store text about the code and retrieve it by similarity; code-graph servers index the code itself so structural questions such as "who calls this function" are answered deterministically. Cognee's code_search tool is an example of the latter.
Can I run an MCP memory server locally?
Yes. The reference server runs over stdio with npx -y @modelcontextprotocol/server-memory and writes a local JSONL file; it needs no cloud service at all. mcp-memory-service runs on SQLite with local ONNX embeddings and binds to localhost by default. Cognee MCP runs in direct mode with local SQLite, LanceDB and Kuzu, as a Python process or the cognee/cognee-mcp Docker image. Graph-based servers still call an LLM for extraction and embeddings unless you configure a local provider such as Ollama, which both of the latter support.
Does MCP memory work with Cursor and Claude Code at the same time?
Yes, if the two clients share a backend. Over stdio each client launches its own server process, so they only share memory when both point at the same store; the reference server supports this on one machine through a lock-protected shared MEMORY_FILE_PATH. The more robust approach is one server over Streamable HTTP, registered in Claude Code with claude mcp add --transport http <name> <url> and in Cursor with a url entry in .cursor/mcp.json. Cognee MCP's API mode and mcp-memory-service's HTTP mode both work this way.
Is the MCP memory server from Anthropic free?
Yes. @modelcontextprotocol/server-memory is published by the Model Context Protocol project, which Anthropic originally created and later donated to the Agentic AI Foundation under the Linux Foundation. The memory server is MIT-licensed, installed with npx, and stores data in a local JSONL file, so there is no account or subscription. The costs are indirect: it requires Node.js 24 or later, offers only string-match search with no embeddings, and runs over stdio only, so sharing across machines or teammates is up to you.
How does Cognee's MCP memory compare to Mem0 and Zep?
Mem0 MCP is a hosted server at mcp.mem0.ai that stores memories in a Mem0 Platform account and retrieves them by semantic search; its Hobby tier is free with request limits, according to Mem0. Zep's Context MCP Server is also hosted, gated by your identity provider, backed by a temporal context graph and sold per MCP seat, according to Zep. Cognee MCP is open source under Apache 2.0, runs locally or in API mode, combines a knowledge graph with a vector index, keeps superseded facts with validity windows, and adds a code-graph tool for repositories. Cognee Cloud is priced per million tokens processed.
Related reading


Cognee is the fastest way to start building reliable Al agent memory.




