# Toon Memory

Offline persistent memory for coding assistants. Keeps architectural choices and project conventions intact between sessions via MCP.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 12
- Author: LuiggiVal08
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/LuiggiVal08/toon-memory
- Updated: 2026-08-05
- HTML: https://affpapa.org/en/nevibecode/mcp/toon-memory

## What it does

AI coding assistants tend to drop project context as soon as a session closes. Toon Memory writes decisions, architecture notes, and bug fixes to your local disk instead of a remote cloud. It keeps records inside `.toon-memory/memory/` and appends that path to `.gitignore`. The specialized TOON data format cuts token overhead by 22% compared to JSON.

The server bundles 35 MCP tools. Functions like `memory_smart_recall` retrieve relevant context using BM25 scoring paired with graph centrality decay, bypassing external embeddings. Sessions can be saved via `memory_checkpoint` with a 7-day TTL, while sensitive records remain secured through AES-256-GCM encryption in `memory_secret`.

Running `toon-memory init` parses manifests like `package.json` or `requirements.txt` to build auto-tagging project vocabularies. If you plan to encrypt entries or sync with GitHub Gist, you must provide the `TOON_MEMORY_KEY` and `GITHUB_TOKEN` environment variables before starting.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `TOON_MEMORY_KEY`, `TOON_MEMORY_CAPTURE`, `TOON_MEMORY_SESSION_ID`, `TOON_MEMORY_BRANCH`, `TOON_MEMORY_NO_SESSION`, `GITHUB_TOKEN` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env TOON_MEMORY_KEY=<TOON_MEMORY_KEY> --env TOON_MEMORY_CAPTURE=<TOON_MEMORY_CAPTURE> --env TOON_MEMORY_SESSION_ID=<TOON_MEMORY_SESSION_ID> --env TOON_MEMORY_BRANCH=<TOON_MEMORY_BRANCH> --env TOON_MEMORY_NO_SESSION=<TOON_MEMORY_NO_SESSION> --transport stdio toon-memory -- npx -y toon-memory
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Codex

**Platform CLI**
```bash
codex mcp add toon-memory --env TOON_MEMORY_KEY=<TOON_MEMORY_KEY> --env TOON_MEMORY_CAPTURE=<TOON_MEMORY_CAPTURE> --env TOON_MEMORY_SESSION_ID=<TOON_MEMORY_SESSION_ID> --env TOON_MEMORY_BRANCH=<TOON_MEMORY_BRANCH> --env TOON_MEMORY_NO_SESSION=<TOON_MEMORY_NO_SESSION> -- npx -y toon-memory
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "toon-memory": {
            "command": "npx",
            "args": [
                "-y",
                "toon-memory"
            ],
            "env": {
                "TOON_MEMORY_KEY": "<TOON_MEMORY_KEY>",
                "TOON_MEMORY_CAPTURE": "<TOON_MEMORY_CAPTURE>",
                "TOON_MEMORY_SESSION_ID": "<TOON_MEMORY_SESSION_ID>",
                "TOON_MEMORY_BRANCH": "<TOON_MEMORY_BRANCH>",
                "TOON_MEMORY_NO_SESSION": "<TOON_MEMORY_NO_SESSION>"
            }
        }
    }
}
```
Replace <…> with your own values. 1 more environment variable is in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "toon-memory": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "toon-memory"
            ],
            "env": {
                "TOON_MEMORY_KEY": "<TOON_MEMORY_KEY>",
                "TOON_MEMORY_CAPTURE": "<TOON_MEMORY_CAPTURE>",
                "TOON_MEMORY_SESSION_ID": "<TOON_MEMORY_SESSION_ID>",
                "TOON_MEMORY_BRANCH": "<TOON_MEMORY_BRANCH>",
                "TOON_MEMORY_NO_SESSION": "<TOON_MEMORY_NO_SESSION>"
            }
        }
    }
}
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e TOON_MEMORY_KEY=<TOON_MEMORY_KEY> -e TOON_MEMORY_CAPTURE=<TOON_MEMORY_CAPTURE> -e TOON_MEMORY_SESSION_ID=<TOON_MEMORY_SESSION_ID> -e TOON_MEMORY_BRANCH=<TOON_MEMORY_BRANCH> -e TOON_MEMORY_NO_SESSION=<TOON_MEMORY_NO_SESSION> toon-memory npx -y toon-memory
```
Replace <…> with your own values. 1 more environment variable is in the server README

## When to use it
- persist architecture choices and library decisions across sessions
- stop explaining project conventions to agents repeatedly
- link related codebase notes through graph connections
- deduplicate near-identical notes and archive stale entries

## Example prompts
- Recall the decision we made regarding our validation library
- Save the database connection pool fix to memory with a backend tag
- Create a checkpoint of the current session decisions

## Similar
- [memory-discipline](https://affpapa.org/en/nevibecode/skills/memory-discipline.md) — skill · 3900 installs
- [claude-memory-curator](https://affpapa.org/en/nevibecode/skills/claude-memory-curator.md) — skill · 2600 installs
- [memory-continue](https://affpapa.org/en/nevibecode/skills/memory-continue.md) — skill · 1300 installs
- [read-working-memory](https://affpapa.org/en/nevibecode/skills/read-working-memory.md) — skill · 765 installs
- [memory-search](https://affpapa.org/en/nevibecode/skills/ruvnet-memory-search.md) — skill · 750 installs
- [memory-reflect](https://affpapa.org/en/nevibecode/skills/basicmachines-co-memory-reflect.md) — skill · 746 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
