Integrations

MCP server and tools

Connect an existing AI tool to your memory with one command.

llms.txt

MenteDB ships a lightweight server binary that connects an existing AI tool to your memory: lifecycle hooks on Claude Code, MCP tools everywhere else. Cloud mode when logged in (no local database, multiple sessions simultaneously) or fully offline local mode, which ships in the npx binary. A small set of essential tools (4 locally, 5 in cloud mode), zero configuration.

The same MCP endpoint also connects ChatGPT (add it as a connector with developer mode enabled, Plus and above) and the Gemini CLI (add it as an MCP server), with the usual MCP caveat that tools are model invoked. Claude Cowork installs the MenteDB plugin instead: /plugin marketplace add nambok/mentedb-mcp then /plugin install mentedb@mentedb. The plugin bundles the connection, a standing memory skill that recalls before every reply and captures every turn, and the same lifecycle hooks Claude Code uses, so memory becomes fully deterministic the moment Cowork enables per turn hook events.

This connector is for wiring MenteDB into an existing tool. If you are building your own agent, use the SDK or REST examples in Build an agent.

Connect a tool

Auto-configure MenteDB for your client with one command. This creates the MCP config (or hooks, on Claude Code), agent instructions, and alwaysAllow list automatically.

Terminal
# Claude Code (lifecycle hooks)
npx mentedb-mcp@latest setup claude-code

# GitHub Copilot CLI
npx mentedb-mcp@latest setup copilot

# Claude Desktop
npx mentedb-mcp@latest setup claude

# Cursor
npx mentedb-mcp@latest setup cursor

Claude app custom connector

On claude.ai and the Claude apps, add MenteDB as a custom connector with just the URL, no install. Open Settings, Connectors, Add custom connector, and paste:

Terminal
https://api.mentedb.com/mcp

Claude discovers the authorization server automatically, sends you to sign in and approve access, then has your memory everywhere the Claude app runs, including iOS and Android. Discovery, dynamic registration, and PKCE are handled automatically.

Login and cloud mode

Login enables cloud mode, the server becomes a thin HTTP client that forwards all operations to MenteDB Cloud. Embeddings, extraction, and storage are all handled server-side.

Terminal
npx mentedb-mcp@latest login
npx mentedb-mcp@latest status   # health: auth, daemon, cloud reachability, sync backlog

On a remote or SSH session the browser cannot reach the CLI directly. After you authorize, the page shows a connection code instead, paste it into the waiting terminal and login completes the same way.

Keeping it updated

The @latest tag means every run fetches the newest published connector, so you are usually current already. To refresh the MCP config and the agent instructions and hooks that setup wrote into your client, run update for that client:

Terminal
npx mentedb-mcp@latest update claude-code   # or: cursor, copilot, claude

Update shows the exact changes before writing, backs up to a .bak file if you customized the MenteDB block, and preserves any instructions of your own outside it.

Cloud mode benefits (default after login):

  • No local database, no file locks, multiple sessions simultaneously
  • Memories sync across all devices automatically
  • LLM-powered extraction server-side
  • Semantic search via server-side embeddings
  • Contradiction detection and entity resolution
  • Dashboard with analytics, memory type distribution, and health metrics
  • Interactive graph of the relationships between your memories
  • Settings page for decay and export preferences

Local mode (offline)

Login is optional. Without it, the hooks run a local daemon with the embedded engine, memories stay on your machine and everything works offline. Set MENTEDB_LLM_PROVIDER to enable LLM extraction locally, or log in later to switch to cloud extraction; run mentedb-mcp sync to push existing local memories up. Use the --local flag with local Candle embeddings; multiple processes can share it, writes take a cross-process file lock and reads are lock-free.

Terminal
# Run in local mode (no cloud)
mentedb-mcp --local

# With LLM extraction in local mode
mentedb-mcp --local --llm-provider anthropic

Manual JSON config

Claude Desktop:

JSON
{
  "mcpServers": {
    "mentedb": {
      "command": "npx",
      "args": ["-y", "mentedb-mcp@latest"]
    }
  }
}

GitHub Copilot CLI (file: ~/.copilot/mcp-config.json):

