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_memoriesB
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 must disclose behavioral traits. It mentions using a safe bulk-delete instead of memory.delete_all(), but this is vague. It fails to describe error handling, reversibility, or permission requirements, leaving significant gaps in 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 concise with two sentences. The first sentence front-loads the core purpose. The second sentence includes an implementation detail ('NEVER calls memory.delete_all()...') that is somewhat extraneous and could be confusing, slightly reducing conciseness.
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 (3 optional parameters requiring at least one filter) and the presence of an output schema, the description does not explain what happens when no filter is provided or what the return value indicates (e.g., number of deleted memories). It is incomplete for an agent to confidently invoke the tool.
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 input schema has 100% coverage, so the descriptions of user_id, agent_id, and run_id are already clear as scope filters. The description adds the constraint that at least one filter must be provided, which adds meaning beyond the schema's default-null indicators. However, it doesn't elaborate on parameter usage beyond this.
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 bulk-deletes all memories within a given scope, using specific verbs and resources. It distinguishes itself from sibling 'delete_memory' by implying a bulk operation, and the requirement of at least one filter aligns with the input schema parameters.
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 a usage condition: 'Requires at least one filter.' This implies when to use the tool but does not explicitly compare it to alternatives like 'delete_memory' or provide when-not scenarios. The note about using safe bulk-delete gives behavioral context but not usage boundaries.
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 provided, the description carries the burden of disclosing behavioral traits. It clearly states the cascade-delete behavior, which is a key destructive aspect. However, it does not mention irreversibility, required permissions, or potential side effects, which would further enhance 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 extremely concise with two sentences, front-loading the main purpose. Every word is functional, and there is no unnecessary information. It efficiently communicates the core functionality.
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 destructive nature and zero annotations, the description could be more complete. It does not mention return values (though output schema exists) or warn about permanent data loss. It flags the equivalence to delete_all_memories but lacks broader context like error handling or constraints.
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 each parameter having a description. The description adds minimal additional meaning beyond what the schema already provides, such as the cascade effect for user_id already noted in the schema. Thus, it meets the baseline of 3 without significant enhancement.
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 purpose: deleting an entity and cascade-deleting all its memories. It also distinguishes itself by noting functional equivalence to delete_all_memories in self-hosted mode, which helps differentiate 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?
The description provides minimal guidance on when to use this tool. It only mentions functional equivalence to delete_all_memories in self-hosted mode, implying a context-dependent preference, but does not explicitly state when to use this tool versus alternatives or provide prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delete_memoryC
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 must disclose behavioral traits. It only states the action without mentioning destructive nature, permissions needed, or error handling.
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, which is concise but under-specified for a tool with no annotations. It could include more context without being verbose.
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 having an output schema, the description does not mention return values or behavior on failure. For a destructive operation, more context is needed.
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 describes the parameter as 'Exact memory UUID to delete.' The description adds no additional meaning beyond the 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?
The description 'Delete a single memory' clearly states the action (delete), resource (memory), and scope (single), distinguishing it from siblings like delete_all_memories and get_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 guidance on when to use this tool versus alternatives like delete_all_memories, nor any prerequisites or disclaimers.
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?
With no annotations provided, the description must disclose behavioral traits. It mentions pagination and filtering but lacks details on read-only nature, authentication needs, rate limits, pagination mechanics (e.g., cursor, offset), or behavior when no memories match. The contrast with 'search' is vague.
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, clear sentence that is front-loaded and free of unnecessary words. It is appropriately short for a simple tool, though it could benefit from a bit more detail without becoming verbose.
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 (not shown), the description need not explain return values. The tool is straightforward, with 0 required parameters and clear schema. However, pagination behavior (e.g., default limit, ordering) is not addressed, slightly reducing completeness.
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 input schema has 100% description coverage, so each parameter (user_id, agent_id, run_id, limit) is already documented in the schema. The description adds no further meaning beyond what the schema provides, earning a baseline score of 3.
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 purpose: 'Page through memories using filters instead of search.' It uses a specific verb ('page through'), identifies the resource ('memories'), and explicitly contrasts with 'search' (sibling tool search_memories), distinguishing it effectively.
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 for paginated filtering rather than search, but does not explicitly state when to use this tool vs. alternatives like search_memories. No clear prerequisites or exclusions are provided, leaving room for ambiguity.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_memoryA
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 are provided, so the description carries full burden. 'Fetch' implies a read-only operation but does not disclose error handling (e.g., behavior when memory_id not found). For a simple retrieval, this is minimally adequate.
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, concise sentence with no superfluous words. It is front-loaded and immediately understandable.
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 has one parameter and an output schema (assumed from context signal), the description covers the essential purpose. It lacks explicit mention of error cases or return format, but these are partially addressed by the output schema. Completeness is high for such a simple tool.
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 input schema already provides a clear description for memory_id ('Exact memory UUID to fetch'). The tool description adds no additional parameter information beyond the schema. With 100% schema coverage, score is at baseline 3.
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 'Fetch a single memory by its ID' clearly states the verb ('Fetch'), resource ('memory'), and scope ('single by ID'). It naturally distinguishes from sibling tools like get_memories (plural) and add_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?
The description does not provide explicit guidance on when to use this tool versus alternatives (e.g., get_memories for listing, search_memories for queries). The usage is implied by the purpose, but no direct comparison or exclusions are stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_entitiesA
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?
Discloses internal behavior (Qdrant Facet API with fallback) and implies read-only nature. Since no annotations exist, this adds valuable context beyond what structured fields provide.
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 sentences, each earning its place: first states purpose, second adds technical transparency. No wasted words.
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?
Covers purpose and internal behavior succinctly. With an output schema present, return values need not be described. Slightly lacking on when to use versus 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?
Zero parameters with 100% schema description coverage (trivially). Description adds no parameter details but is unnecessary due to lack of 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 verb 'List' and the resource 'which users/agents/runs currently hold memories'. It distinguishes from sibling tools like get_memories and search_memories by focusing on entities that hold 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?
Provides version-specific implementation details but no explicit guidance on when to use this tool versus alternatives like search_memories or mcp_get_entity. Usage context is implied but not stated.
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?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It indicates a read-only operation (fetches relationships) and mentions bidirectionality, which is helpful. However, it does not clarify side effects (likely none), error cases (e.g., entity not found), or performance characteristics. The description is adequate but 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?
The description is extremely concise at one sentence (9 words), front-loading the core functionality. Every word is necessary, and there is no redundancy or unnecessary information.
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 existence of an output schema (which presumably defines the response structure), the description does not need to explain return values. It covers the basic purpose and scope (all relationships, bidirectional). However, it could optionally mention what happens if the entity has no relationships or is not found. Still, it is largely complete for a simple lookup tool.
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 input schema provides full description coverage (100%) for the single parameter 'name' with clear documentation ('Exact entity name to look up'). The description adds only the 'bidirectional' scope but does not enhance parameter understanding 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 retrieves all relationships for a specific entity, with bidirectional semantics. It uses a specific verb ('Get') and resource ('relationships for a specific entity'), and distinguishes from sibling tools like list_entities (which lists entities, not relationships) and mcp_search_graph (which is for graph-wide searches).
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 does not provide explicit guidance on when to use this tool versus alternatives. It lacks context about prerequisites, limitations, or when not to use it. Sibling tools like search_memories or mcp_search_graph might also retrieve relationship information, but no comparison is offered.
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?
Description discloses substring matching behavior, which is helpful. But no annotations exist, so description should also cover case sensitivity, pagination, limits, or what exactly 'name/id' means. It's somewhat transparent but lacks depth.
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?
Single sentence with no wasted words. Front-loaded with action. Perfectly concise 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?
Given the output schema likely describes return format, the description covers the search mechanism. Missing details like case sensitivity or pagination would improve completeness, but not critical for a simple 1-param tool.
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 provides basic description for 'query' param. Description adds context about substring matching on name/id, which goes beyond schema's generic 'Entity or topic to search for'. High schema coverage (100%) but description still adds value.
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 tool searches entities by substring matching on name/id, which is specific and distinguishes from siblings like list_entities or mcp_get_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?
Description implies usage for substring searches but does not explicitly state when to use vs alternatives like list_entities (all entities) or mcp_get_entity (exact match). No exclusions provided.
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?
With no annotations, the description provides valuable behavioral context: it re-embeds and re-indexes, which is a side effect beyond the basic operation. This aids an agent in understanding consequences, though it could be more comprehensive about error states or idempotency.
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 sentences, front-loaded with the main action. Every word adds value: 'Overwrite' is specific, and the side effects are succinctly stated. 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?
Given the tool's simplicity and 100% schema coverage, the description is largely complete. It covers the operation and a key side effect. Missing details like return format or prerequisite that memory exists, but output schema exists (though not provided) and context is nearly sufficient.
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 no extra meaning beyond the schema; it mentions 'text' but not 'memory_id'. The parameter types are self-explanatory from the 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?
The description clearly states the tool overwrites an existing memory's text, using a specific verb ('overwrite') and resource ('memory's text'). It distinguishes from siblings like add_memory (creation) and delete_memory (removal) by focusing on update.
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 for updating an existing memory's text, but does not explicitly state when to use it versus alternatives (e.g., when to add vs update), nor does it 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.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
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
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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 gradedqualityCmaintenanceA 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
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/elvismdev/mem0-mcp-selfhosted'
If you have feedback or need assistance with the MCP directory API, please join our Discord server