Install
$ agentstack add mcp-luiggival08-toon-memory Open-source listing, not yet scanned by AgentStack. Follow the source repository for install instructions.
Security review
⚠ Flagged1 finding(s); flagged for manual review. · v0.1.0 How review works →
- • Prompt-injection patterns
- • Secret / credential exfiltration
- • Dangerous shell & filesystem operations
- • Untrusted network calls
- • Known-malicious package signatures
- high Pipes remote content directly into a shell (remote code execution).
What it can access
- ● Network access Used
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
toon-memory
> Persistent memory 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/)
Table of Contents
- [What is toon-memory?](#what-is-toon-memory)
- [Blog Post](#blog-post)
- [Features](#features)
- [Quick Start](#quick-start)
- [Supported Agents](#supported-agents)
- [MCP Tools](#mcp-tools)
- [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)
- [License](#license)
What is toon-memory?
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.
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 to see a real-world demo of persistent memory in action.
Features
- 11 MCP tools — Full memory management via Model Context Protocol
- MCP Resources — Read memory as context without tool invocations
- 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 — 40% fewer tokens than JSON, 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
- Memory diff — See what changed since your last session
- Related entries — Auto-suggest related memories when saving
Quick Start
1. Install
# 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)
# Interactive installer — detects agents and configures MCP
npx toon-memory
The installer will:
- Detect which AI agents you have installed
- Ask which ones to configure
- Add the MCP server config automatically
3. Use it
That's it! In your next agent session, try:
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.
Supported Agents
| Agent | Config Location | Format | Hooks | Auto-Setup | |-------|-----------------|--------|-------|------------| | OpenCode | .opencode/opencode.json | JSON | — | ✅ | | VS Code / Copilot | .vscode/mcp.json | JSON | — | ✅ | | Claude Code | .claude/settings.json | JSON | SessionStart | ✅ | | Cursor | .cursor/mcp.json | JSON | — | ✅ | | Windsurf | ~/.codeium/windsurf/mcp_config.json | JSON | — | ✅ | | Cline | .cline/mcp.json | JSON | — | ✅ | | Continue | .continue/config.json | JSON | — | ✅ | | Codex CLI | .codex/config.toml | TOML | SessionStart | ✅ | | Gemini CLI | .gemini/settings.json | JSON | SessionStart | ✅ | | Zed | ~/.config/zed/settings.json | JSONC | — | ✅ | | Antigravity | .gemini/config/mcp_config.json | JSON | SessionStart | ✅ | | Aider | — | — | — | 📝 Instructions | | KiloCode | ~/.kilocode/mcp_settings.json | JSON | — | ✅ | | OpenClaw | .openclaw.json | JSON | — | ✅ | | Kiro | .kiro/settings/mcp.json | JSON | — | ✅ |
> Tip: You can configure toon-memory for multiple agents at the same time. Each agent gets the same shared memory file at .toon-memory/memory/.
MCP Tools
| Tool | Description | |------|-------------| | memory_remember | Save a decision, pattern, bug, or knowledge (with optional TTL and auto-tag inference) | | memory_recall | Search memory (use BEFORE reading files, filters expired TTL entries) | | memory_forget | Remove an entry by key or id | | memory_stats | View memory state (including TTL stats) | | memory_summary | Save/retrieve file summaries | | memory_archive | Archive old entries (>30 days) and expired TTL entries | | memory_diff | Show changes since a date (24h, 7d, or exact date) | | memory_suggest | Find related entries for a given context | | memory_encrypt | Enable AES-256-GCM encryption | | memory_decrypt | Disable encryption |
MCP Resources
Memory is also exposed as MCP resources for direct context reading:
| Resource | URI | Description | |----------|-----|-------------| | Memory Entries | toon://memory/entries | Full memory dump | | Memory Stats | toon://memory/stats | Category counts and TTL info | | Memory Summaries | toon://memory/summaries | File summaries
Examples
Remember a decision
memory_remember({
category: "decision",
key: "use-zod",
content: "Use Zod for validation — simpler than Joi, better TS support",
file: "src/types.ts",
tags: "validation;types"
})
// 🧠 Guardado: decision/use-zod (a1b2c3d4)
// 🔗 Entradas relacionadas:
// [pattern] zod-schemas — Shared Zod schemas for API validation
> Tip: Use descriptive keys like use-zod instead of vague ones like validation. Your agent searches by key and content, so specificity helps.
Remember with TTL
memory_remember({
category: "knowledge",
key: "sprint-deadline",
content: "Sprint ends July 18, feature freeze is July 16",
ttl: "7d"
})
// 🧠 Guardado: knowledge/sprint-deadline (x1y2z3w4)
// ⏰ TTL: 2026-07-19
> Tip: Use TTL for temporary context like deadlines, sprint info, or time-sensitive notes. Entries with expired TTL are automatically filtered from search results.
Auto-inferred tags
memory_remember({
category: "bug",
key: "redis-connection-timeout",
content: "Redis connection timeout in production, increased pool size"
// tags left empty — auto-inferred from content
})
// 🧠 Guardado: bug/redis-connection-timeout (a1b2c3d4)
// 🏷️ Tags inferidos: redis
> Tip: Leave tags empty and the system will infer them from your content using a vocabulary of 20+ categories (redis, auth, api, db, security, etc.).
Search memory
memory_recall({ query: "redis" })
// [bug] redis-pool-fix (i9j0k1l2)
// Added max_connections=20
// File: redis.ts | Tags: redis;fix | Date: 2026-07-10
> Tip: Search before you read files. This saves tokens and gives your agent context it wouldn't get from code alone.
Search with date filter
memory_recall({
query: "redis",
from_date: "2026-07-01",
to_date: "2026-07-31"
})
> Tip: Use date filters when you remember roughly when something happened but not exactly what.
Archive old entries
memory_archive()
// 📦 Archivadas 5 entradas antiguas
// 📋 Quedan 42 entradas activas
> Tip: Run this periodically to keep memory lean. Archived entries are still searchable via memory_recall with date filters. Entries with expired TTL are also archived automatically.
Show changes since last session
memory_diff({ since: "24h" })
// 📋 Cambios desde 2026-07-11:
//
// ➕ Nuevas (2):
// [decision] use-zod (a1b2c3d4)
// Use Zod for validation
// [bug] redis-timeout (e5f6g7h8)
// Redis connection timeout fix
> Tip: Use memory_diff at the start of a session to see what your agent learned since you last worked on the project.
Find related entries
memory_suggest({ context: "redis cache configuration" })
// 🔍 Sugerencias para "redis cache configuration":
//
// [decision] redis-cache-config (a1b2c3d4)
// Redis cache layer for session storage
// File: src/cache.ts | Tags: redis;cache | Date: 2026-07-10
//
// [bug] redis-pool-fix (i9j0k1l2)
// Added max_connections=20
// File: redis.ts | Tags: redis;fix | Date: 2026-07-10
> Tip: Use memory_suggest when you need context about a topic but aren't sure what to search for.
Enable encryption
memory_encrypt()
// 🔐 Encriptación habilitada
// ⚠️ Guarda esta clave (no se puede recuperar):
// a1b2c3d4...
> Warning: Save the encryption key somewhere safe. If you lose it, your memory data is gone forever.
Tips & Best Practices
Here are some patterns that work well with toon-memory:
The "start of session" habit
At the beginning of every new session, run:
memory_recall({ query: "project context" })
This gives your agent instant context about what happened before.
The "end of session" habit
Before closing a session, save anything important:
memory_remember({
category: "decision",
key: "auth-approach",
content: "Chose JWT over sessions — stateless, works across microservices",
file: "src/auth.ts",
tags: "auth;architecture"
})
Choosing categories
| Category | When to use | |----------|-------------| | decision | Architecture choices, trade-offs, "why X over Y" | | pattern | Conventions, frameworks, code style rules | | bug | Issues you fixed and how | | knowledge | Project facts, domain info, team context |
> Tip: Don't overthink it. If it's something your future self (or agent) would want to know, save it.
Tags that work well
Use semicolon-separated tags for easy filtering:
tags: "redis;performance;fix"
tags: "auth;jwt;security"
tags: "api;rest;versioning"
> Tip: Keep tags short and consistent. They're not hashtags — they're search filters.
What NOT to save
- Don't save things that are obvious from reading the code
- Don't save temporary debugging notes
- Don't save secrets, API keys, or credentials (use env vars instead)
- Don't duplicate the same information with different keys
Keep memory clean
Run memory_archive() monthly to move old entries to the archive. Run memory_stats() to check the size.
CLI Commands
npx toon-memory # Interactive installer
npx toon-memory init # Quick setup (no prompts)
npx toon-memory mcp # Run MCP server directly
npx toon-memory status # Check installation status
npx toon-memory stats # View memory statistics
npx toon-memory export # Export memory to JSON
npx toon-memory import # Import memory from JSON
npx toon-memory watch [options] # Auto-backup with options
npx toon-memory upgrade # Update to latest version
npx toon-memory uninstall # Remove from all agents
Examples
Stats
$ npx toon-memory stats
🧠 toon-memory stats
📊 Memory Stats
━━━━━━━━━━━━━━━━━━
Total entries: 45
├── decision: 12
├── pattern: 18
├── bug: 8
└── knowledge: 7
Last updated: 2026-07-10
File size: 12.4 KB
> Tip: If memory gets too large (100+ entries), consider archiving or removing outdated entries with memory_forget.
Export
$ npx toon-memory export
🧠 toon-memory export
Exported 45 entries to:
/path/to/project/toon-memory-export.json
> Tip: Export before major refactors. You can always import the backup later if something goes wrong.
Import
$ npx toon-memory import backup.json
🧠 toon-memory import
Imported 3 new entries
Skipped 2 duplicates
> Tip: Duplicates are detected by key. If you want to re-import an entry, delete the old one first with memory_forget.
Watch
$ npx toon-memory watch 15 -c -m 20
🧠 toon-memory watch
Watching memory file every 15 minutes...
Max backups: 20
Compression: enabled
Logging: disabled
Press Ctrl+C to stop
📦 Backup #1 created: 2026-07-11T16-00-00-000Z
📦 Backup #2 created: 2026-07-11T16-15-00-000Z
^C
✅ Watch stopped. 2 backups created.
> Tip: Watch mode is great for long-running sessions. Use -c to compress and -m 5 to keep only 5 backups.
Watch Options:
| Option | Description | Default | |--------|-------------|---------| | [interval] | Backup interval in minutes | 5 | | -c, --compress | Enable gzip compression | off | | -l, --log [path] | Enable file logging | off | | -m, --max-backups | Max backups to keep (0=unlimited) | 10 |
Configuration
Interactive installer (recommended)
npx toon-memory
The installer will:
- Show all 15 supported agents with detection status
- Let you select which ones to configure (comma-separated,
all, or Enter) - Ask for local or global installation scope
- Configure MCP server, instruction files, and hooks automatically
OpenCode
Add to .opencode/opencode.json or ~/.config/opencode/opencode.json:
{
"mcp": {
"toon-memory": {
"type": "local",
"command": ["npx", "-y", "toon-memory", "mcp"],
"enabled": true
}
}
}
Claude Code
Add to .claude/settings.json:
{
"mcpServers": {
"toon-memory": {
"command": "npx",
"args": ["-y", "toon-memory", "mcp"]
}
}
}
VS Code / Copilot
Add to .vscode/mcp.json:
{
"servers": {
"toon-memory": {
"command": "npx",
"args": ["-y", "toon-memory", "mcp"]
}
}
}
Codex CLI
Add to .codex/config.toml:
[mcpServers.toon-memory]
command = "npx"
args = ["-y", "toon-memory", "mcp"]
Gemini CLI
Add to .gemini/settings.json:
{
"mcpServers": {
"toon-memory": {
"command": "npx",
"args": ["-y", "toon-memory", "mcp"]
}
}
}
Zed
Add to ~/.config/zed/settings.json:
{
"mcp_servers": {
"toon-memory": {
"command": "npx",
"args": ["-y", "toon-memory", "mcp"]
}
}
}
> Tip: Use global config if you want memory for every project. Use project-level config if you only want it for specific projects.
How It Works
- MCP Server — Runs locally, talks to your agent via stdio
- TOON Format — Stores data in Token-Oriented Object Notation (~40% fewer tokens than JSON)
- Per-project memory — Each project gets
.toon-memory/memory/data.toon - Zero config — Just install and use
Memory File Format
version: 1
entries[3|]{id|categor
…
## Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.
- **Author:** [LuiggiVal08](https://github.com/LuiggiVal08)
- **Source:** [LuiggiVal08/toon-memory](https://github.com/LuiggiVal08/toon-memory)
- **License:** MIT
- **Homepage:** https://luiggival08.github.io/toon-memory/
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.