Mem0 logo

Mem0

Organization
mem0ai

Official Mem0 MCP server. Give AI assistants persistent memory — store, retrieve, and semantically search user preferences, code patterns, and conversation history across sessions.

Publishermem0ai
Repositorymem0-mcp
LanguagePython
Forks
139
Stars
651
Available tools
16
Transport typestdio
Categories
LicenseApache-2.0
Links
  • Connect tools to AI workflows

    Mem0 exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 16 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    651 stars and 139 forks from the linked repository.

[!CAUTION]

This project has been archived

mem0-mcp-server is no longer actively maintained and this repository is now a public archive.

Thank you to the 640+ stargazers, 140+ forkers, and every contributor who helped shape this project. Your support and feedback meant the world to us.

Looking for Mem0 MCP? We now offer an official cloud-hosted MCP server. Check out the docs to get started.

Quick install across all major clients:

bash
npx mcp-add \
  --name mem0-mcp \
  --type http \
  --url "https://mcp.mem0.ai/mcp" \
  --clients "claude,claude code,cursor,windsurf,vscode,opencode"

Mem0 MCP Server

PyPI version License: Apache 2.0 smithery badge

mem0-mcp-server wraps the official Mem0 Memory API as a Model Context Protocol (MCP) server so any MCP-compatible client (Claude Desktop, Cursor, custom agents) can add, search, update, and delete long-term memories.

Tools

The server exposes the following tools to your LLM:

ToolDescription
add_memorySave text or conversation history (or explicit message objects) for a user/agent.
search_memoriesSemantic search across existing memories (filters + limit supported).
get_memoriesList memories with structured filters and pagination.
get_memoryRetrieve one memory by its memory_id.
update_memoryOverwrite a memory's text once the user confirms the memory_id.
delete_memoryDelete a single memory by memory_id.
delete_all_memoriesBulk delete all memories in the confirmed scope (user/agent/app/run).
delete_entitiesDelete a user/agent/app/run entity (and its memories).
list_entitiesEnumerate users/agents/apps/runs stored in Mem0.

All responses are JSON strings returned directly from the Mem0 API.

Usage Options

There are three ways to use the Mem0 MCP Server:

  1. Python Package - Install and run locally using uvx with any MCP client
  2. Docker - Containerized deployment that creates an /mcp HTTP endpoint
  3. Smithery - Remote hosted service for managed deployments

Quick Start

Installation

bash
uv pip install mem0-mcp-server

Or with pip:

bash
pip install mem0-mcp-server

Client Configuration

Add this configuration to your MCP client:

json
{
  "mcpServers": {
    "mem0": {
      "command": "uvx",
      "args": ["mem0-mcp-server"],
      "env": {
        "MEM0_API_KEY": "m0-...",
        "MEM0_DEFAULT_USER_ID": "your-handle"
      }
    }
  }
}

Test with the Python Agent

To test the server immediately, use the included Pydantic AI agent:

bash
# Install the package
pip install mem0-mcp-server
# Or with uv
uv pip install mem0-mcp-server

# Set your API keys
export MEM0_API_KEY="m0-..."
export OPENAI_API_KEY="sk-openai-..."

# Clone and test with the agent
git clone https://github.com/mem0ai/mem0-mcp.git
cd mem0-mcp-server
python example/pydantic_ai_repl.py

Using different server configurations:

bash
# Use with Docker container
export MEM0_MCP_CONFIG_PATH=example/docker-config.json
export MEM0_MCP_CONFIG_SERVER=mem0-docker
python example/pydantic_ai_repl.py

# Use with Smithery remote server
export MEM0_MCP_CONFIG_PATH=example/config-smithery.json
export MEM0_MCP_CONFIG_SERVER=mem0-memory-mcp
python example/pydantic_ai_repl.py

What You Can Do

