Mem0

MCP Server exposing mem0
  • python

0

GitHub Stars

python

Language

7 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "parthshr370-mem0_mcp_private": {
      "command": "uvx",
      "args": [
        "mem0-mcp-server"
      ],
      "env": {
        "MEM0_API_KEY": "YOUR_MEM0_API_KEY",
        "MEM0_DEFAULT_USER_ID": "your-handle",
        "MEM0_MCP_AGENT_MODEL": "openai:gpt-4o-mini"
      }
    }
  }
}

Mem0 MCP Server exposes Mem0 Memory API as a Model Context Protocol (MCP) server, enabling any MCP-compatible client to add, search, update, and delete long-term memories. It provides practical memory management for AI applications, making it easy to save context, retrieve relevant memories, and keep your data organized across users, agents, and runs.

How to use

You connect to Mem0 MCP Server from an MCP client (for example, Claude Desktop, Cursor, or your own agent) to store and retrieve memories. You can save text or conversation histories, perform semantic searches, list memories with filters, and update or delete memories as needed. You can also bulk delete memories within a scope (user/agent/app/run) or remove an entire entity with its memories. Use the server to keep long-term context aligned with your applications and workflows.

How to install

Prerequisites: you need Python or a runtime that supports the Mem0 MCP Server package, plus a runtime environment for your chosen channel (such as uvx or Docker). Follow these steps to get started.

# Install the Mem0 MCP Server package
pip install mem0-mcp-server

# Or with uvx (recommended for MCP clients)
uv pip install mem0-mcp-server

# Set required environment variables for Mem0 access
export MEM0_API_KEY="sk_mem0_..."
export MEM0_DEFAULT_USER_ID="your-handle"

# Run a quick test using the bundled Python agent example
# (clone and run as shown in the examples if you want to customize)
git clone https://github.com/mem0ai/mem0-mcp-server.git
cd mem0-mcp-server
python example/pydantic_ai_repl.py

Additional sections

Configuration, security, and advanced usage details are provided here to help you deploy and run Mem0 MCP Server in different environments, manage access keys securely, and troubleshoot common issues.

Configuration

Environment variables you will typically configure for Mem0 MCP Server are listed below. These values are examples; replace them with your actual keys and preferred defaults.

Security considerations

Keep your Mem0 API key confidential and restrict access to the MCP interface. Use scoped keys and rotate credentials periodically. When running locally or in containers, ensure access is restricted to trusted networks.

Examples and troubleshooting

If you need practical examples, you can configure the MCP client to connect via a local stdio runtime, or run Mem0 MCP Server in Docker or via Smithery for remote hosting. If you encounter connection issues, verify that the API key is valid, the server process is running, and the MCP client is pointed at the correct command and environment.

Tools exposed by the server

The Mem0 MCP Server exposes the following tools for managing memories: add_memory, search_memories, get_memories, get_memory, update_memory, delete_memory, delete_all_memories, delete_entities, list_entities.

Available tools

add_memory

Save text or conversation history (or explicit message objects) for a user/agent.

search_memories

Semantic search across existing memories with optional filters and limits.

get_memories

List memories with structured filters and pagination.

get_memory

Retrieve one memory by its memory_id.

update_memory

Overwrite a memory's text after confirming the memory_id.

delete_memory

Delete a single memory by memory_id.

delete_all_memories

Bulk delete all memories within the confirmed scope (user/agent/app/run).

delete_entities

Delete a user/agent/app/run entity and its memories.

list_entities

Enumerate users/agents/apps/runs stored in Mem0.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational