MCP Server
Give any AI agent persistent memory across sessions, projects, and restarts. One server, 4 essential tools, zero configuration.
Two commands. No config files to edit.
Run setup to configure your editor, then login to enable cloud sync, cross-device memory, and intelligent extraction.
$ npx mentedb-mcp@latest setup copilot $ npx mentedb-mcp@latest login
Supports: copilot, claude, cursor, vscode
With login, MenteDB runs entirely in the cloud — contradiction detection, temporal invalidation, entity resolution, and semantic search all handled server-side. No local database, no file locks, multiple sessions run simultaneously.
Optional: run offline with local mode
If you need to work offline or prefer self-hosted, build from source with the local feature. Local mode uses an embedded database with on-device Candle embeddings. Only one instance can run at a time.
# Build with local mode support cargo install mentedb-mcp --features local # Run in local mode (no cloud, single instance) mentedb-mcp --local # Optionally add your own LLM for extraction export MENTEDB_LLM_PROVIDER=anthropic export MENTEDB_LLM_API_KEY=sk-ant-...
Use MENTEDB_LLM_PROVIDER=ollama for free local inference with Ollama.
The setup command auto-detects your OS, finds the config path, and writes the MCP server entry. Using npx mentedb-mcp@latest always runs the latest version — no manual updates needed.
Why use the MCP server?
Not just a memory store — a full cognitive layer that makes your agent smarter over time.
Zero Config
Two commands: setup and login. Lightweight 5MB binary, no API keys to manage, no GPU needed — cloud handles everything.
Persistent Memory
Memories survive across sessions, projects, and restarts. Your agent picks up exactly where it left off — on any device.
Multi-Session
No local database locks. Run multiple editor sessions simultaneously — all connected to the same cloud memory store.
Intelligent Extraction
Claude extracts structured memories from every turn. Contradictions are detected. Semantic search via Titan embeddings. 62/62 benchmark score.
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.
store_memoryStore a new memory with type, tags, and metadata
get_memoryRetrieve a specific memory by UUID
recall_memoryRecall a memory and boost its salience
search_memoriesSemantic similarity search across all memories
relate_memoriesCreate typed edges between memories
forget_memoryDelete a single memory
forget_allWipe all memories (requires confirmation)
ingest_conversationExtract structured memories from raw conversation text
Context Assembly
Build optimized context windows within a token budget.
assemble_contextAssemble an optimized context window with delta annotations for a given query and token budget
Knowledge Graph
Traverse relationships, find paths, and propagate beliefs.
get_relatedFind all memories related to a given memory
find_pathShortest path between two memories in the graph
get_subgraphExtract local subgraph within N hops
find_contradictionsFind memories that contradict a given memory
propagate_beliefPropagate confidence changes through the graph
Consolidation
Merge, compress, decay, and archive memories over time.
consolidate_memoriesCluster similar memories and merge them
apply_decayApply salience decay based on time and access
compress_memoryExtract key sentences, remove filler
evaluate_archivalEvaluate memories for archival or deletion
extract_factsExtract structured subject-predicate-object facts
gdpr_forgetGDPR-compliant data deletion with audit log
Cognitive
Pain signals, phantom detection, trajectory tracking, and interference.
record_painRecord a negative experience for future warnings
detect_phantomsScan for entities referenced but not in memory
resolve_phantomMark a knowledge gap as resolved
record_trajectoryTrack conversation trajectory for predictions
predict_topicsPredict likely next topics based on trajectory
detect_interferenceFind memories similar enough to cause confusion
check_streamCheck LLM output against known facts
write_inferenceRun write-time inference on a memory
register_entityRegister an entity for phantom detection
Pipeline
Full-turn processing, cognitive state, and database stats.
process_turnFull pipeline: search → extract → store → infer in one call
get_cognitive_statePain signals, phantoms, and trajectory predictions
get_statsMemory 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
{
"mcpServers": {
"mentedb": {
"command": "npx",
"args": ["-y", "mentedb-mcp@latest"],
"alwaysAllow": [
"process_turn", "store_memory",
"search_memories", "forget_memory"
]
}
}
}How it works
One tool call per turn. The server handles the rest.
Agent calls process_turn
Once per conversation turn, the agent sends the user message and its response. The server handles everything else automatically.
Server stores, searches & infers
The conversation is stored as searchable episodic memory. Relevant past context is retrieved. Write-time inference detects contradictions, creates edges, and updates confidence scores. Facts are extracted. Phantom entities are flagged.
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.
Context returned with full signals
Relevant past context, pain warnings, contradiction alerts, phantom counts, topic predictions — all in one round trip. Auto-maintenance (decay, archival, consolidation) runs periodically 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 on every conversation turn. Searches for relevant past context, stores the conversation as episodic memory, runs write-time inference (contradictions, edges, confidence), extracts facts and links them as edges, detects phantom entities, checks responses against known facts, and tracks trajectory. When an LLM provider is configured, also triggers sleeptime enrichment — automatically extracting semantic facts, linking entities, detecting communities, and building a user profile from accumulated conversations.
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.
What the setup command adds to your agent
① process_turn every turn (MANDATORY) — searches context, stores episodic memory, runs write-time inference, extracts and links facts, detects phantoms, checks for contradictions, tracks trajectory. Returns context the agent MUST use in its response.
② USE returned context (MANDATORY) — reference past memories, warn on pain signals, flag contradictions, anticipate next topics
③ store_memory when the LLM sees preferences, decisions, corrections, or procedures
④ Memory types — semantic, episodic, procedural, correction, anti_pattern, reasoning
⑤ Scope — contextual (similarity-based) or always (returned every turn for critical rules)
⑥ Tags — project names, topics, context labels for structured recall
⑥ Auto-maintenance — decay every 50 turns, archival every 100, consolidation every 200
⑦ Resilience — even if process_turn fails on a turn, always retry on the next turn. Never skip because of a prior error.
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.