mem0
✨ mem0 MCP Server: A memory system using mem0 for AI applications with model context protocl (MCP) integration. Enables long-term memory for AI agents as a drop-in MCP server.
claude mcp add --transport stdio pinkpixel-dev-mem0-mcp npx -y @pinkpixel/mem0-mcp \ --env MEM0_API_KEY="YOUR_MEM0_API_KEY_HERE" \ --env DEFAULT_APP_ID="your-app-id" \ --env DEFAULT_USER_ID="user123" \ --env DEFAULT_AGENT_ID="your-agent-id"
How to use
Mem0 MCP Server is a Node.js-based service that integrates with Mem0.ai to provide persistent memory capabilities for large language model (LLM) agents. It exposes three core actions to manage memories: add_memory to store a piece of text tied to a user (and optionally a session, agent, app, and metadata), search_memory to find relevant memories for a user using semantic queries, and delete_memory to remove a specific memory by its ID. The server leverages the mem0ai SDK under the hood and can be run via npx, installed globally, or run from a cloned repository. Configure your MCP client to connect to this server and control which actions are allowed through the alwaysAllow list (e.g., add_memory, search_memory, delete_memory).
Once running, you can invoke:
- add_memory with content and userId (plus optional sessionId, agentId, appId, metadata) to persist memory.
- search_memory with a userId and a natural language query to retrieve relevant memories, optionally refining results with filters, threshold, and advanced cloud API options.
- delete_memory with memoryId and userId to permanently remove a memory.
Configure the server in your MCP client using one of the supported launch methods (npx, global install, or direct repo run). The Cloud Storage configuration shown in the README demonstrates how to expose the environment variables and access controls for typical usage.
How to install
Prerequisites:
- Node.js 18.x or newer
- npm (comes with Node.js) or pnpm/yarn if you prefer other package managers
Installation options:
Option 1: Running with npx (no permanent installation)
- Ensure you have a Mem0 API key ready
- Run and connect via MCP client as shown in configuration examples:
# Your MCP client configuration uses npx to run mem0-mcp
npx -y @pinkpixel/mem0-mcp
Option 2: Global installation (recommended for frequent use)
- Install globally:
npm install -g @pinkpixel/mem0-mcp
- Run the server directly with the global command:
mem0-mcp
- Update your MCP client configuration to point to the global command and provide environment variables as needed (MEM0_API_KEY, DEFAULT_USER_ID, etc.).
Option 3: Run from a cloned repository
```bash
git clone https://github.com/pinkpixel-dev/mem0-mcp
cd mem0-mcp
npm install
npm run build
# Then run the built server or expose it via your preferred launcher
Prerequisites for each storage mode are described in the README (Cloud Storage, Supabase Storage, Local Storage). Ensure you have the required environment variables (e.g., MEM0_API_KEY, SUPABASE_URL, SUPABASE_KEY, OPENAI_API_KEY) set in your runtime environment for the chosen mode.
Additional notes
Tips and common considerations:
- For production, prefer Cloud Storage mode with MEM0_API_KEY for persistent memory storage on Mem0's cloud.
- If self-hosting, Supabase Storage mode requires SUPABASE_URL, SUPABASE_KEY, and OPENAI_API_KEY for embeddings.
- Local Storage mode is suitable for development/testing but uses an in-memory vector store unless you configure persistence.
- When using npx or global installation, ensure your environment variables (MEM0_API_KEY, OPENAI_API_KEY, etc.) are kept secure and not committed to version control.
- The MCP client’s alwaysAllow list controls which actions are accessible via the connected client; adjust as needed for your use case.
- If you run into portability issues, verify that the Node.js version matches the supported range (Node.js 18+ as indicated by the badges).
- For cloning and building from source, remember to run npm install and npm run build before starting the server.
Related MCP Servers
PPTAgent
An Agentic Framework for Reflective PowerPoint Generation
mcp-redis
The official Redis MCP Server is a natural language interface designed for agentic applications to manage and search data in Redis efficiently
MCP-PostgreSQL-Ops
🔍Professional MCP server for PostgreSQL operations & monitoring: 30+ extension-independent tools for performance analysis, table bloat detection, autovacuum monitoring, schema introspection, and database management. Supports PostgreSQL 12-17.
mem0 -selfhosted
Self-hosted mem0 MCP server for Claude Code. Run a complete memory server against self-hosted Qdrant + Neo4j + Ollama while using Claude as the main LLM.
metabase-ai-assistant
🚀 The most powerful MCP Server for Metabase - 111+ tools for AI SQL generation, dashboard automation & enterprise BI. Works with Claude, Cursor, ChatGPT.
agentman
Agentman: A tool for building and managing AI agents