mem0-mcp-selfhosted
The mem0-mcp-selfhosted server provides persistent memory management for Claude Code through 11 MCP tools, enabling cross-session context retention with optional knowledge graph capabilities using Qdrant, Neo4j, and Ollama.
Core Memory Operations
add_memory— Store text or conversation history as memories, with optional LLM-based fact extraction, metadata tagging, and per-call graph togglingsearch_memories— Semantically search memories using natural language queries, with filters, relevance thresholds, reranking, and optional graph searchget_memories— Page through memories using scope filters (user, agent, run) without semantic searchget_memory— Fetch a single memory by UUIDupdate_memory— Overwrite and re-embed an existing memory's text by UUIDdelete_memory— Delete a single memory by UUIDdelete_all_memories— Bulk-delete all memories within a given scope
Entity & Graph Management
list_entities— List all users, agents, and runs with stored memories and countsdelete_entities— Cascade-delete an entire entity and all its associated memoriesmcp_search_graph— Search the Neo4j knowledge graph for entities by name/topic, returning entities and outgoing relationshipsmcp_get_entity— Retrieve all bidirectional relationships for a specific entity in the knowledge graph
Additional Features
Session hooks for automatic memory injection on startup and summary saving on exit
CLAUDE.md integration to instruct Claude Code to proactively use memory tools
Flexible LLM configuration: Anthropic (Claude), Ollama, or Gemini for main LLM, embeddings, and graph operations
Multiple transport modes: stdio, SSE, and streamable-http
Automatic OAT token handling for zero-config use within Claude Code
Structured filter support (
AND/ORoperators) and scoped memory viauser_id,agent_id,run_idSuppressed telemetry for privacy
Supports using Google Gemini models as a provider for knowledge graph extraction and entity relationship processing.
Integrates with Neo4j as a knowledge graph backend to store and retrieve bidirectional entity relationships.
Enables fully local operation by using Ollama for both embedding generation and as the primary LLM for memory management.
mem0-mcp-selfhosted
Self-hosted mem0 MCP server for Claude Code. Run a complete memory server against self-hosted Qdrant + Neo4j + Ollama, with your choice of Anthropic (Claude) or Ollama as the main LLM.
Uses the mem0ai package directly as a library, supports both Claude's OAT token and fully local Ollama setups, and exposes 11 MCP tools for full memory management.
Prerequisites
Service | Required | Purpose |
Qdrant | Yes | Vector memory storage and search |
Ollama | Yes | Embedding generation ( |
Neo4j 5+ | Optional | Knowledge graph (entity relationships) |
Google API Key | Optional | Required only for |
Python >= 3.10 and uv.
Authentication: The default setup uses Claude (Anthropic) as the LLM for fact extraction. No API key needed, the server automatically uses your Claude Code session token. For fully local setups, set
MEM0_PROVIDER=ollama. See Authentication for advanced options.
Related MCP server: mem0-mcp
Quick Start
Default (Anthropic)
Add the MCP server globally (available across all projects):
claude mcp add --scope user --transport stdio mem0 \
--env MEM0_USER_ID=your-user-id \
-- uvx --from git+https://github.com/elvismdev/mem0-mcp-selfhosted.git mem0-mcp-selfhostedAll defaults work out of the box: Qdrant on localhost:6333, Ollama embeddings on localhost:11434 with bge-m3 (1024 dims). Override any default via --env (see Configuration).
uvx automatically downloads, installs, and runs the server in an isolated environment, no manual installation needed. Claude Code launches it on demand when the MCP connection starts.
The server auto-reads your OAT token from ~/.claude/.credentials.json, no manual token configuration needed.
Fully Local (Ollama)
For a fully local setup with no cloud dependencies, use Ollama for both the main LLM and embeddings:
claude mcp add --scope user --transport stdio mem0 \
--env MEM0_PROVIDER=ollama \
--env MEM0_LLM_MODEL=qwen3:14b \
--env MEM0_USER_ID=your-user-id \
-- uvx --from git+https://github.com/elvismdev/mem0-mcp-selfhosted.git mem0-mcp-selfhostedMEM0_PROVIDER=ollama cascades to both the main LLM and graph LLM providers. Same infrastructure defaults apply (Qdrant on localhost:6333, bge-m3 embeddings). Per-service overrides (e.g. MEM0_LLM_URL, MEM0_EMBED_URL) still work when needed.
Or add it to a single project by creating .mcp.json in the project root:
{
"mcpServers": {
"mem0": {
"command": "uvx",
"args": ["--from", "git+https://github.com/elvismdev/mem0-mcp-selfhosted.git", "mem0-mcp-selfhosted"],
"env": {
"MEM0_PROVIDER": "ollama",
"MEM0_LLM_MODEL": "qwen3:14b",
"MEM0_USER_ID": "your-user-id"
}
}
}
}Try It
Restart Claude Code, then:
> Search my memories for TypeScript preferences
> Remember that I prefer Hatch for Python packaging
> Show me all entities in my knowledge graphCLAUDE.md Integration
Add these rules to your project's CLAUDE.md (or ~/.claude/CLAUDE.md for global use) so Claude Code proactively uses memory tools throughout the session:
# MCP Servers
- **mem0**: Persistent memory across sessions. At the start of each session, `search_memories` for relevant context before asking the user to re-explain anything. Use `add_memory` whenever you discover project architecture, coding conventions, debugging insights, key decisions, or user preferences. Use `update_memory` when prior context changes. Save information like: "This project uses PostgreSQL with Prisma", "Tests run with pytest -v", "Auth uses JWT validated in middleware". When in doubt, save it, future sessions benefit from over-remembering.This gives Claude Code behavioral instructions to actively search and save memories during the session. For best results, combine with Claude Code Hooks, the CLAUDE.md rules tell Claude how to use memory tools mid-session, while hooks handle the automatic injection and saving at session boundaries.
Claude Code Hooks
Session hooks automate memory at session boundaries, injecting memories on startup and saving summaries on exit. This happens automatically without manual tool calls.
Hook | Event | What it does |
| SessionStart ( | Searches mem0 for project-relevant memories and injects them as |
| Stop | Reads the last ~3 user/assistant exchanges from the transcript and saves a summary to mem0 via |
Both hooks are non-fatal, if mem0 is unreachable or any error occurs, Claude Code continues normally.
Install
Install hooks into your project:
mem0-install-hooksOr install globally (all projects):
mem0-install-hooks --globalThis adds the hook entries to .claude/settings.json. The installer is idempotent, running it twice won't create duplicates.
How it works
On session start, the context hook searches mem0 with two queries (project architecture + recent session summaries), deduplicates by memory ID, and formats the results as numbered lines under a # mem0 Cross-Session Memory header. These are injected via the hook's additionalContext response field.
On session stop, the stop hook reads the JSONL transcript, extracts the last 6 user/assistant messages (a sliding window via bounded deque), builds a summary prompt, and calls memory.add(infer=True) to extract atomic facts. Graph is force-disabled in hooks to stay within the 15s/30s timeout budgets.
Entry points
Command | Function | Registered in |
|
| SessionStart hook |
|
| Stop hook |
|
| CLI installer |
Hooks + CLAUDE.md
Hooks and CLAUDE.md are complementary layers that work best together:
Layer | Role | When |
Hooks | Automated data flow, injects stored memories on startup, saves session summaries on exit | Session boundaries (start/stop) |
CLAUDE.md | Behavioral instructions, tells Claude to actively search and save memories during the session | Throughout the session |
Hooks alone give you passive recall (memories appear at startup) and passive saving (summaries saved at exit). CLAUDE.md instructions add active mid-session behavior, Claude searches for relevant memories when encountering new topics, and saves important discoveries immediately rather than waiting for session end.
For the best experience, use both. Hooks ensure memories flow in and out automatically at session boundaries, while CLAUDE.md ensures Claude actively engages with memory tools during the session.
Authentication
The server resolves an Anthropic token using a prioritized fallback chain:
Priority | Source | Details |
1 |
| Explicit, user-controlled |
2 |
| Auto-reads Claude Code's OAT token (zero-config) |
3 |
| Standard pay-per-use API key |
4 | Disabled | Warns and disables Anthropic LLM features |
In Claude Code, priority 2 always wins, the credentials file exists as long as you're logged in. This means ANTHROPIC_API_KEY (priority 3) is never reached. To override the OAT token in Claude Code, use MEM0_ANTHROPIC_TOKEN (priority 1). ANTHROPIC_API_KEY is only useful for non-Claude-Code deployments (Docker, CI, standalone).
OAT tokens (sk-ant-oat...) use your Claude subscription. The server automatically detects the token type and configures the SDK accordingly. OAT tokens are automatically refreshed before expiry: the server proactively checks the token lifetime and refreshes via the Anthropic OAuth endpoint when nearing expiry (default: 30 minutes). On authentication failures, a 3-step defensive strategy kicks in, piggybacking on Claude Code's credentials file, self-refreshing via OAuth, and wait-and-retry, so long-running sessions survive token rotation seamlessly.
API keys (sk-ant-api...) use standard pay-per-use billing.
Tools
Memory Tools (9 core)
Tool | Description |
| Store text or conversation history as memories. Supports |
| Semantic search with optional |
| List/filter memories (non-search). Supports |
| Fetch a single memory by UUID. |
| Replace memory text. Re-embeds and re-indexes in Qdrant. |
| Delete a single memory by UUID. |
| Bulk-delete all memories in a scope. |
| List users/agents/runs with memory counts. Uses Qdrant Facet API. |
| Cascade-delete an entity and all its memories. |
Graph Tools
Tool | Description |
| Search Neo4j entities by name substring. Returns entities + outgoing relationships. |
| Get all relationships for an entity (bidirectional: incoming + outgoing). |
Prompt
The server registers a memory_assistant MCP prompt that provides Claude with a quick-start guide for using the memory tools effectively.
Parameters
All tools use Pydantic Annotated[type, Field(description=...)] for self-documenting parameter schemas. Common patterns:
user_iddefaults toMEM0_USER_IDenv var when not providedenable_graphoverrides the defaultMEM0_ENABLE_GRAPHper-callfilterssupports structured operators:{"key": {"eq": "value"}},{"AND": [...]}All responses are JSON strings via
json.dumps(result, ensure_ascii=False)
Configuration
All configuration is via environment variables. Create a .env file or set them in your MCP config.
Authentication
Variable | Default | Description |
| -- | Anthropic OAT or API token (priority 1) |
| -- | Standard Anthropic API key (priority 3) |
|
| OAT identity headers: |
|
| Seconds before expiry to trigger proactive OAT token refresh |
LLM
Variable | Default | Description |
|
| Top-level provider ( |
| (MEM0_PROVIDER) | Main LLM provider: |
|
| Shared Ollama base URL. Cascades to |
| (per-provider) | Model for the selected LLM provider. Defaults to |
| (cascades) | Ollama base URL for the main LLM. Cascades: |
|
| Max tokens for LLM responses (Anthropic only) |
| (MEM0_PROVIDER) | Graph LLM provider ( |
| (cascades) | Ollama base URL for graph LLM. Cascades: |
| (varies) | Graph model. Inherits |
| -- | Google API key (required for |
|
| Contradiction LLM provider in |
| (provider-aware) | Contradiction model in |
|
| How long Ollama keeps the model in VRAM between calls (e.g., |
|
| Set to |
Embedder
Variable | Default | Description |
|
| Embedding provider ( |
|
| Embedding model name |
| (cascades) | Ollama URL for embeddings. Cascades: |
|
| Embedding vector dimensions |
Vector Store (Qdrant)
Variable | Default | Description |
|
| Qdrant REST API URL |
| -- | Qdrant API key (for Qdrant Cloud) |
|
| Store vectors on disk (reduces RAM, slower search) |
| (client default) | Qdrant REST API timeout in seconds (e.g., |
|
| Qdrant collection name |
Graph Store (Neo4j)
Variable | Default | Description |
|
| Enable graph memory (entity extraction to Neo4j) |
|
| Neo4j Bolt endpoint |
|
| Neo4j username |
|
| Neo4j password |
| -- | Neo4j database name (multi-database setups) |
| -- | Custom Neo4j base label for node type grouping |
|
| Embedding similarity threshold for node matching |
Server
Variable | Default | Description |
|
| Transport: |
|
| Host for SSE/HTTP transports |
|
| Port for SSE/HTTP transports |
|
| Default user ID for memory scoping |
|
| Logging level ( |
| -- | SQLite path for memory change history |
Architecture
Claude Code
|
├── MCP stdio/SSE/streamable-http
│ |
│ ├── env.py ← Centralized env var readers (whitespace-safe)
│ ├── auth.py ← Hybrid token fallback chain + OAT self-refresh
│ ├── llm_anthropic.py ← Custom Anthropic LLM provider (OAT + structured outputs)
│ ├── llm_ollama.py ← Custom Ollama LLM provider (restored tool-calling)
│ ├── config.py ← Env vars → MemoryConfig dict (provider + URL cascades)
│ ├── helpers.py ← Error wrapper, concurrency lock, safe bulk-delete, monkey-patches
│ ├── graph_tools.py ← Direct Neo4j Cypher queries (lazy driver)
│ ├── llm_router.py ← Split-model graph LLM router (gemini_split)
│ ├── __init__.py ← Telemetry suppression (before any mem0 import)
│ └── server.py ← FastMCP orchestrator (11 tools + prompt)
│ |
│ ├── mem0ai Memory class
│ │ ├── Vector: LLM fact extraction → Ollama embed → Qdrant
│ │ └── Graph: LLM entity extraction (tool calls) → Neo4j
│ |
│ └── Infrastructure
│ ├── Qdrant ← Vector store
│ ├── Ollama ← Embeddings
│ ├── Neo4j ← Knowledge graph (optional)
│ └── Anthropic/Ollama ← Main LLM (configurable)
|
└── Session Hooks (subprocess, not MCP)
|
└── hooks.py ← Cross-session memory (SessionStart + Stop hooks)
├── context_main() → Injects memories as additionalContext on startup/compact
├── stop_main() → Saves session summary to mem0 on exit
└── install_main() → CLI to patch .claude/settings.jsonGraph Memory & Quota
Graph memory is disabled by default (MEM0_ENABLE_GRAPH=false) to protect your Claude quota. Each add_memory with graph enabled triggers 3 additional LLM calls for entity extraction, relationship generation, and conflict resolution.
Using Ollama for Graph Operations
To eliminate Claude quota usage for graph ops, use a local Ollama model:
MEM0_ENABLE_GRAPH=true
MEM0_GRAPH_LLM_PROVIDER=ollama
MEM0_GRAPH_LLM_MODEL=qwen3:14bQwen3:14b has 0.971 tool-calling F1 (nearly matching GPT-4's 0.974) and runs in ~7-8GB VRAM with Q4_K_M quantization.
Using Gemini for Graph Operations
Google's Gemini 2.5 Flash Lite is the cheapest option for graph ops while maintaining strong entity extraction accuracy:
MEM0_ENABLE_GRAPH=true
MEM0_GRAPH_LLM_PROVIDER=gemini
MEM0_GRAPH_LLM_MODEL=gemini-2.5-flash-lite
GOOGLE_API_KEY=your-google-api-keyUsing Split-Model for Best Accuracy
The gemini_split provider routes graph pipeline calls to different LLMs based on the operation. Entity extraction (Calls 1 & 2) goes to Gemini for speed and cost; contradiction detection (Call 3) goes to Claude for accuracy.
MEM0_ENABLE_GRAPH=true
MEM0_GRAPH_LLM_PROVIDER=gemini_split
GOOGLE_API_KEY=your-google-api-key
MEM0_GRAPH_CONTRADICTION_LLM_PROVIDER=anthropic
MEM0_GRAPH_CONTRADICTION_LLM_MODEL=claude-opus-4-6Benchmark results across 248 test cases: Gemini scores 85.4% on entity extraction (vs Claude's 79.1%), while Claude scores 100% on contradiction detection (vs Gemini's 80%). The split-model combines the best of both.
Transport Modes
Mode | Use Case | Config |
| Claude Code integration |
|
| Legacy remote clients |
|
| Modern remote clients |
|
For remote deployments, MCP SDK >= 1.23.0 enables DNS rebinding protection by default.
Development
# Install with dev dependencies
pip install -e ".[dev]"
# Run unit tests
python3 -m pytest tests/unit/ -v
# Run contract tests (validates mem0ai internal API assumptions)
python3 -m pytest tests/contract/ -v
# Run integration tests (requires live Qdrant + Neo4j + Ollama)
python3 -m pytest tests/integration/ -v
# Run all tests
python3 -m pytest tests/ -vTest Structure
tests/unit/-- Pure unit tests with mocked dependencies (env, auth, config, config matrix, concurrency, MCP protocol, helpers, hooks, LLM providers, graph tools, LLM router, server)tests/contract/-- Validates assumptions about mem0ai internals (schema detection invariant,vector_store.clientaccess path,LlmFactoryregistration idempotency)tests/integration/-- Live infrastructure tests (memory lifecycle, graph ops, bulk operations, hooks) against real Qdrant + Neo4j + Ollama. Marked with@pytest.mark.integration.
Contract tests catch breaking changes in mem0ai upgrades before they reach production.
Telemetry
All mem0ai telemetry is suppressed. os.environ["MEM0_TELEMETRY"] = "false" is set at package import time, before any mem0 module is loaded. No PostHog events are sent.
License
MIT
Available Tools
11 toolsadd_memoryA
Store a new memory. Requires at least one of user_id, agent_id, or run_id.
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to store as a memory. Converted to messages format internally. | |
| messages | No | Structured conversation history (role/content dicts). When provided, takes precedence over text. | |
| user_id | No | User scope identifier. Defaults to MEM0_USER_ID. | |
| agent_id | No | Agent scope identifier. | |
| run_id | No | Run scope identifier. | |
| metadata | No | Arbitrary metadata JSON to store alongside the memory. | |
| infer | No | If true (default), LLM extracts key facts. If false, stores raw text. | |
| enable_graph | No | Override default graph toggle for this call. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden but only states 'Store a new memory.' It omits behavioral traits such as whether this is a write operation, side effects, or authorization needs. The constraint on scope IDs is noted but insufficient for full transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the core purpose. Every word adds value, and there is no unnecessary repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (8 parameters, output schema exists), the description is adequate but incomplete. It does not clarify behavior for parameters like 'infer' or 'enable_graph,' though these are documented in the schema. Output schema mitigates need for return value explanation, but the description could provide more behavioral context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description adds value by stating that at least one of user_id, agent_id, or run_id is required—a cross-parameter constraint not explicit in the schema alone. This justifies a score above baseline.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Store a new memory,' which is a specific verb+resource. It distinguishes this from sibling tools like delete_memory or get_memories, which have different purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description includes a requirement ('at least one of user_id, agent_id, or run_id'), which provides context for valid invocations. However, it does not offer guidance on when to use this tool versus alternatives like search_memories or update_memory.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delete_all_memoriesA
Bulk-delete all memories in the given scope. Requires at least one filter.
NEVER calls memory.delete_all() — uses safe bulk-delete instead.
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | No | User scope to delete. | |
| agent_id | No | Agent scope to delete. | |
| run_id | No | Run scope to delete. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses that the tool does not call raw delete_all but uses a safe bulk-delete, implying safety. However, it omits details on destructiveness, reversibility, or auth needs, which are important for a deletion tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is highly concise: two sentences that front-load the purpose and key constraint (requires filter). Every sentence earns its place with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
While the description covers purpose and filter requirement, it lacks return value information. There is no output schema to compensate, so the agent is left guessing about what the tool returns (e.g., count, confirmation). For a bulk deletion tool, this is a notable gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with clear descriptions for each parameter (run_id, user_id, agent_id). The description adds no additional meaning beyond the schema, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Bulk-delete') and resource ('all memories in the given scope'). It distinguishes from siblings like 'delete_memory' by specifying bulk operation and requiring a filter.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says 'Requires at least one filter,' providing clear usage context. It also notes the safe bulk-delete implementation, but does not explicitly mention alternatives like 'delete_memory' for single deletions or when not to use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delete_entitiesA
Delete an entity and cascade-delete all its memories.
Functionally equivalent to delete_all_memories in self-hosted mode.
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | No | User entity to delete (cascades to all memories). | |
| agent_id | No | Agent entity to delete. | |
| run_id | No | Run entity to delete. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses cascade-deletion behavior, but does not mention irreversibility, required permissions, or error states. The description is adequate but not rich.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences with no fluff. The first states the core action, the second provides helpful context. Every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description and schema together cover the basic delete behavior, but they do not specify that exactly one entity identifier must be provided. Given the absence of required parameters, this is a notable gap. An output schema exists but its contents are not visible.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the schema already describes each parameter. The description adds 'cascade-delete all its memories' but this is implicitly clear from the schema. No additional semantic value beyond what the schema provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'delete' and resource 'entity', and specifies cascade-deletion of memories. It also distinguishes itself by noting functional equivalence to delete_all_memories, differentiating from sibling tools that delete single memories.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description mentions equivalence to delete_all_memories but does not explicitly guide when to use this tool versus alternatives like delete_memory or delete_all_memories. It lacks explicit when-to-use or when-not-to-use instructions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delete_memoryB
Delete a single memory.
| Name | Required | Description | Default |
|---|---|---|---|
| memory_id | Yes | Exact memory UUID to delete. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden but only states the destructive action. No details on permissions, reversibility, or side effects are provided.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Extremely concise at 4 words, front-loaded with the action, and no wasted text. Appropriate for a simple tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a straightforward delete tool with one parameter and an output schema, the description covers the basic purpose. However, it lacks any additional context such as requirements or limitations.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% for the single parameter, but the description adds no extra meaning beyond the schema's 'Exact memory UUID to delete.' Baseline 3 is appropriate as the description does not enhance parameter understanding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Delete a single memory' uses a specific verb and resource, clearly distinguishing from sibling tools like delete_all_memories.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives such as delete_all_memories or delete_entities. The description lacks context for usage decisions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_memoriesA
Page through memories using filters instead of search.
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | No | User scope. Defaults to MEM0_USER_ID. | |
| agent_id | No | Agent scope. | |
| run_id | No | Run scope. | |
| limit | No | Maximum number of memories to return. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It implies a read operation but does not disclose pagination mechanics, ordering, rate limits, or any side effects. The behavioral disclosure is minimal.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single 8-word sentence that is front-loaded and contains no wasted words, perfectly concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Output schema exists, so return values are covered. The description addresses the core purpose but omits details like pagination requiring multiple calls, default limits, or sorting. It is minimally complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all parameters. The description adds only the high-level hint 'using filters', providing no extra meaning. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Page through memories using filters instead of search' clearly specifies the verb ('page through'), resource ('memories'), and contrasts with the sibling tool 'search_memories', making the purpose unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states 'instead of search', guiding the agent to use this tool when filtering rather than full-text searching. It gives clear context but does not explicitly list when not to use or describe prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_memoryB
Fetch a single memory by its ID.
| Name | Required | Description | Default |
|---|---|---|---|
| memory_id | Yes | Exact memory UUID to fetch. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, and description only says 'fetch', implying read-only but omitting behaviors like error handling, return format, or rate limits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Very concise single sentence, but it lacks necessary context; conciseness is achieved at the expense of completeness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite simple tool (1 parameter, output schema exists), description misses usage context and behavioral details, making it incomplete for effective agent use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with description 'Exact memory UUID to fetch'; description adds 'by its ID' but that's redundant, not adding value beyond schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the verb 'fetch', resource 'a single memory', and method 'by its ID', distinguishing it from siblings like get_memories and search_memories.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives like search_memories or when not to use it; usage is only implied.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_entitiesB
List which users/agents/runs currently hold memories.
Uses Qdrant Facet API (v1.12+) for server-side aggregation, with scroll+dedupe fallback for older versions.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description provides some behavioral context: it uses server-side aggregation with fallback for older versions. However, it doesn't disclose read-only nature, performance implications, or what 'holds memories' entails.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise (two sentences) and front-loads the primary purpose. The technical detail about Qdrant is somewhat jargon-heavy but not excessive. No wasted sentences.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no parameters and an output schema exists, the description is adequate but lacks context about what 'holds memories' means, the scope of the list, or any constraints. It could be more complete for a tool with many siblings.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has no parameters and 100% coverage trivially, so baseline is 3. The description adds no parameter information beyond the schema, which is acceptable since there are no parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool lists which users/agents/runs hold memories. It uses a specific verb and resource, but doesn't explicitly differentiate from sibling list tools like get_memories or search_memories.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. The description mentions implementation details (Qdrant API) but doesn't help the agent decide when to invoke list_entities over other list/search tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mcp_get_entityA
Get all relationships for a specific entity (bidirectional).
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Exact entity name to look up. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must disclose behavioral traits. It mentions 'bidirectional', which is useful, but does not clarify if the operation is read-only, requires authentication, has limits, or how the result is structured. Basic transparency but incomplete.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that is front-loaded and purposeful. While very concise, it could be slightly expanded with minimal additional detail without sacrificing structure.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the presence of an output schema (from context signals), the description does not need to detail return values. For a one-parameter tool with simple behavior, the description adequately covers the functionality, though some users might want more detail about the bidirectional aspect.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, and the schema already describes the 'name' parameter as 'Exact entity name to look up.' The description adds no additional semantic value beyond what the schema provides, so baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: 'Get all relationships for a specific entity (bidirectional).' It uses a specific verb ('Get') and resource ('relationships for a specific entity'), and highlights bidirectional behavior, distinguishing it from sibling tools like mcp_search_graph.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when needing all relationships of an entity, but does not explicitly state when to use this tool versus alternatives (e.g., mcp_search_graph) or provide exclusions or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mcp_search_graphA
Search entities by name/id substring matching in Neo4j knowledge graph.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Entity or topic to search for (e.g., 'Python', 'TypeScript'). |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description bears full responsibility for behavioral disclosure. It mentions 'substring matching' but omits critical details like case sensitivity, scope of search (e.g., nodes/relationships), and whether the tool is read-only. This leaves the agent uncertain about behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no redundant words. It is front-loaded and efficient, earning its place with specific verb and resource.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple (one parameter, output schema exists), but the description does not clarify the substring matching behavior or what entity types are searched. The output schema exists but the agent might benefit from knowing the matching semantics. Overall adequate but has gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% for the single parameter 'query', and the description adds minimal extra meaning beyond the schema's description. It does not provide format, length limits, or examples beyond the schema. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool searches entities by name/id substring matching in a Neo4j knowledge graph. It uses a specific verb ('search') and resource ('entities'), and distinguishes from siblings like 'search_memories' (searches memories) and 'mcp_get_entity' (likely gets a specific entity).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no explicit when-to-use or when-not-to-use guidance. It neither mentions alternatives nor exclusions. Usage is implied (searching entities), but no differentiation from similar tools like 'list_entities' or 'search_memories' is given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_memoriesC
Semantic search across existing memories.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Natural language description of what to find. | |
| user_id | No | User scope. Defaults to MEM0_USER_ID. | |
| agent_id | No | Agent scope. | |
| run_id | No | Run scope. | |
| filters | No | Additional structured filter clauses. | |
| limit | No | Maximum number of results. | |
| threshold | No | Minimum relevance score (0.0-1.0). | |
| rerank | No | Whether to apply reranking. | |
| enable_graph | No | Override default graph toggle. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description must disclose behavior. It only says 'semantic search' without stating that it is read-only, what the output format is (though output schema exists), or any side effects. Minimal behavioral context is provided.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise, consisting of only two words plus context. While it could be more informative without becoming verbose, it avoids unnecessary fluff and is clearly structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 9 parameters and no annotations, the description is insufficient. It does not explain how filtering works, the role of threshold/rerank, or how this tool relates to sibling tools like get_memories or mcp_search_graph. The output schema partially compensates, but the description lacks essential context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
All 9 parameters have descriptions in the input schema (100% coverage), so the description adds no extra information beyond the schema. The baseline of 3 is appropriate as the schema already documents parameters adequately.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it performs semantic search across memories, distinguishing it from add/get operations. However, it does not explicitly differentiate from other retrieval tools like get_memories, though 'semantic' hints at the difference.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use semantic search versus other retrieval methods (e.g., get_memories) or alternative tools like list_entities. The description lacks any context for appropriate usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
update_memoryA
Overwrite an existing memory's text. Re-embeds and re-indexes.
| Name | Required | Description | Default |
|---|---|---|---|
| memory_id | Yes | Exact memory UUID to update. | |
| text | Yes | Replacement text for the memory. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses that the operation re-embeds and re-indexes, adding value beyond the basic update. However, given no annotations, more behavioral details (e.g., error cases, idempotency) would be beneficial.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences with no wasted words, efficiently conveying the core action and key side effect.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple two-parameter tool, the description is fairly complete. It could mention return value behavior but output schema exists to cover that.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and parameter descriptions are clear. The description adds no extra meaning beyond what the schema provides, meeting the baseline.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states the action: 'Overwrite an existing memory's text' with specific verb and resource, distinguishing it from siblings like add_memory and delete_memory.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool versus alternatives such as get_memory or delete_memory. Usage context is only implied.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
11 tool updates
v0.3.2- First observed
add_memory - First observed
delete_all_memories - First observed
delete_entities - First observed
delete_memory - First observed
get_memories - First observed
get_memory - First observed
list_entities - First observed
mcp_get_entity - First observed
mcp_search_graph - First observed
search_memories - First observed
update_memory
TDQS
Scored across 11 tools
Most tools have distinct purposes: add, get, update, delete, search, and entity management. However, delete_all_memories and delete_entities could be confused as both are bulk deletions, and get_memories vs search_memories may cause ambiguity despite different filtering/semantic approaches.
The majority follow a consistent verb_noun pattern (e.g., add_memory, delete_memory). Two tools (mcp_get_entity, mcp_search_graph) deviate with an 'mcp_' prefix, breaking the otherwise uniform style.
With 11 tools, the server covers core memory CRUD, search, and entity operations without being excessive. This count is well-scoped for a focused memory management MCP server.
The tool surface includes creation, retrieval (by ID, pagination, semantic search), update, and multiple deletion methods, plus entity listing and graph search. This provides comprehensive lifecycle coverage for agent memory management.
Maintenance
Related MCP Connectors
Private persistent memory for Claude, ChatGPT & Gemini via MCP - semantic search, zero-code setup.
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
One memory, every AI: Claude, ChatGPT, Perplexity, Gemini, Cursor, OpenClaw, Hermes, any MCP client.
Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP Memory Server for Claude Code that provides persistent context across sessions using semantic search (RAG).Apache 2.0

mem0-mcpofficial
AlicenseAqualityCmaintenanceSelf-hosted Mem0 MCP server integrating Qdrant, Neo4j, and Ollama for semantic memory search, graph entity relationships, and memory management via OpenMemory API.64MIT- AlicenseNot gradedqualityDmaintenanceA fully local, self-hosted memory server for MCP clients (Claude Code, Cursor, etc.) that provides persistent memory storage with semantic search, using local embeddings and a local Qdrant vector store.MIT
- AlicenseAqualityAmaintenanceA server that wraps a self-hosted mem0 REST API as MCP tools for Claude Desktop and Claude Code, enabling memory operations such as adding, searching, and managing memories via natural language.61MIT