MCP server giving AI coding agents offline, token-efficient persistent memory — recall decisions, patterns, and bugs across sessions with 68.5% fewer tokens than re-reading context. No LLM, no server; works with 15+ agents.
claude mcp add toon-memory -- npx -y toon-memory{
"mcpServers": {
"toon-memory": {
"command": "npx",
"args": ["-y", "toon-memory"]
}
}
}Resumen de MCP Servers
[English](README.md) | [Español](README.es.md) | [中文](README.zh.md) | [日本語](README.ja.md) | [한국어](README.ko.md) | [Português (BR)](README.pt-br.md) | [Deutsch](README.de.md) | [Français](README.fr.md)
# toon-memory
> MCP memory server for AI coding agents — remember decisions, patterns, and bugs between sessions.
[](https://www.npmjs.com/package/toon-memory)
[](https://opensource.org/licenses/MIT)
[](https://github.com/LuiggiVal08/toon-memory/actions/workflows/ci.yml)
[](https://luiggival08.github.io/toon-memory/)
[](https://lobehub.com/mcp/luiggival08-toon-memory)
---
## Table of Contents
- [Overview](#overview)
- [Blog Post](#blog-post)
- [Features](#features)
- [Installation](#installation)
- [Supported Agents](#supported-agents)
- [MCP Tools](#mcp-tools)
- [Coordinación multi-sesión](#coordinación-multi-sesión)
- [Memory Graph (recall basado en grafo)](#memory-graph-recall-basado-en-grafo)
- [Tips & Best Practices](#tips--best-practices)
- [CLI Commands](#cli-commands)
- [Configuration](#configuration)
- [How It Works](#how-it-works)
- [Why TOON?](#why-toon)
- [Troubleshooting](#troubleshooting)
- [FAQ](#faq)
- [Development](#development)
- [Contributing](#contributing)
- [Security & Privacy](#security--privacy)
- [License](#license)
---
## Overview
Ever had that feeling where your AI agent forgets everything from yesterday's session? You explain the same architecture decision for the third time, and it still suggests the approach you already rejected?
**toon-memory fixes this.** It gives your AI agent a persistent memory that survives restarts, so it actually learns from your project over time.
📖 **[Read the documentation](https://luiggival08.github.io/toon-memory/)**
### Real-world use cases
| Scenario | What toon-memory does |
|----------|----------------------|
| Design debates | "We chose Redis over Memcached because of pub/sub support" |
| Framework choices | "This project uses Zod for validation, not Joi" |
| Bug fixes | "Redis pool exhaustion — fix was max_connections=20" |
| Architecture notes | "Broker service uses RESP protocol, not HTTP" |
| Onboarding | "The deploy script lives in scripts/deploy.sh" |
| Team context | "PR #142 reverted the caching change — don't re-add it" |
---
## Blog Post
Read [How toon-memory Makes Your AI Agent Smarter](https://luiggival08.github.io/toon-memory/blog) to see a real-world demo of persistent memory in action.
---
## Features
- **37 MCP tools** — Full memory management via Model Context Protocol, including `memory_smart_recall` (unified recall with session bias), `memory_sessions` for multi-session coordination, `context_*` tools for one-call context generation (briefing, diff, focus, health audit, export), `memory_compress` (LLM-powered compression), `memory_compress_all` (batch compression), `memory_primer` (auto-injected context), `memory_merge_sessions` (cross-session merge), `memory_pin`/`memory_unpin` (pin important entries with priority 1-5), `memory_checkpoint` (session snapshot with 7d TTL), `memory_search` (unified search with tag filters + session bias), `memory_tag` (batch tag operations), `memory_export_gist`/`memory_import_gist` (GitHub Gist sync), `memory_resolve` (restore soft-deleted entries), and `memory_suppress` (mark entries as obsolete)
- **MCP Resources** — Read memory as context without tool invocations, including a System Primer (auto-generated knowledge map)
- **15 agents supported** — OpenCode, VS Code, Claude Code, Cursor, Windsurf, Cline, Continue, Codex CLI, Gemini CLI, Zed, Antigravity, Aider, KiloCode, OpenClaw, Kiro
- **Interactive installer** — Select which agents to configure from a menu
- **SessionStart hooks** — Auto-reminders for Claude Code, Codex CLI, Gemini CLI, Antigravity
- **TOON format** — 22% fewer tokens than JSON (measured), better LLM comprehension
- **Per-project memory** — Each project gets its own memory file
- **Zero config** — Just install and use
- **Auto gitignore** — Automatically adds `.toon-memory/memory/` to `.gitignore`
- **Date filtering** — Search memory by date range
- **Auto-archive** — Old entries (>30 days), expired TTL entries, or 100+ entries moved to archive automatically
- **Encryption** — AES-256-GCM encryption for sensitive data
- **Watch mode** — Auto-backup every N minutes
- **Memory TTL** — Configurable per-entry expiration (7d, 30d, or exact dates)
- **Tag inference** — Auto-detect tags from content when tags are empty (built-in vocabulary + project dependencies)
- **Memory diff** — See what changed since your last session
- **Related entries** — Auto-suggest related memories when saving
- **Memory graph** — Connect entries with `links`/`[[key]]` refs; `memory_recall` can expand a relationship-aware subgraph for more precise, lower-token recall (no embeddings, no LLM)
- **Token-efficient recall** — `memory_recall({ compact: true })` returns numeric-indexed entries, drops `id`/`date`/`file`, renders graph edges as `->2`, and truncates graph neighbors to snippets
- **BM25 + centrality ranking** — Recall re-ranks by BM25 relevance and graph centrality (hubs surface even without the query word); per-hop decay keeps distant nodes low
- **Auto-tag from dependencies** — `toon-memory init` scans `package.json`/`Cargo.toml`/`requirements.txt`/`go.mod` and writes a project vocabulary so entries mentioning a dependency get auto-tagged with it
- **Smart Recall** — `memory_smart_recall` combines BM25 + graph + decay + quality in one call; the LLM calls this at the start of every task
- **Quality scoring** — Every entry gets a 0–1 quality score based on structure (tags, links, content specificity, recency, access count); high-quality entries surface first
- **Merge-dedup** — Saving with the same `key` merges attributes (union of tags, max confidence, latest date, combined links) instead of overwriting
- **Near-duplicate detection** — Consolidation detects near-duplicates via Jaccard similarity (threshold 0.7) and merges them
- **Confidence score** — Each entry tracks reliability: user-asserted = 1.0, inferred = 0.65–0.75
- **LLM-powered compression** — `memory_compress` uses AI to summarize long entries; `memory_compress_all` does batch compression deterministically
- **Cross-session merge** — `memory_merge_sessions` merges observations across parallel sessions for a file
- **GitHub Gist sync** — `memory_export_gist` and `memory_import_gist` sync memory entries via GitHub Gist (zero dependencies)
- **Verbatim mode** — `config.verbatim` preserves original entries instead of overwriting on save
- **Context generation tools** — `context_generate` (full briefing), `context_diff` (incremental), `context_focus` (targeted), `context_health` (audit), `context_export` (markdown) — each replaces 5-6 manual tool calls. Zero LLM, pure deterministic aggregation
- **System Primer** — Auto-injected at session start via `systemPrimer()`, showing top 5 memories for instant context
- **Path Scoping** — Entries can be scoped to file paths via glob patterns (`path_scope`); recall filters by scope automatically
- **Budget Control** — Three output levels: `budget: "tiny"` (key+1 line, ~50 tokens), `"normal"` (compact with tags/edges), `"deep"` (all fields with origin/scope/status). Backward compatible with `compact: true`
- **Origin Tracking** — Each entry tracks its origin (`human`, `agent`, `inferred`); human assertions get a quality boost
- **Soft Delete** — `memory_forget` soft-deletes by default (sets `status=obsolete`). Use `memory_resolve` to restore, `memory_suppress` to hide. Permanent deletion via `hard: true`
- **Enhanced Health Audit** — `context_health` now detects missing-evidence (path_scope without file) and stale-claims (overlapping content in same category)
---
## Installation
### 1. Install
```bash
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/LuiggiVal08/toon-memory/main/install.sh | sh
# Windows (PowerShell)
irm https://raw.githubusercontent.com/LuiggiVal08/toon-memory/main/install.ps1 | iex
# Or with npm (any platform)
npm i -g toon-memory
```
> **Tip:** The npm install is the most reliable method. The curl/irm scripts are convenience wrappers.
### 2. Configure your agent(s)
```bash
# Interactive installer — detects agents and configures MCP
npx toon-memory
```
The installer will:
1. Detect which AI agents you have installed
2. Ask which ones to configure
3. Add the MCP server config automatically
### 3. Use it
That's it! In your next agent session, try:
```bash
memory_stats # See what's in memory
memory_recall # Search memory before reading files
memory_remember # Save important decisions
```
> **Tip:** Always run `memory_recall` at the start of a session. Your agent will have context from previous sessions instantly.
### MCP Client Quick Setup
#### Cursor
Add to `.cursor/mcp.json`:
```json
{
"mcpServers": {
"toon-memory": {
"command": "npx",
"args": ["-y", "toon-memory", "mcp"]
}
}
}
```
#### Claude Desktop
Add to `claude_desktop_config.json`:
```json
{
"mcpServers": {
"toon-memory": {
"command": "npx",
"args": ["-y", "toon-memory", "mcp"]
}
}
}
```
#### Windsurf
Add to `~/.codeium/windsurf/mcp_config.json`:
```json
{
"mcpServers": {
"toon-memory": {
"command": "npx",
"args": ["-y", "toon-memory", "mcp"]
}
}
}
```
---
## Supported Agents
| Agent | Config Location | Format | Hooks | Auto-Setup |
|-------|-----------------|--------|-------|------------|
| **OpenCode** | `.opencode/opencode.json` + `.opencode/plugins/toon-memory.ts` | Plugin | SessionStart (plugin, no top-level `hooks`) | ✅ |
| **VS Code / Copilot** | `.vscode/mLo que la gente pregunta sobre toon-memory
¿Qué es LuiggiVal08/toon-memory?
+
LuiggiVal08/toon-memory es mcp servers para el ecosistema de Claude AI. MCP server giving AI coding agents offline, token-efficient persistent memory — recall decisions, patterns, and bugs across sessions with 68.5% fewer tokens than re-reading context. No LLM, no server; works with 15+ agents. Tiene 5 estrellas en GitHub y se actualizó por última vez today.
¿Cómo se instala toon-memory?
+
Puedes instalar toon-memory clonando el repositorio (https://github.com/LuiggiVal08/toon-memory) o siguiendo las instrucciones del README en GitHub. ClaudeWave también te ofrece bloques de instalación rápida en esta misma página.
¿Es seguro usar LuiggiVal08/toon-memory?
+
LuiggiVal08/toon-memory aún no ha sido auditado por nuestro agente de seguridad. Revisa el repositorio original en GitHub antes de usarlo en producción.
¿Quién mantiene LuiggiVal08/toon-memory?
+
LuiggiVal08/toon-memory es mantenido por LuiggiVal08. La última actividad registrada en GitHub es de today, con 0 issues abiertos.
¿Hay alternativas a toon-memory?
+
Sí. En ClaudeWave puedes explorar mcp servers similares en /categories/mcp, ordenados por popularidad o actividad reciente.
Despliega toon-memory en tu cloud
Lleva este repo a producción en minutos. Cada plataforma genera su propio entorno con variables de entorno editables.
¿Mantienes este repo? Añade un badge a tu README
Pega el badge en tu README de GitHub para mostrar que está auditado por ClaudeWave. Cada badge enlaza de vuelta a esta página y muestra el Trust Score actual.
[](https://claudewave.com/repo/luiggival08-toon-memory)<a href="https://claudewave.com/repo/luiggival08-toon-memory"><img src="https://claudewave.com/api/badge/luiggival08-toon-memory" alt="Featured on ClaudeWave: LuiggiVal08/toon-memory" width="320" height="64" /></a>Más MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
The fastest path to AI-powered full stack observability, even for lean teams.
Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!