Manages environment variables to securely store API keys, including mem0 API key configuration.
Provides demo capabilities through GitHub assets, demonstrating the coding preferences functionality in action.
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 |
| Save text or conversation history (or explicit message objects) for a user/agent. |
| Semantic search across existing memories (filters + limit supported). |
| List memories with structured filters and pagination. |
| Retrieve one memory by its
. |
| Overwrite a memory's text once the user confirms the
. |
| Delete a single memory by
. |
| Bulk delete all memories in 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. |
All responses are JSON strings returned directly from the Mem0 API.
Related MCP server: Mem0 MCP Server
Usage Options
There are three ways to use the Mem0 MCP Server:
Python Package - Install and run locally using
uvxwith any MCP clientDocker - Containerized deployment that creates an
/mcpHTTP endpointSmithery - Remote hosted service for managed deployments
Quick Start
Installation
Or with pip:
Client Configuration
Add this configuration to your MCP client:
Test with the Python Agent
To test the server immediately, use the included Pydantic AI agent:
Using different server configurations:
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_ENABLE_GRAPH_DEFAULT(optional) – Enable graph memories by default (defaults tofalse).MEM0_MCP_AGENT_MODEL(optional) – default LLM for the bundled agent example (defaults toopenai:gpt-4o-mini).
Advanced Setup
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=m0-... \ -p 8080:8081 \ mem0-mcp-serverMonitor 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 the MCP server (Smithery dependencies are now bundled):
pip install mem0-mcp-serverConfigure 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-..." } } } }
Development Setup
Clone and run from source: