Claude Code Integration
Use RetainDB through MCP in Claude Code with the current primary verbs for retrieval, code search, and durable memory.
Applies to: Claude Code
Claude Code can Use RetainDB through MCP for:
- grounded project retrieval
- local code exploration
- durable memory for preferences and decisions
- context handoff across sessions
Setup
Follow Claude Code MCP Setup Guide to install the server and configure RETAINDB_API_KEY, RETAINDB_API_URL, and an optional default project.
Primary verbs to use in Claude Code
Start with these:
searchsearch_codegrepreadexploreresearchrememberrecordlearnshare_context
Use namespaced tools like context.query, memory.add, or code.search_semantic only when you need the explicit advanced surface.
Example workflows
Retrieve project context
Ask Claude Code to use search for the current architecture, then read a cited file if you need the exact implementation.
Save a durable decision
Ask Claude Code to use remember for facts that should survive the current session, such as coding standards or integration constraints.
Explore an unfamiliar repo
Ask Claude Code to use search_code for concepts, grep for exact symbols, and explore when you need to orient around the tree first.
Configuration
Example .claude/settings.local.json entry:
{
"mcpServers": {
"retaindb-context": {
"command": "npx",
"args": ["-y", "@retaindb/mcp-server@latest"],
"env": {
"RETAINDB_API_KEY": "rdb_...",
"RETAINDB_PROJECT": "my-project"
}
}
}
}Best practices
- store durable preferences with
remember, notrecord - use
searchfor stored RetainDB context andsearch_codefor local workspace concepts - keep the project default scoped when Claude Code is attached to one repo or environment
Next step
Was this page helpful?
Your feedback helps us prioritize docs improvements weekly.