mem0 Self-Hosted

v1.0.0Knowledge & Memorystable

🐍 🏠 🍎 🪟 🐧 - Self-hosted mem0 MCP server for Claude Code with Qdrant vector se

ai-memoryanthropicclaude-codeknowledge-graphmcp
Share:
85
Stars
0
Downloads
0
Weekly
0/5

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

Self-hosted memory system for Claude Code
Qdrant vector search integration
Local-only knowledge management
elvismdev

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mem0-mcp-selfhosted

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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`)
1

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/qdrant
2

Start 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-m3
3

Add 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-selfhosted
4

Alternative: 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-selfhosted
5

Verify 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.

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.

Quick Config Preview

{ "mcpServers": { "mem0-mcp-selfhosted": { "command": "npx", "args": ["-y", "mem0-mcp-selfhosted"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides