mcp-mem0

MCP.Pizza Chef: coleam00

Three tools do all the work here: save a memory, search memories by meaning rather than exact wording, and pull back everything stored. The memories live in a Postgres or Supabase database you control, so preferences and facts stay put between sessions and across apps. The author also offers the project as a template for anyone writing their own MCP server in Python. Setup is involved, needing Python 3.12, a database, a key from a model provider, and ideally Docker.

Unmaintained · No commits in 17 months.
Data
Notes

Use This MCP server To

Save a preference once and stop repeating it Ask what my assistant remembers about a topic Search past notes by meaning, not exact wording Carry facts from one assistant over to another Keep project details available across separate chat sessions

README

MCP-Mem0: Long-Term Memory for AI Agents

Mem0 and MCP Integration

A template implementation of the Model Context Protocol (MCP) server integrated with Mem0 for providing AI agents with persistent memory capabilities.

Use this as a reference point to build your MCP servers yourself, or give this as an example to an AI coding assistant and tell it to follow this example for structure and code correctness!

Overview

This project demonstrates how to build an MCP server that enables AI agents to store, retrieve, and search memories using semantic search. It serves as a practical template for creating your own MCP servers, simply using Mem0 and a practical example.

The implementation follows the best practices laid out by Anthropic for building MCP servers, allowing seamless integration with any MCP-compatible client.

Features

The server provides three essential memory management tools:

  1. save_memory: Store any information in long-term memory with semantic indexing
  2. get_all_memories: Retrieve all stored memories for comprehensive context
  3. search_memories: Find relevant memories using semantic search

Prerequisites

  • Python 3.12+
  • Supabase or any PostgreSQL database (for vector storage of memories)
  • API keys for your chosen LLM provider (OpenAI, OpenRouter, or Ollama)
  • Docker if running the MCP server as a container (recommended)

Installation

Using uv

mcp-mem0 FAQ

Which apps does this work with?
Claude Desktop and Windsurf are shown in the readme, and any MCP-capable client can connect either directly or over a local web address.
Do I need an API key?
Yes. You need a key for OpenAI or OpenRouter, or a local Ollama setup, plus a Postgres or Supabase database.
Can I use this to stop repeating my preferences to an assistant?
Yes — save them once and the assistant can search them back up in later sessions.
How hard is setup?
This is developer territory: Python 3.12, a database, several environment variables, and usually Docker.
Where do my memories live?
In a Postgres database you run or host yourself, not inside someone else's product.
Is it meant for daily use or as an example?
Both. It works as it stands, and the author presents it as a template for building your own server in Python.