Skip to main content
MCP server CX Codex

memory-mcp — Claude Code MCP server: what it does, how to install

Saves project context and architectural choices to local files while creating automatic git snapshots during sessions.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add memory-mcp -- npx -y claude-code-memory
Open on GitHub

What memory-mcp does

The server hooks into Claude Code lifecycle events to process conversation transcripts through Haiku. It strips duplicates using Jaccard similarity, logs decisions into .memory/state.json, and condenses vital points into CLAUDE.md. Storage stays entirely local.

During active chats, tools like memory_search or memory_ask query the deep history. Parallel to context capture, it commits working directory states into a dedicated git branch for quick rollback. This protects against destructive edits.

You need Node.js 18+ and an Anthropic API key for background extraction. Without valid Anthropic API credentials, the extraction pipeline fails silently.

What it helps with

  • preserve architecture decisions across coding sessions
  • query past implementation choices via search tools
  • revert files to automated git snapshots
  • prune outdated session notes automatically

Example prompts for the agent

  • Search memory to recall why we picked PostgreSQL over Redis.
  • Check project history to see what was left unfinished yesterday.
  • Query memory tools for previous authentication pattern decisions.

How to install memory-mcp

Platform CLI

claude mcp add memory-mcp -- npx -y claude-code-memory

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 memory-mcp

How to install memory-mcp in Claude Code?

Run claude mcp add memory-mcp -- npx -y claude-code-memory. Then complete initial hook configuration in your shell using memory-mcp setup.

What does memory-mcp do?

It captures architectural decisions into a two-tier storage system, keeping short summaries inside CLAUDE.md. It also creates automatic git commits on a hidden branch.

Do I need a separate API key for memory extraction?

Yes, background extraction relies on Haiku and requires an Anthropic API key. You can store it by running memory-mcp setup or memory-mcp key.

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