mem0-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mem0-mcp remember that my favorite color is blue"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mem0-mcp
A small MCP server that wraps a self-hosted mem0 REST API
(see ../server-compose-files/ai-containers) as tools for Claude Desktop /
Claude Code. Mem0's own official MCP integrations (mcp.mem0.ai, the archived
mem0-mcp-server package) only target Mem0's cloud API — different auth
scheme (Authorization: Token ... vs. this server's X-API-Key) and
different routes — so they don't work against a self-hosted instance. This
wraps the self-hosted REST API directly instead.
Tools
Tool | mem0 endpoint |
|
|
|
|
|
|
|
|
|
|
|
|
Bulk operations (delete_all_memories, /reset) are intentionally not
exposed — keeps the blast radius of an LLM-driven tool call small. Use curl
directly against the API for those.
Related MCP server: zime-memory
Setup
Requires an API key from the mem0 dashboard (/setup on first run, or the
API Keys page after) and the URL your machine can reach the mem0 API at.
Add to Claude Desktop's config
(~/Library/Application Support/Claude/claude_desktop_config.json on macOS).
Two ways to run it, depending on whether you've cloned the repo:
Without cloning, straight from GitHub — same uvx --from git+... pattern
other MCP servers use to run from a repo without publishing to PyPI first:
uvx --from git+https://github.com/andresmorales07/mem0-mcp mem0-mcp{
"mcpServers": {
"mem0": {
"command": "uvx",
"args": ["--from", "git+https://github.com/andresmorales07/mem0-mcp", "mem0-mcp"],
"env": {
"MEM0_API_URL": "http://your-mem0-host:8888",
"MEM0_API_KEY": "m0sk_...",
"MEM0_DEFAULT_USER_ID": "your-user-id",
"MEM0_DEFAULT_AGENT_ID": "claude-desktop"
}
}
}
}Prefer to pin to a released version instead of tracking main? Append a ref,
e.g. git+https://github.com/andresmorales07/mem0-mcp@v0.1.0.
From a local clone:
{
"mcpServers": {
"mem0": {
"command": "uv",
"args": ["run", "--directory", "/path/to/mem0-mcp", "mem0-mcp"],
"env": {
"MEM0_API_URL": "http://your-mem0-host:8888",
"MEM0_API_KEY": "m0sk_...",
"MEM0_DEFAULT_USER_ID": "your-user-id",
"MEM0_DEFAULT_AGENT_ID": "claude-desktop"
}
}
}
}Use the full path to uv/uvx (e.g. which uv) if Claude Desktop can't find
them on its own PATH.
Both default env vars are optional, and they behave differently:
MEM0_DEFAULT_USER_IDis a last-resort fallback — only used when a tool call supplies nouser_id,agent_id, orrun_idat all. Applies to both reads and writes.MEM0_DEFAULT_AGENT_IDis merged in only onadd_memory(unless that call passes its ownagent_id), tagging every memory this server writes with which client created it — useful if you ever point another tool (n8n, a different agent) at the same mem0 instance and want to tell them apart later.It's deliberately not applied to
search_memories/list_memories. MCP tool calls can't distinguish "no agent_id given" from "search across all agents," so auto-tagging reads would silently and permanently scope every query to just this one agent — making it impossible to ever ask "show me everything anyone has learned about me" again. Reads default to whateveruser_id/agent_id/run_idthe model explicitly passes (plus theMEM0_DEFAULT_USER_IDfallback above); passagent_idexplicitly on a read if you want to narrow it to one agent's memories.
Restart Claude Desktop after editing the config. Claude will prompt for permission the first time it calls one of these tools.
Manual test
MEM0_API_URL=http://your-mem0-host:8888 MEM0_API_KEY=m0sk_... uv run python -c "
from mem0_mcp.server import list_memories
print(list_memories(user_id='alice'))
"Available Tools
6 toolsadd_memoryA
Store a new memory. Provide at least one of user_id, agent_id, or run_id to scope it; if none are given, falls back to MEM0_DEFAULT_USER_ID. Tagged with MEM0_DEFAULT_AGENT_ID unless agent_id is given explicitly.
Inputs: text (required), run_id, user_id, agent_id. Returns: object
delete_memoryA
Delete a single memory by its id. Confirm the memory_id with the user first if it wasn't just returned by another tool call.
Inputs: memory_id (required). Returns: result
get_memoryA
Retrieve a single memory by its id.
Inputs: memory_id (required). Returns: object
list_memoriesA
List stored memories for a given user_id/agent_id/run_id.
Inputs: top_k, run_id, user_id, agent_id. Returns: object
search_memoriesB
Semantic search over stored memories, scoped to a user_id/agent_id/run_id.
Inputs: query (required), top_k, run_id, user_id, +1 more. Returns: object
update_memoryA
Update an existing memory's text and/or metadata. Confirm the memory_id with the user first if it wasn't just returned by another tool call.
Inputs: memory_id (required), text, metadata. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose: list, get, add, search, update, and delete memories. There is no functional overlap; even get vs list are differentiated by retrieval method (by ID vs. enumeration).
All tool names follow a consistent verb_noun pattern (list_, get_, add_, search_, update_, delete_). Minor singular/plural variation (memory vs memories) is natural and does not affect predictability.
With 6 tools, the server is well-scoped for a memory management system. Each tool covers a necessary operation without redundancy or bloat.
The tool set provides full CRUD coverage (add, get, update, delete) plus list and semantic search. There are no missing lifecycle operations for the stated purpose.
Maintenance
Related MCP Connectors
Private persistent memory for Claude, ChatGPT & Gemini via MCP - semantic search, zero-code setup.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Persistent memory for AI assistants. Save once; recall from Claude, ChatGPT, or any MCP client.
Persistent AI memory shared across Claude, ChatGPT, coding agents, and compatible MCP clients.
Related MCP Servers
- AlicenseAqualityDmaintenanceSelf-hosted mem0 MCP server for Claude Code. Run a complete memory server against self-hosted Qdrant + Neo4j + Ollama while using Claude as the main LLM.11112MIT
- FlicenseNot gradedqualityDmaintenanceA personal memory MCP server for Claude Code that stores and retrieves memories via natural language, supporting text, images, files, and secrets with vector search.-
- AlicenseNot gradedqualityCmaintenanceA persistent memory MCP server for Claude Code that enables long-term recall across sessions via hybrid search, code intelligence, and tools for reading/writing memory.18 npm5MIT
- AlicenseAqualityDmaintenanceA custom MCP server that connects to self-hosted Mem0 API instances, enabling Claude Code to manage memories via custom endpoints.41MIT