Adds persistent memory to Claude Code with hybrid search combining SQLite FTS5 and semantic embeddings. Exposes five tools: memory_save to store facts with categories like preference or technical, memory_search for BM25 plus vector similarity merged via RRF, memory_update, memory_list, and memory_delete. The hook setup automatically injects your top 30 memories into every prompt based on access frequency and recency decay. Embeddings run locally with all-MiniLM-L6-v2, so nothing leaves your machine. Reach for this when you want Claude to remember project decisions, your coding preferences, or technical context across sessions without manual copy-paste.
Long-term memory MCP server for Claude Code. Stores facts in a local SQLite database with hybrid search (FTS5 + semantic vector similarity) and automatic context injection.
memory://context resource for session context~/.claude/memory.db# Add to Claude Code
claude mcp add memory -- npx claude-memory-fts
# Auto-configure context injection hook (recommended)
npx claude-memory-fts --setup-hook
The --setup-hook command automatically:
~/.claude/scripts/memory-context.shUserPromptSubmit hook to ~/.claude/settings.json| Command | Description |
|---|---|
npx claude-memory-fts | Start MCP server (used by Claude Code) |
npx claude-memory-fts --context | Output top 30 facts (used by hook script) |
npx claude-memory-fts --setup-hook | Auto-configure context injection hook |
| Environment Variable | Default | Description |
|---|---|---|
MEMORY_DB_PATH | ~/.claude/memory.db | Path to the SQLite database file |
Example with custom path:
claude mcp add memory -e MEMORY_DB_PATH=/path/to/my/memory.db -- npx claude-memory-fts
memory_saveSave a fact to long-term memory.
| Parameter | Type | Required | Description |
|---|---|---|---|
fact | string | yes | The information to remember |
category | string | no | One of: preference, decision, personal, technical, project, workflow, general |
memory_searchHybrid search: runs FTS5 and semantic search in parallel, merges results with RRF. Falls back to LIKE for partial matches.
| Parameter | Type | Required | Description |
|---|---|---|---|
keyword | string | yes | Search keyword or phrase |
limit | number | no | Max results (default: 10) |
memory_updateUpdate a memory's content or category by ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | number | yes | Memory ID |
fact | string | no | New content (omit to keep current) |
category | string | no | New category (omit to keep current) |
memory_listList all saved memories grouped by category.
| Parameter | Type | Required | Description |
|---|---|---|---|
category | string | no | Filter by category |
limit | number | no | Max results (default: 50) |
memory_deleteDelete a memory by ID.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | number | yes | Memory ID |
memory://contextMCP resource exposing top 30 facts ranked by importance score:
@xenova/transformers — no API calls, no data leaves your machinegit clone https://github.com/kurovu146/claude-memory-mcp.git
cd claude-memory-mcp
npm install
npm run build
npm test
MIT
MEMORY_DB_PATHCustom path to the SQLite database file (default: ~/.claude/memory.db)
hovecapital/read-only-local-postgres-mcp-server
cocaxcode/database-mcp
io.github.infoinlet-marketplace/mcp-mysql
io.github.cybeleri/database-admin
io.github.yash-0620/postgres-mcp-secured