# memory-mcp

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

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

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add memory-mcp -- npx -y claude-code-memory
```

### Codex

**Platform CLI**
```bash
codex mcp add memory-mcp -- npx -y claude-code-memory
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "memory-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "claude-code-memory"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "memory-mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "claude-code-memory"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add memory-mcp npx -y claude-code-memory
```

## When to use it
- 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
- 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.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

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