Provides memory management via MCP for adding, searching, updating, and deleting long-term memories across users, agents, and runs.
Configuration
View docs{
"mcpServers": {
"mem0ai-mem0-mcp": {
"command": "docker",
"args": [
"run",
"--rm",
"-d",
"--name",
"mem0-mcp",
"-e",
"MEM0_API_KEY=sk_mem0_...",
"-p",
"8080:8081",
"mem0-mcp-server"
],
"env": {
"MEM0_API_KEY": "sk_mem0_...",
"MEM0_DEFAULT_USER_ID": "mem0-mcp"
}
}
}
}You can extend your AI applications with Mem0 memory capabilities by running a Mem0 MCP Server. It exposes memory management as a Model Context Protocol (MCP) service, letting clients add, search, update, and delete long-term memories in a structured way that your agents can leverage across sessions and runs.
Set up an MCP client to connect to the Mem0 MCP Server and perform memory operations. You will be able to add memories for users or agents, search through existing memories with semantic filters, retrieve memory lists with pagination, update specific memories after confirmation, and delete single memories or entire scopes as needed. Use the available tools to manage health data, research notes, dietary preferences, project statuses, or any topic you track over time.
Key capabilities you will use include adding new memories, performing semantic searches, listing memories with filters, retrieving a single memory by its ID, updating memory text, and deleting memories either individually or in bulk. You can also remove associated entities (users/agents/apps/runs) to clean up a complete scope when necessary.
uv pip install mem0-mcp-server
```
Or with plain pip:
```
pip install mem0-mcp-server
```
```,Configure your MCP client to point at the Mem0 MCP Server. Create a configuration entry named for the Mem0 server and supply the runtime launcher, arguments, and required environment keys.
{
"mcpServers": {
"mem0": {
"command": "uvx",
"args": ["mem0-mcp-server"],
"env": {
"MEM0_API_KEY": "sk_mem0_...",
"MEM0_DEFAULT_USER_ID": "your-handle"
}
}
}
}If you prefer running the server in Docker or via a remote Smithery service, you have ready-made deployment paths that expose an MCP endpoint for HTTP-based clients or enable local stdio-based client configuration.
Environment and runtime notes help you tailor the server to your deployment choice. Examples below show how to enable the API key and default user in your environment or client config.
Protect your MEM0_API_KEY and limit default user scoping to avoid unintended data access. Rotate API keys as needed and apply least-privilege principles for any client integrations.
If the MCP server does not respond, check environment variables, verify the server process is running, and confirm the client is configured to reach the correct launcher or endpoint. Review access permissions for memory scopes you manage.
Save text or conversation history (or explicit message objects) for a user/agent.
Semantic search across existing memories with optional filters and limits.
List memories with structured filters and pagination.
Retrieve a single memory by its memory_id.
Overwrite a memory's text after confirming the memory_id.
Delete a single memory by memory_id.
Bulk delete all memories within the confirmed scope (user/agent/app/run).
Delete a user/agent/app/run entity and its memories.
Enumerate users/agents/apps/runs stored in Mem0.