The Mem0 MCP server enables powerful memory capabilities for your AI applications:

  • Remember that I'm allergic to peanuts and shellfish - Add new health information to memory
  • Store these trial parameters: 200 participants, double-blind, placebo-controlled study - Save research data
  • What do you know about my dietary preferences? - Search and retrieve all food-related memories
  • Update my project status: the mobile app is now 80% complete - Modify existing memory with new info
  • Delete all memories from 2023, I need a fresh start - Bulk remove outdated memories
  • Show me everything I've saved about the Phoenix project - List all memories for a specific topic

Configuration

Environment Variables

  • MEM0_API_KEY (required) – Mem0 platform API key.
  • MEM0_DEFAULT_USER_ID (optional) – default user_id injected into filters and write requests (defaults to mem0-mcp).
  • MEM0_ENABLE_GRAPH_DEFAULT (optional) – Enable graph memories by default (defaults to false).
  • MEM0_MCP_AGENT_MODEL (optional) – default LLM for the bundled agent example (defaults to openai:gpt-4o-mini).

Advanced Setup

Docker Deployment

To run with Docker:

  1. Build the image:

    bash
    docker build -t mem0-mcp-server .
  2. Run the container:

    bash
    docker run --rm -d \
      --name mem0-mcp \
      -e MEM0_API_KEY=m0-... \
      -p 8080:8081 \
      mem0-mcp-server
  3. Monitor the container:

    bash
    # View logs
    docker logs -f mem0-mcp
    
    # Check status
    docker ps

Running with Smithery Remote Server

To connect to a Smithery-hosted server:

  1. Install the MCP server (Smithery dependencies are now bundled):

    bash
    pip install mem0-mcp-server
  2. Configure MCP client with Smithery:

    json
    {
      "mcpServers": {
        "mem0-memory-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "@smithery/cli@latest",
            "run",
            "@mem0ai/mem0-memory-mcp",
            "--key",
            "your-smithery-key",
            "--profile",
            "your-profile-name"
          ],
          "env": {
            "MEM0_API_KEY": "m0-..."
          }
        }
      }
    }

Development Setup

Clone and run from source:

bash
git clone https://github.com/mem0ai/mem0-mcp.git
cd mem0-mcp-server
pip install -e ".[dev]"

# Run locally
mem0-mcp-server

# Or with uv
uv sync
uv run mem0-mcp-server

License

Apache License 2.0

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "mem0": {
      "command": "npx",
      "args": [
        "-y",
        "@mem0/mcp"
      ],
      "env": {
        "MEM0_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}

Available Tools

  • store_memory

    Store a new memory entry with content, metadata, and optional tags

  • get_memory

    Retrieve a specific memory entry by its unique identifier

  • search_memories

    Perform semantic search across stored memories using natural language queries

  • list_memories

    List all stored memories with optional filtering by date, tags, or memory type

  • update_memory

    Update an existing memory entry's content, metadata, or tags

  • delete_memory

    Remove a specific memory entry from storage

  • create_memory_collection

    Create a new collection to organize related memories

  • list_collections

    List all available memory collections

  • add_memory_to_collection

    Associate an existing memory with a specific collection

  • search_user_preferences

    Search specifically for stored user preferences and settings

  • store_code_pattern

    Store code snippets, patterns, or programming preferences for future reference

  • search_code_patterns

    Search through stored code patterns and programming-related memories

  • get_conversation_context

    Retrieve relevant conversation history and context for current session

  • store_conversation_summary

    Store a summary of important conversation points for future reference

  • find_similar_memories

    Find memories similar to a given input using semantic similarity

  • get_memory_stats

    Get statistics about stored memories including count, storage usage, and activity

Use Mem0 MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Mem0 is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Mem0 as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Mem0 MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "mem0": {
      "command": "npx",
      "args": [
        "-y",
        "@mem0/mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Mem0 MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Mem0 MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Mem0 to help me with this task?
Mem0
Sure. I read it.
Here is what I found using Mem0.

Frequently asked questions

What is the Mem0 MCP server used for?

Mem0 is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Mem0 MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Mem0 with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Mem0 MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Mem0 connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Mem0 MCP to TypingMind?

Mem0 runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Mem0 MCP provide in TypingMind?

Mem0 exposes 16 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Mem0 MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Mem0 requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