MCP Memory Server: Complete Guide to Persistent AI Memory
What is an MCP Memory Server?
Section titled “What is an MCP Memory Server?”An MCP memory server is a local service that implements the Model Context Protocol (MCP) to provide AI coding agents with persistent memory. Instead of losing context between sessions, your agent stores decisions, patterns, and bugs in a searchable memory store.
toon-memory is the most complete MCP memory server available:
- 35 MCP tools + 4 resources
- 15+ agent support — Claude, Cursor, OpenCode, and more
- Token-efficient format — 22% fewer tokens than JSON
- Graph-aware recall — BM25 + centrality + quality scoring
- Zero config — install and use
How MCP Memory Servers Work
Section titled “How MCP Memory Servers Work”The Model Context Protocol
Section titled “The Model Context Protocol”MCP (Model Context Protocol) is a standard for AI agents to communicate with external tools. An MCP memory server:
- Receives requests from the agent via stdio
- Processes memory operations (save, search, delete)
- Stores data locally in a structured format
- Returns results formatted for the agent
Architecture
Section titled “Architecture”Your AI Agent ↓ MCP Protocol (stdio)Memory Server (toon-memory) ↓Local File (.toon-memory/memory/data.toon)No cloud. No API calls. No network. Everything stays on your machine.
Why Use an MCP Memory Server?
Section titled “Why Use an MCP Memory Server?”The Problem
Section titled “The Problem”AI coding agents have no memory between sessions:
- Claude forgets the architecture decisions from yesterday
- Cursor can’t recall the bug fixes you discovered
- OpenCode doesn’t remember the patterns your team established
This wastes tokens, burns time, and leads to frustrating repetition.
The Solution
Section titled “The Solution”An MCP memory server gives your agent persistent memory:
| Without MCP Memory | With MCP Memory |
|---|---|
| Re-explain context every session | Context persists automatically |
| 2,411 tokens per session | 972 tokens per session (-60%) |
| 25 tool calls per session | 5 tool calls per session (-80%) |
| $0.072 per session (GPT-4) | $0.029 per session (-60%) |
MCP Memory Server Features
Section titled “MCP Memory Server Features”34 MCP Tools
Section titled “34 MCP Tools”toon-memory exposes 35 MCP tools for full memory management:
Core Tools:
memory_remember— Save decisions, patterns, bugs, knowledgememory_recall— Search memory (flat or graph mode)memory_smart_recall— Unified recall with BM25 + graph + qualitymemory_forget— Remove entriesmemory_stats— View memory state
Context Tools:
context_brief— One-call context briefingcontext_generate— Full project briefingcontext_diff— What changed since last sessioncontext_focus— Hyper-focused briefingcontext_health— Memory health auditcontext_export— Export as markdown
Management Tools:
memory_summary— Save/retrieve file summariesmemory_archive— Archive old entriesmemory_diff— Show changes since datememory_suggest— Find related entriesmemory_sessions— Multi-session coordinationmemory_captured— View hook-captured activitymemory_consolidate— Merge duplicatesmemory_encrypt— AES-256-GCM encryptionmemory_decrypt— Disable encryption
Token-Efficient Format
Section titled “Token-Efficient Format”Memory is stored in TOON format (Token-Oriented Object Notation):
a1b2c3d4|decision|use-zod|Use Zod for validation|src/types.ts|validation;types|2026-07-1022% fewer tokens than equivalent JSON, designed for LLM comprehension.
Graph-Aware Recall
Section titled “Graph-Aware Recall”Entries are connected via explicit links and implicit references:
memory_remember({ category: "decision", key: "use-redis", content: "Use Redis for session storage (see [[redis-config]])", links: "redis-config"})Recall expands the ego-subgraph to find related entries, even if they don’t contain the exact search term.
Quality Scoring
Section titled “Quality Scoring”Every entry gets an automatic quality score (0-1):
| Factor | Weight |
|---|---|
| Tags | 0.3 max |
| Links | 0.2 max |
| Content length | 0.3 max |
| Recency | 0.1 max |
| Specificity | 0.1 max |
High-quality entries surface first in recall.
Setup Guide
Section titled “Setup Guide”Step 1: Install
Section titled “Step 1: Install”npm install -g toon-memoryStep 2: Configure
Section titled “Step 2: Configure”npx toon-memory # Interactive installerOr manually add to your agent’s MCP config:
{ "mcpServers": { "toon-memory": { "command": "npx", "args": ["-y", "toon-memory", "mcp"] } }}Step 3: Use
Section titled “Step 3: Use”# Save important decisionsmemory_remember({ category: "decision", key: "use-postgres", content: "Choose Postgres for ACID compliance"})
# Search memorymemory_recall({ query: "database" })
# Get full context in one callmemory_smart_recall({ intent: "what I was working on" })Benchmarks
Section titled “Benchmarks”Token Efficiency
Section titled “Token Efficiency”Format Tokens (16 entries) vs JSON────────────── ─────────────────── ───────JSON 1097 baselineTOON 850 -22.5%Recall Efficiency
Section titled “Recall Efficiency”Method Tokens to get context vs re-reading files───────────────────────────── ───────────────────── ───────────────────Re-read source files ~3000 baselinememory_recall (flat) ~1200 -60%memory_recall (graph, compact) ~900 -70%memory_smart_recall ~850 -72%Context Tools Benchmark
Section titled “Context Tools Benchmark”Scenario Without With Saved Tools──────────────────────────────── ──────── ────── ─────── ──────context_generate (full briefing) 5,556 378 93.2% 6 → 1context_diff (incremental) 533 152 71.5% 4 → 1context_focus (targeted) 413 225 45.5% 4 → 1context_health (audit) 322 246 23.6% 5 → 1context_export (injectable md) 1,178 218 81.5% 3 → 1──────────────────────────────── ──────── ────── ─────── ──────TOTAL 8,002 1,219 84.8% 22 → 5Supported Agents
Section titled “Supported Agents”toon-memory works with 15+ AI coding agents:
- OpenCode, Claude Code, Cursor, Windsurf, VS Code Copilot
- Codex CLI, Gemini CLI, Zed, Cline, Continue
- Antigravity, Aider, KiloCode, OpenClaw, Kiro
See the Supported Agents page for configuration details.
Conclusion
Section titled “Conclusion”An MCP memory server gives your AI coding agent the persistent memory it needs to be truly productive. toon-memory is the most complete solution available:
- 35 MCP tools for full memory management
- Token-efficient format that saves 22% on every session
- Graph-aware recall that finds related context automatically
- 15+ agent support with zero-config setup
npm install -g toon-memorynpx toon-memory # Interactive installerYour agent will remember everything in the next session.