Mem0 MCP Server
Enables AI applications to add, search, update, and delete long-term memories using the Mem0 Memory API, allowing agents to persistently remember user preferences, conversation history, and contextual information across sessions.
README
Mem0 MCP Server
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.
Tools
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.
Usage Options
There are three ways to use the Mem0 MCP Server:
- Python Package - Install and run locally using
uvxwith any MCP client - Docker - Containerized deployment that creates an
/mcpHTTP endpoint - Smithery - Remote hosted service for managed deployments
Quick Start
Installation
uv pip install mem0-mcp-server
Or with pip:
pip install mem0-mcp-server
Client Configuration
Add this configuration to your MCP client:
{
"mcpServers": {
"mem0": {
"command": "uvx",
"args": ["mem0-mcp-server"],
"env": {
"MEM0_API_KEY": "sk_mem0_...",
"MEM0_DEFAULT_USER_ID": "your-handle"
}
}
}
}
Test with the Python Agent
<details> <summary><strong>Click to expand: Test with the Python Agent</strong></summary>
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="sk_mem0_..."
export OPENAI_API_KEY="sk-openai-..."
# Clone and test with the agent
git clone https://github.com/mem0ai/mem0-mcp-server.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
</details>
What You Can Do
The Mem0 MCP server enables powerful memory capabilities for your AI applications:
- Remember that I'm allergic to peanuts and shellfish - Add new health information to memory
- Store these trial parameters: 200 participants, double-blind, placebo-controlled study - Save research data
- What do you know about my dietary preferences? - Search and retrieve all food-related memories
- Update my project status: the mobile app is now 80% complete - Modify existing memory with new info
- Delete all memories from 2023, I need a fresh start - Bulk remove outdated memories
- Show me everything I've saved about the Phoenix project - List all memories for a specific topic
Configuration
Environment Variables
MEM0_API_KEY(required) – Mem0 platform API key.MEM0_DEFAULT_USER_ID(optional) – defaultuser_idinjected into filters and write requests (defaults tomem0-mcp).MEM0_MCP_AGENT_MODEL(optional) – default LLM for the bundled agent example (defaults toopenai:gpt-4o-mini).
Advanced Setup
<details> <summary><strong>Click to expand: Docker, Smithery, and Development</strong></summary>
Docker Deployment
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=sk_mem0_... \ -p 8080:8081 \ mem0-mcp-server -
Monitor the container:
# View logs docker logs -f mem0-mcp # Check status docker ps
Running with Smithery Remote Server
To connect to a Smithery-hosted server:
-
Install with Smithery support:
pip install "mem0-mcp-server[smithery]" -
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": "sk_mem0_..." } } } }
Development Setup
Clone and run from source:
git clone https://github.com/mem0ai/mem0-mcp-server.git
cd mem0-mcp-server
pip install -e ".[dev]"
# Run locally
mem0-mcp-server
# Or with uv
uv sync
uv run mem0-mcp-server
</details>
License
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases