Nan Forget logo

Nan Forget

Persists AI coding context locally in SQLite and recalls it across Claude Code, Codex, Cursor, and projects.

Install Nan Forget

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "nan-forget": {
      "command": "npx",
      "args": [
        "-y",
        "nan-forget"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Claude Code command
claude mcp add --transport stdio nan-forget -- npx -y nan-forget

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y nan-forget

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

The nan-forget MCP server gives AI coding tools persistent memory through a local SQLite database with vector search. It saves decisions, preferences, and facts, then recalls relevant context in later sessions using MCP tools, hooks, CLI commands, or a local REST API. Setup configures Ollama, embeddings, Claude hooks, MCP, and an AGENTS.md file without requiring API keys or Docker. Use it when coding agents need shared memory across sessions and projects.

Use cases

  • Persist coding decisions between sessions
  • Recall project context while using Claude Code
  • Share memories between Claude, Codex, and Cursor
  • Search saved decisions through the local REST API
  • Create checkpoints for completed coding tasks

Key features

  • Local SQLite memory database with sqlite-vec search
  • Automatic Claude Code recall and session-end capture
  • Memory consolidation, decay, deduplication, and expiry
  • CLI and localhost REST API fallbacks
  • Generated AGENTS.md instructions for Codex-style agents
  • Local Ollama-based setup without required API keys

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

25/26 checks healthy over the last 117d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 14d ago via OSV.dev · nan-forget (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars5Stargazers on the source repository.
npm downloads371Package downloads in the last 30 days.
Last commit8mo agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Directory activity4 viewsConfig copies, upvotes, and views on AllMCPs.

How Nan Forget works

What the nan-forget MCP server does

The nan-forget MCP server stores information learned during AI-assisted coding and makes it available after a session ends. Memories include project facts, technical decisions, preferences, and other context that an agent may need later. Data is kept in a local SQLite database at ~/.nan-forget/memories.db, with sqlite-vec providing vector-based retrieval.

Memory is shared across supported workflows, so information saved while using Claude can be searched from Codex or Cursor. The system also separates short-lived Markdown context from persistent memory: session-oriented .md files can be intercepted and added to the database for later retrieval.

How it works

Claude Code can use three hooks to automate memory handling. A prompt submission triggers a recall search, a post-tool hook watches Markdown writes, and a session-end hook scans the transcript for decisions or facts that were not saved. The memory_sync operation performs a lightweight session handshake, while search and save operations handle retrieval and persistence.

Retrieval has multiple stages. Initial vector matching identifies candidate summaries, a recall step fetches full entries and can expand across projects, and an association step searches for related memories. Results are ranked using similarity, memory age, access frequency, and confidence. Older related entries may be consolidated after every ten saves or after 24 hours; the system can summarize them when an OpenAI key is available or merge them deterministically without one.

Setup and configuration

Run npx nan-forget setup to start the guided installation. The setup process installs or configures Ollama and embeddings, adds Claude hooks, writes MCP configuration, and creates a project-level AGENTS.md for Codex-style agents. Restart Claude Code or reopen Codex after setup.

The nan-forget MCP server runs locally and does not require an API key or Docker for its standard setup. To use non-Claude agents, start the local API with nan-forget api; nan-forget prompt prints instructions describing the available REST workflow. The API listens on localhost:3456 according to the documented examples.

Tools and capabilities

Documented MCP and workflow capabilities include:

  • memory_sync for a health check, statistics, and project listing during session startup.
  • memory_search for finding relevant stored context.
  • memory_save for recording decisions, facts, and preferences.
  • CLI commands including add, search, stats, sync, and checkpoint.
  • REST endpoints for memory search, synchronization, and checkpoints.
  • Slash commands for loading context, checking health, starting services, cleaning data, and forcing consolidation in Claude Code.

Agents using Codex-style instruction files can follow the generated AGENTS.md guidance. CLI and REST fallbacks cover workflows where Claude’s hook model is unavailable.

Limitations and notes

Automatic behavior differs by client. Claude Code receives the documented hook-based recall and save flow, while Codex, Cursor, and similar tools generally rely on AGENTS.md, CLI commands, or the local REST API. The documented design uses one local SQLite database shared across projects and tools, so it is intended for local development rather than a hosted multi-user memory service.

Consolidation can archive original memories after creating a compacted entry.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Nan Forget

nan-forget is an MCP server that connects AI coding tools to a local SQLite memory database and exposes memory_sync, memory_search, and memory_save tools. It also supports CLI and REST workflows so Claude Code, Codex, and Cursor can share persisted project memory across sessions.

Run `npx nan-forget setup`. The wizard configures Ollama, embeddings, Claude hooks, MCP settings, and a project `AGENTS.md`; restart Claude Code or reopen Codex afterward.

Yes, Cursor can use nan-forget through the generated instructions or the CLI and local REST API fallbacks. Cursor shares the same memory database as Claude and Codex.

Memories are stored locally in `~/.nan-forget/memories.db`. The database uses SQLite with sqlite-vec for vector search and can be accessed by the supported local workflows.

No, the standard local setup does not require an API key or Docker. An OpenAI key is optional for LLM-based consolidation; without one, the system uses deterministic merging.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewNan Forget AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/nan-forget?style=directory)](https://allmcps.com/mcp/nan-forget)
HTML Embed
<a href="https://allmcps.com/mcp/nan-forget"><img src="https://allmcps.com/api/badge/nan-forget?style=directory" alt="Nan Forget on AllMCPs" /></a>