JSON
{
  "mcpServers": {
    "mentedb": {
      "command": "npx",
      "args": ["-y", "mentedb-mcp@latest"],
      "alwaysAllow": [
        "process_turn", "store_memory",
        "search_memories", "forget_memory"
      ]
    }
  }
}

The alwaysAllow list lets the 4 essential memory tools run without approval prompts. Remove it if you prefer manual approval per tool call.

For a cloud connection with an API key instead of the local daemon, point any MCP-compatible client at the URL with a Bearer header:

JSON
{
  "mcpServers": {
    "mentedb": {
      "url": "https://api.mentedb.com/mcp",
      "headers": {
        "Authorization": "Bearer mdb_your_key_here"
      }
    }
  }
}

Generated agent instructions

The mentedb-mcp setupcommand writes the following instructions to your agent's config (e.g. copilot-instructions.md). This is what teaches the LLM to use MenteDB automatically:

markdown
# Memory

You have persistent memory via MenteDB. You have 4 tools, use them.

## process_turn, CALL EVERY TURN

Call `process_turn` on EVERY turn. Pass `user_message` and `assistant_response`.
- It returns relevant context from past conversations, stores the current turn, and detects contradictions.
- Without this call, nothing is remembered.
- Increment `turn_id` each turn (start at 0).
- `assistant_response` can be brief or empty if you have not yet drafted a response.

## USE the returned context

When `process_turn` returns:
- context: Summaries with IDs from past conversations. Reference them in your response.
- pain_warnings: If non-empty, WARN the user, a similar situation caused problems before.
- contradictions: If > 0, flag the inconsistency.

## store_memory, Save important facts

When you notice important information, call `store_memory`:
- Preferences: "User prefers Rust" -> type: semantic, tags: [preference]
- Decisions: "Using PostgreSQL" -> type: semantic, tags: [decision]
- Corrections: "Deadline is April, not March" -> type: correction
- Procedures: "Deploy with: cargo build --release" -> type: procedural
- Mistakes: "Never retag releases" -> type: anti_pattern

When the user explicitly says "remember this", "always remember", "don't forget", or similar, call `store_memory` immediately in that same turn. Do not rely on process_turn extraction for explicit requests.

Don't store chitchat. Store facts, preferences, decisions, corrections.

## search_memories, Look things up

Pass a text query to search by similarity, or a memory UUID to get full content.
Use proactively, if the user mentions a project, search for what you know about it.

## forget_memory, Delete memories

When the user says "forget" or "don't remember that", delete the memory by ID.

## Scope

Set `scope: 'always'` for critical rules that must be surfaced every turn regardless of topic. Default is `scope: 'contextual'` (retrieved by semantic similarity). Use `'always'` when the user says "always remember this" or states a hard rule.

## Writing good memories

- One fact per memory, self-contained with project context
- Keep under 200 words. Summarize if needed.
- If a fact changes, store as a `correction`, contradictions are detected automatically.
- Do NOT store: greetings, temporary info, large code blocks, one-off details

## Resilience

Even if `process_turn` fails or errors on a turn, ALWAYS call it again on the next turn. Never skip because of a prior failure.

Essential tools by default (32 with --full-tools in local mode)

Locally the connector exposes four tools by default: process_turn (call every turn), store_memory, search_memories, and forget_memory. Pass --full-tools (local mode only) to expose all 32, grouped below. In cloud mode it adds store_memories for batch writes, and the hosted URL connector also offers list_memories, get_recent_activity, get_session_context, get_injection_context, get_action_rules, ingest_agent_file, get_ingest_status, record_injection_outcome, and store_memory_multimodal.

Memory7 tools
store_memorysearch_memoriesrecall_memoryget_memoryforget_memoryforget_allingest_conversation
Turn and context3 tools
process_turnassemble_contextget_stats
Graph6 tools
relate_memoriesget_relatedfind_pathget_subgraphfind_contradictionspropagate_belief
Consolidation6 tools
consolidate_memoriesapply_decaycompress_memoryevaluate_archivalextract_factsgdpr_forget
Cognitive10 tools
record_paindetect_phantomsresolve_phantomrecord_trajectorypredict_topicsdetect_interferenceregister_entityget_cognitive_statecheck_streamwrite_inference

See mentedb-mcp for setup, configuration, and the full list of tools.