home / mcp / mem0 local mcp server
Provides local persistent memory storage and retrieval for MCP-enabled clients with a self-hosted stack.
Configuration
View docs{
"mcpServers": {
"hroerkr-mem0mcp": {
"url": "https://mcp.mem0.local/mcp"
}
}
}You run a self-contained MCP server that provides persistent memory for conversations by integrating Mem0. You install it locally, connect it to Claude Desktop or other MCP-capable clients, and store and retrieve memories across sessions with fast semantic search.
You interact with the MCP server through a local client that speaks the MCP protocol. Start by ensuring your MCP client is configured to connect to the local server, then perform memory operations to store, search, and manage memories. You can store contextual notes from conversations, retrieve relevant memories by query, and verify persistence across restarts.
Prerequisites include Docker Desktop installed and running. You should also have Claude Desktop available for testing.
Windows installation commands to run in a terminal:
git clone https://github.com/Synapse-OS/local-mem0-mcp.git
cd local-mem0-mcp
install.batMac and Linux installation commands to run in a terminal:
git clone https://github.com/Synapse-OS/local-mem0-mcp.git
cd local-mem0-mcp
chmod +x install.sh
./install.shThe system runs a Docker-based MCP server inside a container named mem0-mcp-server. It connects to a local PostgreSQL database (with pgvector) for memory storage and uses Ollama with phi3:mini and nomic-embed-text for local AI model inference. Claude Desktop integrates with the MCP server to store and retrieve memories across conversations.
Claude Desktop MCP configuration is required so the client can communicate with the local server. Use the provided JSON snippet to wire the local server into Claudeβs MCP configuration.
{
"mcpServers": {
"mem0-local": {
"command": "docker",
"args": [
"exec", "-i", "mem0-mcp-server",
"python", "/app/src/server.py"
]
}
}
}1. Restart Claude Desktop completely to apply the new MCP configuration. 2. Verify the server is available by checking that mem0-local appears in the MCP server list (via the MCP client). 3. Store a memory: say something like Remember that Iβm testing the MCP memory system today. 4. Retrieve memories by asking What do you remember about me? 5. Restart Claude Desktop and confirm memories persist across sessions.
Check that Docker containers are running to ensure the MCP server is active. You can verify with docker ps. Review the server logs for mem0-mcp-server using docker logs if you encounter issues. If the MCP server does not appear in Claude Desktop, confirm the configuration JSON path and syntax in your local environment.
The architecture supports local AI model inference via Ollama, persistent memory storage via PostgreSQL with pgvector, and a self-contained deployment flow with one setup script. This configuration is designed for offline operation with no external API dependencies.
Operate entirely within your local environment. Regularly back up PostgreSQL memories and monitor container health. If needed, restart all services with the provided docker-compose workflow and re-run the install script to refresh models and configurations.
Store a new memory entry for a user, including content and metadata.
Query stored memories using natural language or structured prompts to retrieve relevant results.
Retrieve all memories associated with a specific user.
Modify the content or metadata of an existing memory.
Remove a specific memory entry from storage.
Clear all memories for a user, removing all stored entries.
Provide statistics about memory usage, counts, and distributions.