32 ToolsBeta

MCP Server

Give any AI agent persistent memory across sessions, projects, and restarts. One server, 32 tools, zero configuration.

One command. No config files to edit.

Install the binary and run the setup command for your client. The server writes the config file for you.

Terminal
# Install Rust: https://rustup.rs
$ cargo install mentedb-mcp

$ mentedb-mcp setup copilot  # or claude, cursor, vscode

The setup command auto-detects your OS, finds the config path, and writes the MCP server entry.

Why use the MCP server?

Not just a memory store — a full cognitive layer that makes your agent smarter over time.

Zero Config

Local Candle embeddings run on-device. No API keys, no external services, no network calls for core operations.

Persistent Memory

Memories survive across sessions, projects, and restarts. Your agent picks up exactly where it left off.

Belief Tracking

Graph-based supersession prevents stale information from poisoning context. Contradictions are detected and flagged automatically.

Delta Context

90.7% reduction in memory retrieval tokens over 20 turns. Only new and changed memories are sent in full — the rest are summarized.

32 Tools across 6 Categories

Everything an agent needs

From basic CRUD to cognitive signals, the MCP server exposes the full MenteDB surface area over the standard MCP protocol.

Core Memory

Store, retrieve, search, and manage individual memories.

8 tools
store_memory

Store a new memory with type, tags, and metadata

get_memory

Retrieve a specific memory by UUID

recall_memory

Recall a memory and boost its salience

search_memories

Semantic similarity search across all memories

relate_memories

Create typed edges between memories

forget_memory

Delete a single memory

forget_all

Wipe all memories (requires confirmation)

ingest_conversation

Extract structured memories from raw conversation text

Context Assembly

Build optimized context windows within a token budget.

1 tool
assemble_context

Assemble an optimized context window with delta annotations for a given query and token budget

Knowledge Graph

Traverse relationships, find paths, and propagate beliefs.

5 tools
get_related

Find all memories related to a given memory

find_path

Shortest path between two memories in the graph

get_subgraph

Extract local subgraph within N hops

find_contradictions

Find memories that contradict a given memory

propagate_belief

Propagate confidence changes through the graph

Consolidation

Merge, compress, decay, and archive memories over time.

6 tools
consolidate_memories

Cluster similar memories and merge them

apply_decay

Apply salience decay based on time and access

compress_memory

Extract key sentences, remove filler

evaluate_archival

Evaluate memories for archival or deletion

extract_facts

Extract structured subject-predicate-object facts

gdpr_forget

GDPR-compliant data deletion with audit log

Cognitive

Pain signals, phantom detection, trajectory tracking, and interference.

9 tools
record_pain

Record a negative experience for future warnings

detect_phantoms

Scan for entities referenced but not in memory

resolve_phantom

Mark a knowledge gap as resolved

record_trajectory

Track conversation trajectory for predictions

predict_topics

Predict likely next topics based on trajectory

detect_interference

Find memories similar enough to cause confusion

check_stream

Check LLM output against known facts

write_inference

Run write-time inference on a memory

register_entity

Register an entity for phantom detection

Pipeline

Full-turn processing, cognitive state, and database stats.

3 tools
process_turn

Full pipeline: search → extract → store → infer in one call

get_cognitive_state

Pain signals, phantoms, and trajectory predictions

get_stats

Memory count, edge count, and type breakdown

Client Configuration

The setup command handles this automatically, but here are the configs if you prefer manual setup. Use alwaysAllow to skip per-tool approval prompts.

Auto Setup

$ mentedb-mcp setup copilot

Embedding Provider

MenteDB uses local Candle embeddings by default — no API keys needed. For higher accuracy, set an OpenAI or Anthropic key:

$ export OPENAI_API_KEY=sk-...       # or
$ export ANTHROPIC_API_KEY=sk-ant-...

The server auto-detects the key and switches provider. Remove the variable to revert to local embeddings.

Found a bug or have a feature request? Open an issue on GitHub

Manual Config

~/.copilot/mcp-config.json
{
  "mcpServers": {
    "mentedb": {
      "command": "mentedb-mcp",
      "args": ["--data-dir", "./agent-memory"]
    }
  }
}

How it works

One tool call per turn. The server handles the rest.

1

Agent calls process_turn

Once per conversation turn, the agent sends the user message and its response. The server searches for relevant context and returns it.

2

Server stores & searches

The conversation is stored as searchable episodic memory with Candle embeddings. Pain signals and trajectory are tracked automatically.

3

LLM stores important facts

The LLM recognises preferences, decisions, and corrections during the conversation and calls store_memory with the right type and tags. No second model needed — the conversation LLM is the extraction engine.

4

Context returned with warnings

Relevant past context, pain warnings, and topic predictions — all in one round trip. Auto-maintenance (decay, archival, consolidation) runs in the background.

Built-in agent instructions

The setup command injects instructions that teach your LLM how to use MenteDB. No prompt engineering required.

process_turn — every turn

Called automatically on every conversation turn. Searches for relevant past context, stores the conversation as episodic memory, checks pain signals, and tracks the conversation trajectory. This is the memory loop.

context retrievalepisodic storagepain warnings

store_memory — when it matters

The LLM calls this when it notices important information — preferences, decisions, corrections, procedures. The conversation LLM is the extraction engine. No second model needed.

semantic factscorrectionsanti-patterns

What the setup command adds to your agent

① process_turn every turn — searches context, stores episodic memory, checks pain signals

② store_memory when the LLM sees preferences, decisions, corrections, or procedures

③ Memory types — semantic, episodic, procedural, correction, anti_pattern

④ Tags — project names, topics, context labels for structured recall

These instructions are written to a copilot-instructions.md or equivalent file for your client. The LLM reads them at session start and follows them automatically.

Ready to give your agent a mind?

Install the MCP server and start building agents that remember.