home / mcp / mem0 local mcp server

Mem0 Local MCP Server

Provides local persistent memory storage and retrieval for MCP-enabled clients with a self-hosted stack.

Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

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.bat

Mac 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.sh

Architecture

The 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.

Configuration

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"
      ]
    }
  }
}

Testing the MCP memory flow

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.

Troubleshooting

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.

Notes and testing tips

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.

Security and maintenance

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.

Available tools

add_memory

Store a new memory entry for a user, including content and metadata.

search_memories

Query stored memories using natural language or structured prompts to retrieve relevant results.

get_all_memories

Retrieve all memories associated with a specific user.

update_memory

Modify the content or metadata of an existing memory.

delete_memory

Remove a specific memory entry from storage.

delete_all_memories

Clear all memories for a user, removing all stored entries.

get_memory_stats

Provide statistics about memory usage, counts, and distributions.