- Home
- MCP servers
- Mem0
Mem0
- python
4
GitHub Stars
python
Language
4 months ago
First Indexed
3 weeks ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Mem0 MCP Server provides a self-hosted, persistent memory layer for AI assistants via the MCP protocol. It enables multi-LLM workflows, memory graphs, semantic search, and secure token-based access all within a single deployable stack you can run locally or in your environment.
How to use
Connect your MCP client (for example Claude Code) to the Mem0 MCP Server using the HTTP Stream transport. Use the endpoint with a trailing slash: http://localhost:8080/mcp/. Authenticate each request with your token and user identifier as headers. Once connected, you can store memories, perform semantic searches, and leverage the Memory Intelligence tools to build and analyze knowledge graphs.
How to install
Prerequisites you need before installation:
-
Docker and Docker Compose installed and available on your system.
-
An Ollama server with models (or an OpenAI/Anthropic API key if you prefer cloud models). Prepare embeddings models as shown in the configuration settings.
Step-by-step setup you can follow to get the stack running in your environment:
-
Create a workspace for Mem0 MCP and navigate into it.
-
Copy the example environment configuration and adjust it if needed.
-
Start the entire stack with the one-command deployment script.
-
Run database migrations for authentication and set up a token for your account.
-
Add the Mem0 MCP server to your Claude Code configuration and verify the connection.
Concrete commands you should run (based on the deployment flow):
# 1. Create your working directory and navigate there
cd /path/to/mem0-mcp
# 2. Copy the example environment and edit it as needed
cp .env.example .env
nano .env # adjust OLLAMA_BASE_URL or other settings if necessary
# 3. Start the stack with the one-command deployment script
./scripts/start.sh
# 4. Apply database migrations for authentication
./scripts/migrate-auth.sh
# 5. Create an authentication token for your user
python3 scripts/mcp-token.py create \
--user-id your.email@company.com \
--name "Your Name" \
--email your.email@company.com
# 6. Export the token and user ID for your shell session
export MEM0_TOKEN='mcp_abc123...'
export MEM0_USER_ID='your.email@company.com'
# 7. Add the Mem0 MCP server to Claude Code (HTTP Stream)
# In Claude, configure the MCP server with URL http://localhost:8080/mcp/ and headers
Additional sections
Configuration and security play a central role in how you use Mem0 MCP Server. You can customize LLM providers, project isolation, and chunking behavior to fit your workflow. The stack includes a robust authentication system, token management, and audit logging to track usage and access.
Key security practices include keeping tokens secure, restricting network access to trusted environments, and rotating tokens regularly. Use TLS termination for production deployments and monitor audit logs for unusual activity.
If you need to stop, restart, or clean the stack, use the provided helper scripts to manage the lifecycle of all services.
Available tools
add_coding_preference
Store code snippets and implementation details in memory for future retrieval and contextual use.
search_coding_preferences
Semantically search stored coding memories to find relevant snippets and configurations.
get_all_coding_preferences
Retrieve all stored coding memories for a given user or project.
delete_memory
Delete a specific memory by its ID to manage memory lifecycle.
get_memory_history
View the change history for a memory and track revisions.
link_memories
Create typed relationships between memories to form a knowledge graph.
get_related_memories
Traversal to discover memories connected to a given memory.
analyze_memory_intelligence
Generate comprehensive intelligence reports with health scores, clusters, and recommendations.
create_component
Create a component node to map system architecture within the memory graph.
link_component_dependency
Define dependencies between components to model system relations.
analyze_component_impact
Analyze cascading effects of changes across components.
create_decision
Record technical decisions with pros, cons, and alternatives.
get_decision_rationale
Retrieve the rationale behind a recorded decision.