MCP-Mem0: Long-Term Memory for AI Agents
@coleam00
About MCP-Mem0: Long-Term Memory for AI Agents
MCP server for long term agent memory with Mem0. Also useful as a template to get you started building your own MCP server with Python!
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mcp-mem0": {
"command": "uv",
"args": [
"pip",
"install",
"-e",
"."
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is MCP-Mem0?
MCP-Mem0 is an implementation of the Model Context Protocol (MCP) server integrated with Mem0, providing AI agents with persistent memory capabilities. It enables agents to store, retrieve, and search memories using semantic search, serving as a practical template for building custom MCP servers.
How to use MCP-Mem0?
Install dependencies with uv pip install -e . or build a Docker image. Configure a .env file with transport (sse or stdio), LLM provider (OpenAI, OpenRouter, or Ollama), embedding model, and a PostgreSQL database URL. Run the server directly with uv run src/main.py or via Docker. Then integrate with any MCP-compatible client (e.g., Claude Desktop, Windsurf) by adding the server configuration JSON with either SSE or stdio transport.
Key features of MCP-Mem0
- Three memory management tools: save, retrieve, and search memories
- Semantic search for finding relevant memories
- Supports OpenAI, OpenRouter, and Ollama LLM providers
- Deployable via Docker (recommended) or with uv
- Works with SSE or stdio transport protocols
Use cases of MCP-Mem0
- Give AI agents long-term memory that persists across conversations
- Retrieve comprehensive context from all stored memories
- Find semantically relevant memories for dynamic recall
- Build custom MCP servers using this as a reference template
FAQ from MCP-Mem0
What are the prerequisites for running MCP-Mem0?
Python 3.12+, a Supabase or PostgreSQL database for vector storage, API keys for your chosen LLM provider, and optionally Docker.
What memory tools does MCP-Mem0 provide?
It provides three tools: save_memory to store information with semantic indexing, get_all_memories to retrieve all stored memories, and search_memories to find relevant memories via semantic search.
Which transport protocols are supported?
MCP-Mem0 supports both SSE (Server-Sent Events) and stdio transport, configurable via the TRANSPORT environment variable.
Where are the memories stored?
Memories are stored as vectors in a PostgreSQL database (Supabase recommended), configured through the DATABASE_URL environment variable.
How do I integrate MCP-Mem0 with Windsurf or n8n?
For Windsurf use serverUrl instead of url in the MCP configuration. For n8n, replace localhost with host.docker.internal in the SSE URL.
Frequently asked questions
What are the prerequisites for running MCP-Mem0?
Python 3.12+, a Supabase or PostgreSQL database for vector storage, API keys for your chosen LLM provider, and optionally Docker.
What memory tools does MCP-Mem0 provide?
It provides three tools: `save_memory` to store information with semantic indexing, `get_all_memories` to retrieve all stored memories, and `search_memories` to find relevant memories via semantic search.
Which transport protocols are supported?
MCP-Mem0 supports both SSE (Server-Sent Events) and stdio transport, configurable via the `TRANSPORT` environment variable.
Where are the memories stored?
Memories are stored as vectors in a PostgreSQL database (Supabase recommended), configured through the `DATABASE_URL` environment variable.
How do I integrate MCP-Mem0 with Windsurf or n8n?
For Windsurf use `serverUrl` instead of `url` in the MCP configuration. For n8n, replace `localhost` with `host.docker.internal` in the SSE URL.
Basic information
More Memory & Knowledge MCP servers
RAG Documentation MCP Server
hannesrudolphAn MCP server implementation that provides tools for retrieving and processing documentation through vector search, enabling AI assistants to augment their responses with relevant documentation context.
Tempreon
TempreonPerson-owned, portable AI memory served over MCP. Your knowledge, preferences, and decisions — captured in one assistant, available in all of them.

PLUR
plur-aiAI agents start every session with amnesia — you re-explain the project, repeat your preferences, and correct the same mistakes over and over. PLUR gives them a memory that persists. Your agent's corrections, preference
Anytype MCP Server
anyprotoAn MCP server enabling AI assistants to interact with Anytype - your encrypted, local and collaborative wiki - to organize objects, lists, and more through natural language.
Memlord
MyrikLDMemlord is a remote MCP server available at https://app.memlord.com.
Comments