COMPARE · COMPARISON: AGENT MEMORY

Best MCP memory servers for Claude Code in 2026: 8 compared, with install lines

AUTHOR · XERJ documentation team · REVIEWED BY · XERJ engineering team · PUBLISHED · 2026-11-15 · UPDATED · 2026-11-15
SHORT ANSWER · UPDATED 2026-11-15

What is the best MCP memory server for Claude Code in 2026? It depends on how you want memory written. claude-mem and agentmemory capture sessions through hooks. mcp-memory-service, MemPalace and XERJ store what the agent sends; in our benchmark XERJ semantic recall found the right memory in the top 5 for 94.7% of questions, mcp-memory-service 89.3% and MemPalace 84.0%.

Key number: On the same 85 memories and 75 questions, top 5 recall was XERJ semantic 94.7%, mcp-memory-service 89.3%, MemPalace 84.0% and agentmemory keyless 74.7%. (as of 2026-10-31 · source: github.com/xerj-org/xerj/tree/main/benchmarks/agent-memory)

Last checked: 2026-11-15. Every third-party fact on this page was re-read from the tool's own docs or repository on that date.

TL;DR The best MCP memory server for Claude Code depends on how you want memory written. For automatic capture of every session, pick claude-mem or agentmemory. For memory the agent saves and searches itself, pick XERJ, mcp-memory-service or MemPalace; in our open benchmark they found the right memory in the top 5 for 94.7%, 89.3% and 84.0% of questions. For plain Markdown files, pick Basic Memory.

PASTE THIS TO YOUR AI AGENT — IT DOES THE REST Act as a coding agent. Read https://xerj.org/llms.txt and https://xerj.org/compare/best-mcp-memory-servers-claude-code-2026, then pick an MCP memory server for my Claude Code setup from the table on that page. If you pick XERJ: install it, start a node, run claude mcp add --scope user xerj -- xerj mcp, store two facts about this repo with xerj_memory_store, and recall them in a new session with xerj_memory_recall. Report what you chose and why.

Claude Code already loads CLAUDE.md and an auto memory file at the start of each session. An MCP memory server adds memory the agent searches when it needs it. Background: Claude Code memory and what an MCP memory server is.

Try it: pick by job

Which MCP memory server fits Claude Code

claude-mem or agentmemory

Both hook into Claude Code and record what the agent reads, edits and runs. claude-mem has a second agent write short observations. agentmemory wires 54 MCP tools and 17 skills.

Recall figures from the XERJ agent memory benchmark of 2026-10-31. Install lines and features from each project README, checked 2026-11-15.

Summary table

Top 5 is the share of 75 questions where the right memory came back in the first five results in our AI agent memory benchmark. A dash means the server was not in that round.

ServerLicenceInstall in Claude CodeHow memory is writtenTop 5 in our testStars (2026-11-15)
claude-memApache-2.0npx claude-mem installhooks plus an observer agent-117,293
MemPalaceMITuv tool install mempalace, then its MCP serveragent saves verbatim text, 47 MCP tools84.0%60,566
SupermemoryMITClaude Code plugin, or npx supermemory localextracts facts and profiles-31,629
agentmemoryApache-2.0/plugin install agentmemoryhooks, 54 MCP tools74.7% (keyless)30,376
XERJApache-2.0claude mcp add --scope user xerj -- xerj mcpagent saves text, BM25, semantic or hybrid recall94.7% (semantic)19,111
Basic MemoryAGPL-3.0claude mcp add basic-memory -- uvx --prerelease=allow basic-memory mcpMarkdown files on disk-4,585
mcp-memory-serviceApache-2.0claude mcp add memory -- memory serveragent saves text, SQLite and ONNX embeddings89.3%2,128
Knowledge Graph Memory ServerMITnpx -y @modelcontextprotocol/server-memoryentities and relations in one JSONL file--

claude-mem: automatic session memory

claude-mem is the most-starred project here. Hooks hand each tool call to a local worker, a second agent turns the activity into short observations, and the next session starts with a compact index of them. Memory lives in ~/.claude-mem. Choose claude-mem when you want memory with no extra steps in your prompts. Anonymous usage analytics are on by default, and npx claude-mem telemetry disable turns them off.

agentmemory: hooks, skills and 54 tools

The agentmemory plugin registers 12 hooks and 17 skills and wires an MCP server with 54 tools. Its keyless mode uses BM25 and scored 74.7% top 5 in our test; EMBEDDING_PROVIDER=local adds on-device semantic recall. Choose agentmemory when you want automatic capture across Claude Code and other coding agents. Details: XERJ vs agentmemory.

mcp-memory-service and MemPalace: memory the agent saves

mcp-memory-service stores memories in SQLite with local ONNX embeddings and scored 89.3% top 5, with 84% on reworded questions. It adds a knowledge graph dashboard. MemPalace stores verbatim text with ChromaDB by default and scored 84.0%. Choose mcp-memory-service for a light MCP-first store with a visual graph, and MemPalace for its wide set of 47 tools. Details: mcp-memory-service and MemPalace.

Basic Memory, Supermemory and the reference server

XERJ: memory plus search over your files

XERJ stores exactly the text the agent sends through xerj_memory_store and finds it with xerj_memory_recall. With MiniLM on, it found the right memory in the top 5 for 94.7% of questions, and 84% of reworded questions. The same MCP server also searches the code, docs, logs and data files in your project, so one server covers memory and retrieval.

XERJ is single-node and makes no model call on write, so it saves what the agent writes and does not summarise sessions for you. Pair it with claude-mem if you want both.

How this page was checked

Recall figures come from our AI agent memory benchmark, run on 2026-10-31 with the same 85 memories, the same MiniLM model and one score script for every system. Licences, install lines and features were read from each project's README on 2026-11-15, and star counts came from the GitHub REST API the same day.

Try it with XERJ

Use the Copy the prompt button and paste it into Claude Code. It picks a memory server from this table and, if it picks XERJ, registers it, stores two facts and recalls them in a new session.

Read next

Mem0 alternatives 2026, coding agent memory across sessions, what an MCP memory server is and Claude Code memory.

FAQ

Does Claude Code already have memory?

Yes. Claude Code loads the CLAUDE.md files you write and the first 200 lines or 25KB of the auto memory file Claude writes. An MCP memory server adds memory the agent searches on demand, so history can grow past what fits in context.

Which MCP memory server finds the right memory most often?

In our open benchmark, XERJ semantic recall found the right memory in the top 5 for 94.7% of 75 questions, mcp-memory-service 89.3%, MemPalace 84.0% and agentmemory in keyless mode 74.7%. claude-mem, Basic Memory, Supermemory and the reference server were not in that round.

Which one writes memory for me automatically?

claude-mem and agentmemory. Both use Claude Code hooks to capture what the agent reads, edits and runs. claude-mem has a second agent write short observations from that activity. The other servers store what the agent chooses to save.

Which one keeps memory as plain files I can edit?

Basic Memory keeps everything as Markdown files, and Obsidian can open the same folder. The reference Knowledge Graph Memory Server keeps one JSONL file. XERJ stores memory in a local index you query over HTTP or MCP.

How do I add an MCP memory server to Claude Code?

Most servers add with one claude mcp add line, shown in the Install column of the table. XERJ uses claude mcp add --scope user xerj -- xerj mcp after you start a local node. Plugins such as claude-mem and agentmemory install with /plugin install.

How was this page checked?

Recall figures come from our agent memory benchmark of 2026-10-31. Licences, install lines and features were read from each project's README on 2026-11-15, and star counts came from the GitHub REST API the same day.

Evidence

Related