mem0 Self-Hosted
🐍 🏠 🍎 🪟 🐧 - Self-hosted mem0 MCP server for Claude Code with Qdrant vector se
What is mem0 Self-Hosted?
mem0 Self-Hosted is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to 🐍 🏠 🍎 🪟 🐧 - self-hosted mem0 mcp server for claude code with qdrant vector se
🐍 🏠 🍎 🪟 🐧 - Self-hosted mem0 MCP server for Claude Code with Qdrant vector se
This server falls under the Knowledge & Memory category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- MCP protocol support
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mem0-mcp-selfhostedConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use mem0 Self-Hosted
mem0-mcp-selfhosted is a fully self-hosted MCP memory server for Claude Code that stores and retrieves conversation context using a local Qdrant vector database for semantic search and an optional Neo4j graph database for entity relationships. It exposes 11 tools — including `add_memory`, `search_memories`, `update_memory`, and `search_graph` — giving Claude persistent, semantically searchable memory across sessions without sending data to any external memory service. It supports both Anthropic and Ollama as LLM backends, making it suitable for fully local, private deployments.
Prerequisites
- Python 3.10 or later and the `uv` package manager (`pip install uv`)
- Qdrant vector database running locally (`docker run -p 6333:6333 qdrant/qdrant`)
- Ollama running locally for embeddings (`ollama pull bge-m3`) — required for the vector store
- Anthropic API key or Ollama for the LLM backend
- Optional: Neo4j 5+ for knowledge graph features (`MEM0_ENABLE_GRAPH=true`)
Start Qdrant vector database
Run Qdrant locally using Docker. This is the required vector store for all memory operations.
docker run -d -p 6333:6333 qdrant/qdrantStart Ollama and pull the embedding model
Ollama is used for generating embeddings. Pull the default `bge-m3` embedding model before starting the MCP server.
ollama pull bge-m3Add the MCP server to Claude Code (Anthropic backend)
Register the server using Claude Code's MCP add command. This installs the package via uvx and configures your user ID for memory scoping. Your Claude Code session token is used automatically for authentication.
claude mcp add --scope user --transport stdio mem0 \
--env MEM0_USER_ID=your-user-id \
-- uvx --from git+https://github.com/elvismdev/mem0-mcp-selfhosted.git mem0-mcp-selfhostedAlternative: fully local setup with Ollama LLM
For a completely offline setup using Ollama for both LLM and embeddings, use the `MEM0_PROVIDER=ollama` env var.
claude mcp add --scope user --transport stdio mem0 \
--env MEM0_PROVIDER=ollama \
--env MEM0_LLM_MODEL=qwen3:14b \
--env MEM0_USER_ID=your-user-id \
-- uvx --from git+https://github.com/elvismdev/mem0-mcp-selfhosted.git mem0-mcp-selfhostedVerify memory tools are available
Restart Claude Code and ask it to save a test memory. Confirm that `add_memory` and `search_memories` appear in the available tools list.
mem0 Self-Hosted Examples
Client configuration
Add this to `claude_desktop_config.json` for the Anthropic-backed setup with Qdrant and Ollama embeddings.
{
"mcpServers": {
"mem0": {
"command": "uvx",
"args": ["--from", "git+https://github.com/elvismdev/mem0-mcp-selfhosted.git", "mem0-mcp-selfhosted"],
"env": {
"MEM0_USER_ID": "your-user-id",
"MEM0_QDRANT_URL": "http://localhost:6333",
"MEM0_LLM_URL": "http://localhost:11434",
"MEM0_EMBED_MODEL": "bge-m3",
"ANTHROPIC_API_KEY": "your-anthropic-key"
}
}
}
}Prompts to try
Use these prompts to exercise persistent memory storage and retrieval across sessions.
- "Remember that I prefer TypeScript over JavaScript for all new projects."
- "Search your memories for anything related to my database architecture decisions."
- "What coding preferences have you stored about me?"
- "Delete all memories about my old AWS setup since we've migrated to GCP."
- "List all entities you know about from our previous conversations."Troubleshooting mem0 Self-Hosted
Server fails to start with 'Connection refused' for Qdrant
Ensure Qdrant is running: `docker ps | grep qdrant`. If not running, start it with `docker run -d -p 6333:6333 qdrant/qdrant`. Verify the URL matches `MEM0_QDRANT_URL` (default: `http://localhost:6333`).
Embedding errors referencing bge-m3 or Ollama
Pull the embedding model in Ollama: `ollama pull bge-m3`. Confirm Ollama is running with `ollama list`. If using a different embed model, set `MEM0_EMBED_MODEL` to match the model name you have pulled.
Authentication errors with Anthropic API
Set either `MEM0_ANTHROPIC_TOKEN` (highest priority) or `ANTHROPIC_API_KEY` in the env block. If using Claude Code, the session token from `~/.claude/.credentials.json` is used automatically and no explicit key is needed.
Frequently Asked Questions about mem0 Self-Hosted
What is mem0 Self-Hosted?
mem0 Self-Hosted is a Model Context Protocol (MCP) server that 🐍 🏠 🍎 🪟 🐧 - self-hosted mem0 mcp server for claude code with qdrant vector se It connects AI assistants to external tools and data sources through a standardized interface.
How do I install mem0 Self-Hosted?
Follow the installation instructions on the mem0 Self-Hosted GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with mem0 Self-Hosted?
mem0 Self-Hosted works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is mem0 Self-Hosted free to use?
Yes, mem0 Self-Hosted is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
mem0 Self-Hosted Alternatives — Similar Knowledge & Memory Servers
Looking for alternatives to mem0 Self-Hosted? Here are other popular knowledge & memory servers you can use with Claude, Cursor, and VS Code.
MemPalace
★ 52.6kA local AI memory system that stores all conversations verbatim and organizes them into navigable structures. It provides 19 MCP tools for AI assistants to search and retrieve past decisions, debugging sessions, and architecture debates automatically
Kratos
★ 25.7k🏛️ Memory System for AI Coding Tools - Never explain your codebase again. MCP server with perfect project isolation, 95.8% context accuracy, and the Four Pillars Framework.
Context Mode
★ 15.4kAn MCP server that preserves LLM context by intercepting large data outputs and returning only concise summaries or relevant sections. It enables efficient sandboxed code execution, file processing, and documentation indexing across multiple programm
Memu
★ 13.7kMemory for 24/7 proactive agents like OpenClaw.
MemOS
★ 9.3kMemOS (Memory Operating System) is a memory management operating system designed for AI applications. Its goal is: to enable your AI system to have long-term memory like a human, not only remembering what users have said but also actively invoking, u
Everos
★ 5.4kBuild, evaluate, and integrate long-term memory for self-evolving agents.
Browse More Knowledge & Memory MCP Servers
Explore all knowledge & memory servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up mem0 Self-Hosted in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use mem0 Self-Hosted?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.