Skip to main content
MCP server CX Codex

nan-forget — Claude Code MCP server: persistent project memory

Stores project facts and decisions locally, then brings relevant context into later coding sessions. Useful when an agent keeps losing track of past work.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env OPENAI_API_KEY=<OPENAI_API_KEY> --env NAN_FORGET_EMBEDDING_PROVIDER=<NAN_FORGET_EMBEDDING_PROVIDER> --env NAN_FORGET_USER_ID=<NAN_FORGET_USER_ID> --env NAN_FORGET_PROJECT_ROOT=<NAN_FORGET_PROJECT_ROOT> --transport stdio nan-forget -- npx -y nan-forget
Open on GitHub

What nan-forget does

nan-forget stores project decisions, preferences, and facts in SQLite, then retrieves relevant context in later sessions. Its database at ~/.nan-forget/memories.db is shared across projects and tools, with sqlite-vec used for search. In Claude Code, hooks retrieve context when you send a message, capture .md file writes, and scan the conversation when a session ends.

For Codex, setup creates an AGENTS.md file with memory instructions; CLI commands and a REST API at localhost:3456 are also available. Running npx nan-forget setup opens a wizard that configures Ollama, embeddings, Claude Code hooks, and MCP. One setup detail matters: the Claude Code MCP command requires OPENAI_API_KEY, while the setup wizard is described as a local installation.

What it helps with

  • carry project decisions into a new session
  • retrieve context from earlier conversations
  • search shared memory across projects
  • give Codex instructions for using project memory

Example prompts for the agent

  • Remember that this project uses Clerk for authentication, not a custom JWT.
  • Find the authentication decisions from our earlier sessions.
  • Load context from previous sessions for this project.

How to install nan-forget

Platform CLI

claude mcp add --env OPENAI_API_KEY=<OPENAI_API_KEY> --env NAN_FORGET_EMBEDDING_PROVIDER=<NAN_FORGET_EMBEDDING_PROVIDER> --env NAN_FORGET_USER_ID=<NAN_FORGET_USER_ID> --env NAN_FORGET_PROJECT_ROOT=<NAN_FORGET_PROJECT_ROOT> --transport stdio nan-forget -- npx -y nan-forget

Replace <…> with your own values

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about nan-forget

How do I install nan-forget in Claude Code?

Run claude mcp add nan-forget -e OPENAI_API_KEY=<OPENAI_API_KEY> -- npx -y nan-forget. Replace the placeholder with your API key.

What does nan-forget do?

It saves project facts, preferences, and decisions in SQLite, then retrieves relevant context in later sessions. The same memory database can be accessed from multiple tools and projects.

Does nan-forget require an API key?

The Claude Code MCP setup command uses OPENAI_API_KEY. The npx nan-forget setup wizard, by contrast, is described as configuring a local installation with Ollama.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor