What claude-db MCP server does
The claude-db MCP server adds persistent project memory to Claude Code. It records decisions, dead ends, and project rules so later chats can recover relevant context instead of starting with no history. It also builds a map of code relationships, including which files define, call, or import a symbol.
Memory selection is scoped to the current prompt: the system can return one or two matching memories, or none when there is no useful match. Code relationship analysis follows imports in TypeScript, JavaScript, Python, Go, Rust, Java, and Kotlin.
Data belongs to the project owner. SQLite is the default local database, while Postgres and MongoDB are available when memory needs to be shared across machines.
How it works
Installation adds the project integration to Claude Code. Capture and recall run through hooks, so there is no separate background process to keep running. A session can leave information for the next chat, and later prompts can retrieve matching memories.
Existing repositories can be prepared with claude-db flush and claude-db scan. The scan creates a code map from the supported languages. /catchup retrieves where work stopped, /handoff writes a short note for a future chat or another person, and /cdb-scan maps an existing codebase from Claude Code.
Two features use Claude Haiku through the user’s own login: distillation of facts from completed chats and selection of memories for each prompt. Both can be disabled independently.
Setup and configuration
The package requires Node 22.16 or newer and a Git repository. Install it globally, change into the project directory, and run claude-db install --project. Restart Claude Code after installation. The cdb alias can be used in place of claude-db.
Use claude-db use <url> to switch the database connection to Postgres or MongoDB, using the documented pg or mongodb options. claude-db status reports wiring and recorded data, while claude-db doctor checks the setup and identifies problems.
Tools and capabilities
- Persist decisions, dead ends, and rules across Claude Code chats.
- Select relevant memories for individual prompts.
- Map definitions, callers, and imports across supported languages.
- Scan an existing repository into memory.
- Create catch-up and handoff notes.
- Inspect status and diagnose setup issues.
Limitations and notes
The claude-db MCP server is documented specifically for Claude Code; the supplied material does not establish support for other MCP clients. It is not cloud-hosted and does not include a subscription. Although memory remains in the selected database, two features send information through Claude Haiku using the user’s own login. Disable them with claude-db distill off and claude-db pick off when needed.
The tool excludes .env, secrets/, node_modules, and .git/ from storage. Text enclosed in <private>...</private> is removed, and API keys and tokens are redacted before data is written or sent. A daily npm version check can be disabled with updates: off. The project notes that benchmarks include cases where plain grep performs better, so code mapping is not necessarily the best choice for every lookup.