A simplified MCP (Model Context Protocol) server for persistent memory management using mem0.ai. This server enables AI assistants to remember information across conversations.
- Persistent Memory: Store and retrieve information across conversations
- Semantic Search: Find relevant memories using natural language
- Simple API: Just 3 core tools for memory management
- Python 3.8+
- mem0.ai API key (get one at mem0.ai)
- Clone the repository:
git clone https://github.com/yourusername/mem0-mcp.git
cd mem0-mcp- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
cp .env.example .env
# Edit .env and add your MEM0_API_KEYpython main.pypython main.py --host 0.0.0.0 --port 8080 --debug| Variable | Description | Default |
|---|---|---|
MEM0_API_KEY |
Your mem0.ai API key | Required |
PORT |
Server port | 8080 |
DEFAULT_USER_ID |
Default user ID for memories | cursor_mcp |
python main.py [OPTIONS]
Options:
--host HOST Host to bind to (default: 0.0.0.0)
--port PORT Port to bind to (default: 8080)
--name NAME Server name (default: mem0-mcp)
--debug Enable debug mode
--no-instructions Disable custom instructions
- add_memory - Add new information to memory
- search_memories - Search memories using natural language
- get_all_memories - Retrieve all stored memories
Add to your MCP settings:
{
"mcpServers": {
"mem0-mcp": {
"command": "python",
"args": ["/path/to/mem0-mcp/main.py"]
}
}
}mem0-mcp/
├── src/
│ ├── core/
│ │ ├── __init__.py
│ │ ├── config.py
│ │ └── mem0_client.py
│ ├── tools/
│ │ ├── __init__.py
│ │ └── memory_tools.py
│ └── server/
│ ├── __init__.py
│ ├── main.py
│ └── server_factory.py
├── main.py
├── .env.example
├── requirements.txt
├── pyproject.toml
└── README.md
To deploy on Render, you need to update the Start Command in your service settings:
- Go to your Render dashboard
- Select your mem0-mcp service
- Go to Settings → Build & Deploy
- Change "Start Command" to:
python main.py - Save changes and manually deploy
Alternatively, you can use the render.yaml configuration provided in this repository.
MIT License - see LICENSE file for details
- mem0.ai for the memory API
- Anthropic MCP for the protocol specification