MCP Mem0

v1.0.0Knowledge & Memorystable

A template implementation of the Model Context Protocol server that integrates with Mem0 to provide AI agents with persistent memory capabilities for storing, retrieving, and searching memories using semantic search.

mcp-mem0mcpai-integration
Share:
677
Stars
0
Downloads
0
Weekly
0/5

What is MCP Mem0?

MCP Mem0 is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to template implementation of the model context protocol server that integrates with mem0 to provide ai agents with persistent memory capabilities for storing, retrieving, and searching memories using se...

A template implementation of the Model Context Protocol server that integrates with Mem0 to provide AI agents with persistent memory capabilities for storing, retrieving, and searching memories using semantic search.

This server falls under the Knowledge & Memory category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A template implementation of the Model Context Protocol serv

Use Cases

Provide AI agents with persistent memory using Mem0 integration. Store, retrieve, and search memories with semantic search capabilities. Build long-term context for AI applications.
coleam00

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedMay 15, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-mem0

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use MCP Mem0

MCP-Mem0 is a Model Context Protocol server that integrates with the Mem0 memory platform to give AI agents persistent, semantically searchable long-term memory. It exposes three tools — save_memory, get_all_memories, and search_memories — backed by a PostgreSQL database and a configurable LLM provider for embedding and retrieval. Use it to build AI assistants that remember user preferences, past conversations, and domain knowledge across sessions.

Prerequisites

  • Python 3.10+ and uv or pip installed
  • PostgreSQL database accessible (local or cloud, e.g. Supabase free tier)
  • An LLM provider API key: OpenAI (OPENAI_API_KEY), OpenRouter, or a local Ollama instance
  • An MCP client such as Claude Desktop or Cursor
  • Docker (optional, for the containerized deployment path)
1

Clone the repository

Clone the mcp-mem0 repository from GitHub to get the source code and example configuration files.

git clone https://github.com/coleam00/mcp-mem0.git
cd mcp-mem0
2

Install dependencies

Install the Python dependencies using uv in editable mode.

pip install uv
uv pip install -e .
3

Configure environment variables

Copy the example env file and fill in your database URL, LLM provider, and API keys.

cp .env.example .env
# Edit .env with your values:
# TRANSPORT=stdio
# LLM_PROVIDER=openai
# LLM_API_KEY=sk-your-openai-key
# LLM_CHOICE=gpt-4o-mini
# EMBEDDING_MODEL_CHOICE=text-embedding-3-small
# DATABASE_URL=postgresql://user:password@localhost:5432/mem0
4

Configure Claude Desktop for stdio transport

Add mcp-mem0 to Claude Desktop's configuration file, pointing to the Python executable in the virtual environment.

{
  "mcpServers": {
    "mem0": {
      "command": "/path/to/mcp-mem0/.venv/bin/python",
      "args": ["/path/to/mcp-mem0/src/main.py"],
      "env": {
        "TRANSPORT": "stdio",
        "LLM_PROVIDER": "openai",
        "LLM_API_KEY": "sk-your-openai-key",
        "LLM_CHOICE": "gpt-4o-mini",
        "EMBEDDING_MODEL_CHOICE": "text-embedding-3-small",
        "DATABASE_URL": "postgresql://user:password@localhost:5432/mem0"
      }
    }
  }
}
5

Or run with Docker for SSE transport

Build and run the Docker image, then configure your MCP client to connect via SSE to localhost:8050.

docker build -t mcp/mem0 --build-arg PORT=8050 .
docker run --env-file .env -p 8050:8050 mcp/mem0
6

Connect via SSE (Docker deployment)

When running with Docker in SSE mode, configure your MCP client to use the HTTP SSE transport.

{
  "mcpServers": {
    "mem0": {
      "transport": "sse",
      "url": "http://localhost:8050/sse"
    }
  }
}

MCP Mem0 Examples

Client configuration

Claude Desktop stdio configuration for mcp-mem0 with OpenAI as the LLM provider.

{
  "mcpServers": {
    "mem0": {
      "command": "/path/to/mcp-mem0/.venv/bin/python",
      "args": ["/path/to/mcp-mem0/src/main.py"],
      "env": {
        "TRANSPORT": "stdio",
        "LLM_PROVIDER": "openai",
        "LLM_API_KEY": "sk-your-openai-key",
        "LLM_CHOICE": "gpt-4o-mini",
        "EMBEDDING_MODEL_CHOICE": "text-embedding-3-small",
        "DATABASE_URL": "postgresql://user:password@localhost:5432/mem0"
      }
    }
  }
}

Prompts to try

Once connected, use these prompts to store and retrieve persistent memories:

- "Remember that I prefer TypeScript over JavaScript for all new projects"
- "Save that my AWS production account ID is 123456789012"
- "What do you remember about my coding preferences?"
- "Search your memories for anything related to my database setup"
- "Recall everything you know about my current project architecture"

Troubleshooting MCP Mem0

Database connection errors on startup

Verify the DATABASE_URL is correct and the PostgreSQL server is running and accessible. Test with 'psql $DATABASE_URL' from your terminal. Ensure the database exists and the user has CREATE TABLE permissions (Mem0 creates its schema automatically on first run).

Embedding or search returning irrelevant results

Ensure EMBEDDING_MODEL_CHOICE matches the model used when memories were originally saved. Changing embedding models mid-use requires re-indexing existing memories, as embeddings from different models are not compatible.

Server fails to start with 'module not found' errors

Ensure you installed with 'uv pip install -e .' from the project root directory while the virtual environment is active. The command in claude_desktop_config.json must point to the Python executable inside .venv, not the system Python.

Frequently Asked Questions about MCP Mem0

What is MCP Mem0?

MCP Mem0 is a Model Context Protocol (MCP) server that template implementation of the model context protocol server that integrates with mem0 to provide ai agents with persistent memory capabilities for storing, retrieving, and searching memories using semantic search. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install MCP Mem0?

Follow the installation instructions on the MCP Mem0 GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with MCP Mem0?

MCP Mem0 works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is MCP Mem0 free to use?

Yes, MCP Mem0 is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Knowledge & Memory MCP Servers

Explore all knowledge & memory servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "mcp-mem0": { "command": "npx", "args": ["-y", "mcp-mem0"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use MCP Mem0?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides