Integrations
Optional integration for knowledge graph features when self-hosting Mem0, allowing creation and management of graph relationships between memory entities
Mem0 MCP Server
A Model Context Protocol (MCP) server for integrating AI assistants with Mem0.ai's persistent memory system.
Overview
This server provides MCP-compatible tools that let any compatible AI assistant access and manage persistent memories stored in Mem0. It acts as a bridge between AI models and the Mem0 memory system, enabling assistants to:
- Store and retrieve memories
- Search memories with semantic similarity
- Manage different memory types (episodic, semantic, procedural)
- Utilize short-term memory for conversation context
- Apply selective memory patterns
- Create knowledge graphs from memories
Project Structure
The project code is located within the src/mcp_mem0_general/
directory.
Getting Started (No Installation Needed!)
This server can be run directly from GitHub using uvx
without needing to clone the repository or install it locally.
Running the Server
Ensure you have uv
installed (pipx install uv
or brew install uv
).
You can test the server directly in your terminal:
The server should start and log its initialization steps.
Setting up in Cursor or Claude Desktop
- Find
uvx
Path: GUI applications like Claude Desktop often don't use the samePATH
as your terminal. Find the full path to youruvx
executable by running this in your terminal:Copy the output path (e.g.,Copy/Users/yourname/.local/bin/uvx
or/opt/homebrew/bin/uvx
). - Configure MCP: Add the following configuration to your MCP configuration file, replacing
/full/path/to/uvx
with the actual path you found in step 1.- Cursor: Add/update in
~/.cursor/mcp.json
: - Claude Desktop: Add/update a similar configuration in your settings.
Copy - Cursor: Add/update in
- Restart: Restart Cursor or Claude Desktop to apply the changes. The server should now start correctly within the application.
Note on mem0ai[neo4j]
Warning
You might see a warning like warning: The package mem0ai==0.1.96 does not have an extra named neo4j
during startup.
- If using the managed Mem0.ai platform: This warning can be safely ignored. The necessary graph processing happens server-side on the Mem0 platform.
- If self-hosting Mem0 with Neo4j: This warning indicates that the specific
mem0ai
version didn't automatically install Neo4j-related Python libraries (langchain-neo4j
,neo4j
). You would need to ensure these are installed manually in your self-hosted environment if using graph features.
Loading the Usage Guide into Memory (Recommended)
To make it easy for your AI assistant to reference the server's capabilities, you can load the USAGE_GUIDE.md
content into Mem0. Follow these steps:
Prerequisite: Ensure the Mem0 MCP server is running and configured correctly in your AI assistant (Claude/Cursor) as described in the "Getting Started" section above.
- Copy the Guide Content: Open the USAGE_GUIDE.md file. Select and copy its entire text content.
- Ask Assistant to Add Memory: Go to your AI assistant (Claude/Cursor) and use a prompt similar to this, pasting the guide content you copied where indicated. Make sure to use your consistent
user_id
(e.g., "default_user").Copy
Please remember the following usage guide for the Mem0 MCP server. Use user_id "default_user" and add metadata {"title": "Mem0 MCP Usage Guide", "source": "README Instruction"}
:
[--- PASTE THE ENTIRE USAGE_GUIDE.md CONTENT HERE ---]
- Retrieve the Guide Later: Now that you have the ID, you can quickly ask your assistant to recall the full guide anytime using a prompt like this:(ReplaceCopy
your-guide-id-here
with the actual ID you noted down in step 3).
Memory Types
The server supports different memory types organized by duration and function:
Short-Term Memories
- Conversation Memory: Recall of recent message exchanges
- Working Memory: Temporary information being actively used
- Attention Memory: Information currently in focus
Long-Term Memories
- Episodic Memory: Specific events and experiences
- Semantic Memory: Facts, concepts, and knowledge
- Procedural Memory: Skills and how-to information
Advanced Features
- Custom Categories: Define and manage your own memory categories
- Memory Instructions: Set guidelines for how memories should be processed
- Graph Relations: Access knowledge graph relationships between entities
- Selective Memory: Filter text with include/exclude patterns before storing
- Feedback Mechanism: Provide feedback on memory quality
Usage
All memories in the system use "default_user" as the default user_id.
For detailed usage examples, see the USAGE_GUIDE.md.
Documentation
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Mem0.ai for their excellent memory API
- Model Context Protocol (and its Python SDK
mcp
) for the server implementation - All contributors to this project
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A Model Context Protocol server that integrates AI assistants with Mem0.ai's persistent memory system, allowing models to store, retrieve, search, and manage different types of memories.
Related MCP Servers
- -securityFlicense-qualityA Model Context Protocol server that connects AI assistants like Claude to Notion workspaces, enabling them to view, search, create, and update Notion databases, pages, and content blocks.Last updated -275JavaScript
- -securityFlicense-qualityA Model Context Protocol server that provides persistent task management capabilities for AI assistants, allowing them to create, update, and track tasks beyond their usual context limitations.Last updated -1TypeScript
- -securityFlicense-qualityA TypeScript implementation of the Model Context Protocol server that enables creation, management, and semantic search of memory streams with Mem0 integration.Last updated -TypeScript
- AsecurityFlicenseAqualityA Model Context Protocol server that enables AI assistants to interact with the Omi API for retrieving and creating conversations and memories for users.Last updated -4TypeScript