Mem0 MCP Server
Give your AI agents persistent memory — store, search, and recall context across sessions via MCP.
Updated
What is Mem0 MCP?
The Mem0 MCP server is a Model Context Protocol server that gives AI agents a persistent memory layer — letting them store, search, update, and recall context across conversations and sessions instead of starting from scratch each time.
It is an officially hosted, cloud service from Mem0. Rather than running anything locally, clients connect to the remote endpoint at https://mcp.mem0.ai/mcp and authenticate via OAuth against your Mem0 account, which scopes every memory operation to your workspace and API key. The server wraps Mem0's hosted Memory API, so the agent decides when to save a fact, look one up, or clean up stale entries.
Once connected, an agent can persist user preferences, prior decisions, and conversation history, then semantically search that store on later turns. This turns one-off chats into a continuous, context-aware experience and is compatible with MCP clients such as Claude, Claude Code, Cursor, Windsurf, and VS Code.
Tools the Mem0 MCP server exposes
| Tool | What it does |
|---|---|
| add_memory | Save text or conversation history for a user or agent; Mem0 extracts and indexes key facts automatically. |
| search_memories | Semantic search across stored memories with filters and result limits. |
| get_memories | List memories using structured filters and pagination. |
| get_memory | Retrieve a single memory by its memory_id. |
| update_memory | Overwrite a memory's text after confirming the memory_id. |
| delete_memory | Delete a single memory by memory_id. |
| delete_all_memories | Bulk delete all memories within the current scope. |
| delete_entities | Delete a user, agent, app, or run entity and its associated memories. |
| list_entities | Enumerate the users, agents, apps, and runs stored in Mem0. |
| list_events | List memory operation events with filters and pagination. |
| get_event_status | Check the status of an async memory operation by event_id. |
Connect the Mem0 MCP server
Claude Code
- 1
Add the remote server
Run: npx mcp-add --name mem0-mcp --type http --url "https://mcp.mem0.ai/mcp" --clients "claude code"
- 2
Authenticate with OAuth
On first use Claude Code opens a browser to sign in to your Mem0 account and authorize the connection.
- 3
Verify the tools are available
Ask Claude to list MCP tools or to save and recall a memory; you should see the Mem0 memory tools (add_memory, search_memories, etc.).
Requires a Mem0 account; the free Hobby tier is enough to get started.
Cursor
- 1
Add the remote server
Run: npx mcp-add --name mem0-mcp --type http --url "https://mcp.mem0.ai/mcp" --clients "cursor"
- 2
Authenticate with OAuth
Cursor opens a browser window to sign in to Mem0 and grant access to your workspace.
- 3
Confirm in Cursor settings
Open Cursor's MCP settings to confirm mem0-mcp shows as connected, then prompt the agent to store or search a memory.
Works with Cursor's MCP support; no local server install needed.
Sample use cases
Security & permissions
The hosted Mem0 MCP server uses OAuth: clients sign in to your Mem0 account in a browser and authorize the connection, rather than pasting a long-lived key into a config file. Once authorized, the agent can read and write memories in your Mem0 workspace — it can add, search, update, and delete memories and entities (users, agents, apps, runs) within the scope of your account. Because memory tools include destructive operations like delete_memory and delete_all_memories, treat the connection as having full read/write access to your stored context, and only connect agents you trust. All data lives in Mem0's hosted platform under your account.
Using Mem0 MCP with Gamut
In a Gamut workflow, Mem0 acts as the long-term memory tool for an automated agent: Gamut manages the OAuth connection to the hosted Mem0 MCP server, so an event- or schedule-triggered agent can call searchmemories at the start of a run to load relevant prior context, then addmemory or update_memory to persist new facts and decisions before it finishes. This lets recurring or webhook-driven agents stay context-aware across runs without you wiring up storage yourself — for example, a scheduled support-triage or research agent that remembers a customer's history or its own earlier conclusions from one invocation to the next.
Frequently asked questions
How is Mem0 different from a vector database?
Mem0 is purpose-built for agent memory — it handles memory extraction, conflict resolution, and temporal relevance automatically, unlike raw vector stores where you manage chunking and retrieval yourself.
Does Mem0 support memory scoping per user or organization?
Yes. Memories can be scoped to individual users, agents, or organizations — you control exactly who can read or write each memory entry.
Can I use Mem0 MCP with multiple AI agents?
Yes. Multiple agents can read from and write to the same Mem0 memory store, enabling shared context across specialized agents in a workflow.
What happens when memories conflict?
Mem0 handles conflict resolution automatically — newer facts update older ones, and the system tracks memory provenance so you can trace what changed and when.
Is there a memory size or count limit?
Mem0's cloud plans have tiered limits on stored memories. The open-source version is self-hosted, so limits depend on your infrastructure.
Does Mem0 support structured and unstructured memories?
Yes. You can store both free-text memories (extracted from conversations) and structured key-value facts, and query either type.
Can users request deletion of their memories?
Yes. The API supports selective memory deletion by user ID or memory ID — essential for privacy compliance and user data requests.