Large Language ModelsGenerate imagesGenerate videos
Best Memory MCP Server for Claude Code in 2027: 5 Picks Compared
Claude Code starts every session with a blank slate, and a memory MCP server fixes that. This comparison ranks five options, from a one-line official server to a temporal graph, with install commands, trade-offs and the mistakes that waste context.
Every Claude Code session starts with a blank head. You spent an hour yesterday explaining why the billing service retries with idempotency tokens, and today Claude asks the same question again. A memory MCP server fixes that by giving Claude a place to write facts down and look them up later.
The short answer: Basic Memory is the best memory MCP server for Claude Code for most developers, the official Memory server is the fastest way to try the idea, and Mem0, Graphiti and claude-mem win in narrower cases. This comparison draws on each project's own documentation and repositories, checked in October 2026, and it spells out the trade-offs so you can pick one without installing all five.
💡 How this ranking was built: It comes from documented behavior (storage format, tools, setup steps, license), not from a benchmark run. Check the current version of any project before you standardize a team on it.
Why Claude Code Forgets Everything
Each Claude Code session begins with a fresh context window. Whatever Claude worked out yesterday, the architecture, the odd test setup, your habit of writing small commits, is gone unless something carries it across. That is not a bug. It is how a context window works, and the fix has to live outside the model.
What Built-In Memory Already Does
Claude Code ships with two mechanisms. CLAUDE.md files hold instructions you write: build commands, naming rules, architecture notes. Auto memory holds notes Claude writes itself from your corrections and preferences. Both load at the start of every conversation, and auto memory loads only its first 200 lines or 25KB.
Anthropic's documentation is clear that Claude treats both as context, not enforced configuration. If a rule must never be broken, a PreToolUse hook is the right tool, not a longer CLAUDE.md.
Where Built-In Memory Runs Out
For a small project, built-in memory is enough. It starts to hurt when the work grows:
Nothing is searchable. Claude reads the loaded lines from the top. It cannot query a decision from three weeks ago.
The size limit bites. Anything beyond the first 200 lines or 25KB of auto memory is not loaded at session start.
Scope is per repository. Facts about you, or about three related services, need extra files and extra discipline.
Relationships are invisible. "The checkout service calls the ledger service" is a sentence, not a link Claude can follow.
A memory MCP server adds tools Claude can call mid-session to store, search and update facts. That one change turns memory from a file you load into a database you query.
What Makes a Memory Server Good
Star counts and launch posts do not tell you whether a server will still be useful in March. Three practical criteria do.
Storage You Can Inspect
Sooner or later Claude stores something wrong. If the memory lives in Markdown, JSONL or SQLite, you open it and fix the line. If it sits behind an API you cannot browse, you are limited to whatever delete tools the server exposes.
Retrieval That Costs Few Tokens
Claude Code prints a warning when an MCP tool returns more than 10,000 tokens and caps output at 25,000 by default, a limit you can raise with MAX_MCP_OUTPUT_TOKENS. A server that dumps its whole graph on every call burns context fast. Prefer servers with search-first tools that return snippets instead of the entire store.
Setup and Upkeep Burden
Docker, a graph database, credentials for an LLM provider, a background worker: each one is another thing that can break on a Tuesday. The best memory server is the one you are still running in six months, so weigh upkeep as heavily as features.
Criterion
Why it matters
What to look for
Storage format
You will edit wrong facts
Markdown, JSONL or SQLite you can open
Retrieval
Every call spends tokens
Search tools that return snippets
Setup effort
Time to the first useful memory
One command beats Docker plus a database
Data location
Privacy of project details
Local disk or a hosted account, chosen on purpose
License
Company policy and sharing
Read it, especially for AGPL projects
The 5 Best Options, Ranked
Basic Memory: Markdown You Own
Basic Memory stores what Claude records as plain Markdown files on your disk. Each note holds observations (facts with category tags) and relations (wiki-style links to other notes), and together they form a graph Claude can traverse. Because the notes are ordinary files, any text editor opens them and a Git repository tracks every change.
The main tools are write_note, read_note, edit_note, search_notes and build_context, which follows memory:// links outward from a note to gather related context.
claude mcp add basic-memory -- uvx basic-memory mcp
The project's README also lists bm install claude-code, which registers a plugin through Claude Code's marketplace.
Strengths: human-readable storage, easy diffs and reviews, works with any MCP client.
Trade-offs: AGPL-3.0 license, which some companies restrict, and it needs Python tooling (uvx).
Verdict: the best overall pick, because you can always see and correct what Claude believes.
Official Memory Server: Zero Setup
@modelcontextprotocol/server-memory comes from the Model Context Protocol project itself. It keeps a local knowledge graph of entities, relations and observations, and exposes nine tools: create_entities, create_relations, add_observations, delete_entities, delete_observations, delete_relations, read_graph, search_nodes and open_nodes.
Installation is one line, with one habit worth adding. Point MEMORY_FILE_PATH at a separate file for each project, or every project writes into the same graph.
Its own README calls it a basic implementation of persistent memory, and that is fair. Use search_nodes and open_nodes for lookups, because read_graph returns the whole graph and gets expensive as it grows.
Strengths: nothing to sign up for, nothing to host, a file you can read.
Trade-offs: minimal tooling, and the structure depends on how well Claude names entities.
Verdict: the best first experiment, and a perfectly good long-term store for small projects.
Mem0: Hosted and Hands-Off
Mem0 runs a hosted MCP server at https://mcp.mem0.ai/mcp. The first time your agent calls one of its tools, the client opens a browser window and asks you to authorize your Mem0 account. There is no Docker, no database and no local file to manage.
The server exposes eleven operations, including add_memory, search_memories, get_memories, update_memory and delete_memory, plus entity and event tools for users, agents and runs.
claude mcp add --transport http mem0 https://mcp.mem0.ai/mcp
Mem0's documentation also shows an npx mcp-add one-liner for Claude Code if you prefer it.
Strengths: zero infrastructure, memory that follows you across machines, semantic search.
Trade-offs: project facts live in a third-party account, so check the terms before saving anything under an NDA.
Self-hosted option: a community project named mem0-mcp-selfhosted runs against Qdrant, Neo4j and Ollama. Mem0 does not maintain it, so read its repository before you rely on it.
Graphiti: Memory That Tracks Time
Graphiti, from Zep, builds temporally aware knowledge graphs. Facts carry time, so "we used Postgres" and "we moved to Cloud SQL in March" can both exist without one overwriting the other. That matters when your project history is full of decisions that were later replaced.
Its MCP server needs Python 3.10 or newer and Docker. It defaults to FalkorDB bundled in a single container, with Neo4j 5.26 or newer recommended for production. It also calls an LLM to extract entities from what you store: OpenAI is the default, and Anthropic, Gemini, Groq, Azure OpenAI and Ollama are supported.
The server listens on http://localhost:8000/mcp/ and offers tools such as add_memory, search_nodes, search_memory_facts and get_episodes.
docker compose up
claude mcp add --transport http graphiti-memory http://localhost:8000/mcp/
Strengths: answers "what was true then?", handles facts that change, scales to large histories.
Trade-offs: the heaviest setup in this list, and every stored episode spends LLM calls.
Verdict: worth it for architecture decisions, contracts and customer settings that change over time. Overkill for a side project.
claude-mem: Automatic Capture
claude-mem is a plugin rather than a plain MCP server, and that is its edge. Lifecycle hooks (SessionStart, UserPromptSubmit, PostToolUse, Stop and SessionEnd) watch what Claude does. A local worker compresses those observations into SQLite with full-text search, and a Chroma vector store adds semantic search. Relevant context is injected when the next session starts, so Claude never has to decide to remember. Search tools (search, timeline and get_observations) are exposed over MCP for deeper lookups.
Strengths: zero habit change, a local web viewer, Apache 2.0 license, and <private> tags to exclude sensitive content.
Trade-offs: compression runs in the background, and the README does not say which model does it, so watch your usage. Automatic capture also records more than you would choose by hand.
Verdict: the right choice if you keep forgetting to tell Claude to remember.
Side-by-Side Comparison
Here is how the five options line up on the criteria that matter day to day.
Option
Storage
Setup effort
Data location
Best for
Basic Memory
Markdown files
One command with uvx
Local disk
Most developers
Official Memory server
JSONL graph
One npx command
Local disk
A fast first trial
Mem0 hosted
Mem0 cloud
URL plus browser sign-in
Mem0 account
No-infrastructure setups
Graphiti MCP
FalkorDB or Neo4j graph
Docker plus LLM credentials
Your machine or server
Facts that change over time
claude-mem
SQLite plus Chroma
Plugin install
Local disk
Automatic capture
Which one fits your situation:
You want memory you can read and edit: Basic Memory.
You want to test the idea in a minute: the official Memory server.
You do not want to run anything: Mem0 hosted.
Your facts change and history matters: Graphiti.
You forget to ask Claude to remember: claude-mem.
💡 Combine carefully: Mem0 and Graphiti both expose an add_memory tool. Run two such servers together and Claude has to guess where each fact belongs. Pick one primary store and keep CLAUDE.md for rules.
How to Install Each One
Claude Code adds servers with claude mcp add. For stdio servers, the double dash (--) separates Claude's options from the server command, and everything after it passes through untouched. Three scopes decide where a server loads:
Scope
Loads in
Shared with team
Stored in
Local (default)
Current project only
No
~/.claude.json
Project
Current project only
Yes, through version control
.mcp.json
User
All your projects
No
~/.claude.json
Use user scope for personal preferences you want everywhere. Use project scope for conventions the whole team should recall, and keep credentials out of a committed .mcp.json.
Stdio Servers: Basic and Official
Add --scope user to either command if you want the server available in every project.
# Basic Memory, available in every project
claude mcp add --scope user basic-memory -- uvx basic-memory mcp
# Official Memory server, one file per project
claude mcp add --env MEMORY_FILE_PATH=/home/you/shop/memory.jsonl --transport stdio memory -- npx -y @modelcontextprotocol/server-memory
HTTP Servers: Mem0 and Graphiti
HTTP servers use --transport http and a URL. Mem0 asks you to sign in through the browser on first use. Graphiti needs its container running before Claude connects.
# Mem0 hosted
claude mcp add --transport http mem0 https://mcp.mem0.ai/mcp
# Graphiti on localhost
claude mcp add --transport http graphiti-memory http://localhost:8000/mcp/
The Plugin Route: claude-mem
Run the two /plugin commands from the claude-mem section inside a session. After any install, run claude mcp list or type /mcp in a session to confirm the server connected. If a server shows as failed, run its command by hand in a terminal. A missing uvx, npx or Docker install is a common cause.
Mistakes That Waste Your Context
Storing everything. Memory is for decisions, conventions and gotchas, not transcripts. A graph full of "ran the tests" notes makes real facts harder to find and every search more expensive.
Sharing one memory across projects. The official server writes to a single file unless MEMORY_FILE_PATH says otherwise, so the shop's facts leak into the blog's session.
Skipping the instruction. A server only helps when Claude calls it. Without a rule in CLAUDE.md, Claude may never search.
Saving secrets. Tokens, passwords and customer data do not belong in memory. Local files are readable by anything on the machine, and hosted memory leaves the machine entirely.
Trusting memory blindly. A note records what was true when it was written. Ask Claude to verify a remembered file path or flag before acting on it.
A Setup That Works in Practice
Layer the Tools
Give each layer one job:
CLAUDE.md holds short rules and the commands you run every day.
One memory MCP server holds facts that grow over time: decisions, gotchas, who owns what.
Hooks enforce anything that must never be skipped, because memory is context and not enforcement.
Add a few lines to CLAUDE.md so Claude actually uses the server:
## Memory
- At the start of a task, search memory for the project name and the files involved.
- After a decision, store it with the reason and today's date.
- Never store credentials, tokens or customer data.
Review Once a Week
Open the store, delete the wrong notes and merge duplicates. With Basic Memory that is a text editor and a Git diff. With a JSONL file it is a search and a careful edit. Start with one server, and add a second only when you can name the gap the first one leaves.
Try PicassoIA for Your Own Visuals
Memory servers make Claude a better teammate. PicassoIA handles the visuals that ship with your work: article headers, product shots, documentation images and short clips, all generated from a text prompt.
PicassoIA also hosts the Claude family for chat and code review. Try Claude Sonnet 5 for coding tasks, Claude Fable 5 for complex coding work, or Claude Opus 4.7 when you want long reasoning, all straight from the browser.
If you build with agents, PicassoIA exposes image and video generation through a Replicate-style API at api.picassoia.com/v1 and through an MCP connection. The models available there are PicassoIA Image, PicassoIA Image Editor Pro, PicassoIA Video and Seedance 2.5 Lite, with up to five predictions running at once per account. Check the API page for current plan requirements before you wire it in.
Ready to make your own images? Open the PicassoIA model library, pick a model, and generate your first image today. Write one prompt, change one detail, and compare the results. It is the same habit that makes a memory server worth running: small, repeatable steps that add up.