mem0-mcp-server wraps the official Mem0 Memory API as a Model Context Protocol (MCP) server so any MCP-compatible client (Claude Desktop, Cursor, custom agents) can add, search, update, and delete long-term memories. The server exposes the following tools to your LLM: All responses are JSON strings returned directly from the Mem0 API. There are three ways to use the Mem0 MCP Server: 1. Python Pack
Add this skill
npx mdskills install mem0ai/mem0-mcpWell-documented memory API wrapper with comprehensive tooling and multiple deployment options
mem0-mcp-server wraps the official Mem0 Memory API as a Model Context Protocol (MCP) server so any MCP-compatible client (Claude Desktop, Cursor, custom agents) can add, search, update, and delete long-term memories.
The server exposes the following tools to your LLM:
| Tool | Description |
|---|---|
add_memory | Save text or conversation history (or explicit message objects) for a user/agent. |
search_memories | Semantic search across existing memories (filters + limit supported). |
get_memories | List memories with structured filters and pagination. |
get_memory | Retrieve one memory by its memory_id. |
update_memory | Overwrite a memory's text once the user confirms the memory_id. |
delete_memory | Delete a single memory by memory_id. |
delete_all_memories | Bulk delete all memories in the confirmed scope (user/agent/app/run). |
delete_entities | Delete a user/agent/app/run entity (and its memories). |
list_entities | Enumerate users/agents/apps/runs stored in Mem0. |
All responses are JSON strings returned directly from the Mem0 API.
There are three ways to use the Mem0 MCP Server:
uvx with any MCP client/mcp HTTP endpointuv pip install mem0-mcp-server
Or with pip:
pip install mem0-mcp-server
Add this configuration to your MCP client:
{
"mcpServers": {
"mem0": {
"command": "uvx",
"args": ["mem0-mcp-server"],
"env": {
"MEM0_API_KEY": "m0-...",
"MEM0_DEFAULT_USER_ID": "your-handle"
}
}
}
}
Click to expand: Test with the Python Agent
To test the server immediately, use the included Pydantic AI agent:
# Install the package
pip install mem0-mcp-server
# Or with uv
uv pip install mem0-mcp-server
# Set your API keys
export MEM0_API_KEY="m0-..."
export OPENAI_API_KEY="sk-openai-..."
# Clone and test with the agent
git clone https://github.com/mem0ai/mem0-mcp.git
cd mem0-mcp-server
python example/pydantic_ai_repl.py
Using different server configurations:
# Use with Docker container
export MEM0_MCP_CONFIG_PATH=example/docker-config.json
export MEM0_MCP_CONFIG_SERVER=mem0-docker
python example/pydantic_ai_repl.py
# Use with Smithery remote server
export MEM0_MCP_CONFIG_PATH=example/config-smithery.json
export MEM0_MCP_CONFIG_SERVER=mem0-memory-mcp
python example/pydantic_ai_repl.py
The Mem0 MCP server enables powerful memory capabilities for your AI applications:
MEM0_API_KEY (required) – Mem0 platform API key.MEM0_DEFAULT_USER_ID (optional) – default user_id injected into filters and write requests (defaults to mem0-mcp).MEM0_ENABLE_GRAPH_DEFAULT (optional) – Enable graph memories by default (defaults to false).MEM0_MCP_AGENT_MODEL (optional) – default LLM for the bundled agent example (defaults to openai:gpt-4o-mini).Click to expand: Docker, Smithery, and Development
To run with Docker:
Build the image:
docker build -t mem0-mcp-server .
Run the container:
docker run --rm -d \
--name mem0-mcp \
-e MEM0_API_KEY=m0-... \
-p 8080:8081 \
mem0-mcp-server
Monitor the container:
# View logs
docker logs -f mem0-mcp
# Check status
docker ps
To connect to a Smithery-hosted server:
Install the MCP server (Smithery dependencies are now bundled):
pip install mem0-mcp-server
Configure MCP client with Smithery:
{
"mcpServers": {
"mem0-memory-mcp": {
"command": "npx",
"args": [
"-y",
"@smithery/cli@latest",
"run",
"@mem0ai/mem0-memory-mcp",
"--key",
"your-smithery-key",
"--profile",
"your-profile-name"
],
"env": {
"MEM0_API_KEY": "m0-..."
}
}
}
}
Clone and run from source:
git clone https://github.com/mem0ai/mem0-mcp.git
cd mem0-mcp-server
pip install -e ".[dev]"
# Run locally
mem0-mcp-server
# Or with uv
uv sync
uv run mem0-mcp-server
Install via CLI
npx mdskills install mem0ai/mem0-mcpMem0 MCP Server is a free, open-source AI agent skill. mem0-mcp-server wraps the official Mem0 Memory API as a Model Context Protocol (MCP) server so any MCP-compatible client (Claude Desktop, Cursor, custom agents) can add, search, update, and delete long-term memories. The server exposes the following tools to your LLM: All responses are JSON strings returned directly from the Mem0 API. There are three ways to use the Mem0 MCP Server: 1. Python Pack
Install Mem0 MCP Server with a single command:
npx mdskills install mem0ai/mem0-mcpThis downloads the skill files into your project and your AI agent picks them up automatically.
Mem0 MCP Server works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Gemini Cli, Amp, Roo Code, Goose. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.