Browse docs

Agents
Tap to expand
MCPUpdated 2026-05-30

MCP Setup

Connect RetainDB to MCP clients and expose the company brain to agents.

Applies to: RetainDB MCP

RetainDB MCP gives agent hosts direct tools for company knowledge, memory, source status, and handoffs.

Use it for Claude Code, Codex, Cursor, OpenCode, Windsurf, Cline, or any MCP-compatible client.

Install By Config

Most hosts can run the MCP server through npx:

json
{
  "mcpServers": {
    "retaindb": {
      "command": "npx",
      "args": ["-y", "@retaindb/mcp-server@latest"],
      "env": {
        "RETAINDB_API_KEY": "rdb_...",
        "RETAINDB_API_URL": "https://api.retaindb.com",
        "RETAINDB_PROJECT": "production"
      }
    }
  }
}

Merge this into your existing MCP config. Do not replace other servers.

Tool Surface

RetainDB MCP exposes the same core product surfaces as the dashboard and HTTP API.

Company Brain And Sources

ToolUse it for
contextask the company brain
searchsemantic search across indexed sources and local code
indexcreate a source from the agent host
list_sourcesinspect source status before relying on answers
update_sourceupdate source config and optionally resync
read_context_fileread /context/company.md or another agent filesystem file
list_context_filesbrowse agent filesystem paths

index is useful for agent-driven setup, but account-backed tools still need valid credentials or a connected account. For normal users, prefer the dashboard Sources and Connected Accounts flows.

Memory

ToolUse it for
rememberstore durable facts, preferences, and corrections
list_memoriesreview stored memories before deleting or correcting
forgetdelete incorrect memory
compressstore older conversation context as memory and keep recent turns

Agent Work

ToolUse it for
agent_eventrecord decision, failure, tool result, constraint, update, or observation
agent_contextretrieve task, agent, project, session, and user memory
agent_handoffcreate a handoff packet for another agent
agent_handoff_resumeresume a handoff into a new session

Project And Local Code Helpers

ToolUse it for
list_projectsfind the right project when multiple projects exist
greptext search local files from the agent runtime
readread a local file after grep finds it

First Verification

After restarting your MCP host, ask:

txt
List RetainDB sources and tell me which ones are ready.

Then:

txt
Ask RetainDB what the company brain knows about billing retries. Cite the source names if available.

Then:

txt
Read /context/company.md from RetainDB.

If these work, your agent can see RetainDB.

Suggested Agent Instruction

Add a short instruction to your agent or project rules:

txt
Use RetainDB when the task depends on company knowledge, project history, prior decisions, or user memory.
Call list_sources before relying on source data.
If RetainDB has no relevant context, say what is missing instead of guessing.

When To Use Which Tool

NeedTool
answer from company docs/repos/filescontext
check whether a source is usablelist_sources
create a manual source from the agent hostindex
inspect agent-readable summary filesread_context_file
remember a user preference or correctionremember
record important agent workagent_event
pass work to another agentagent_handoff
search local filesgrep, then read

Troubleshooting

SymptomFix
tools do not appearrestart host and confirm MCP config path
401verify RETAINDB_API_KEY is in the MCP env
empty answerscall list_sources; check RETAINDB_PROJECT
stale source answerssync or reconnect the source
agent ignores RetainDBadd an instruction that tells it when to call RetainDB

Next: Agent host snippets, Connect Agents, or Company Brain API.

Was this page useful?

Your feedback helps us make the product easier to ship with.