Mem0 MCP Selfhosted logo

Mem0 MCP Selfhosted

by elvismdev

Self-hosted memory MCP server using Qdrant, Neo4j, Ollama, and optional Anthropic models for persistent agent context.

Install Mem0 MCP Selfhosted

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "elvismdev-mem0-mcp-selfhosted": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/elvismdev/mem0-mcp-selfhosted.git",
        "mem0-mcp-selfhosted"
      ],
      "env": {
        "MEM0_USER_ID": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

uvx --from git+https://github.com/elvismdev/mem0-mcp-selfhosted.git mem0-mcp-selfhosted

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

The elvismdev/mem0-mcp-selfhosted MCP server provides persistent memory management through Qdrant vector search, optional Neo4j relationships, and Ollama embeddings. It exposes 11 MCP tools for storing, searching, updating, deleting, and inspecting memories and graph entities. Anthropic via Claude Code OAT tokens or a fully local Ollama model can handle memory fact extraction, while session hooks inject memories at startup and save summaries at shutdown. Reach for it when an agent needs self-hosted cross-session context rather than an external memory service.

Use cases

  • Persist project conventions across Claude Code sessions
  • Search prior conversations for relevant development context
  • Build entity relationships alongside semantic memories
  • Run memory extraction entirely with local Ollama models

Key features

  • Qdrant-backed semantic memory search
  • Optional Neo4j entity relationships
  • Ollama bge-m3 embeddings
  • Anthropic or fully local Ollama model support
  • Claude Code session-start and session-stop hooks
  • 11 memory and graph management tools

Tools11

What Mem0 MCP Selfhosted lets your agent do. Expand a tool for its parameters.

Self-reported~201 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

22/22 checks healthy over the last 113d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 5d ago via OSV.dev · mem0-mcp-selfhosted (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars112Stargazers on the source repository.
Last commit8mo agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Tools exposed11Callable tools this server registers over MCP.
Directory activity14 viewsConfig copies, upvotes, and views on AllMCPs.

How Mem0 MCP Selfhosted works

What elvismdev/mem0-mcp-selfhosted MCP server does

The elvismdev/mem0-mcp-selfhosted MCP server adds persistent memory to MCP-compatible agent workflows. It stores semantic memories in Qdrant, uses Ollama with the bge-m3 model to create embeddings, and can maintain entity relationships in Neo4j 5 or later. Neo4j is optional; Qdrant and Ollama are required.

The server supports two main model arrangements. The default uses Claude through a Claude Code session token for fact extraction. Setting MEM0_PROVIDER=ollama switches the main and graph language-model providers to Ollama, allowing a fully local deployment. Google credentials are only needed when using the gemini or gemini_split graph providers.

How it works

Memory records can be added from plain text or conversation history. The server can infer facts, attach metadata, and optionally update the knowledge graph. Semantic searches use Qdrant and support filters, score thresholds, reranking, and graph participation. Non-semantic listing and scope filtering are available separately.

Graph queries search Neo4j entities by name substring or return an entity’s incoming and outgoing relationships. Entity deletion cascades to its associated memories. Updating a memory replaces its text and rebuilds its Qdrant index entry.

The elvismdev/mem0-mcp-selfhosted MCP server also includes Claude Code session hooks. A startup hook searches for project context and recent session summaries, then returns the results as additional context. A stop hook reads a bounded portion of the transcript, creates a summary through memory inference, and saves it. Hook failures are non-fatal, so Claude Code can continue if the memory services are unavailable.

Setup and configuration

Run the server with Python 3.10 or newer and uv. Start Qdrant locally on its default port, 6333, and Ollama on its default port, 11434, with the bge-m3 embedding model available. The documented Claude Code setup launches the project through uvx from its Git repository. Set MEM0_USER_ID to identify the memory scope.

For a local-only deployment, configure MEM0_PROVIDER=ollama and choose an Ollama model with MEM0_LLM_MODEL, such as qwen3:14b. Service-specific settings such as MEM0_LLM_URL and MEM0_EMBED_URL can override the default endpoints. Anthropic deployments can use MEM0_ANTHROPIC_TOKEN, the Claude Code credentials file, or ANTHROPIC_API_KEY, in that priority order. The server can refresh supported Claude Code OAT tokens before expiry.

The included mem0-install-hooks command installs project or global Claude Code hook entries. A CLAUDE.md file can additionally instruct the agent to search and save memories during normal work, complementing the boundary hooks.

Tools and capabilities

The elvismdev/mem0-mcp-selfhosted MCP server exposes these tool groups:

  • Add and search memories, with inference, metadata, filters, thresholds, reranking, and optional graph use.
  • List, retrieve, update, delete, or bulk-delete memories by scope or UUID.
  • List users, agents, and runs with memory counts through Qdrant facets.
  • Delete entities together with their related memories.
  • Search graph entities and retrieve bidirectional relationships.

Limitations and notes

This setup depends on self-hosted Qdrant and Ollama, and graph features additionally depend on Neo4j. Anthropic use may involve Claude subscription OAT authentication or pay-per-use API billing; the Ollama configuration avoids that cloud dependency. The documented client integration targets Claude Code, including its session hooks and CLAUDE.md instructions. Graph processing is disabled by the session hooks to remain within their stated timeout budgets.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Mem0 MCP Selfhosted

Run it through uvx from the Git repository: `uvx --from git+https://github.com/elvismdev/mem0-mcp-selfhosted.git mem0-mcp-selfhosted`. The documented Claude Code setup also provides `MEM0_USER_ID`.

Qdrant and Ollama are required. Neo4j 5 or later is optional for knowledge-graph features.

Yes. Set `MEM0_PROVIDER=ollama` to use Ollama for the main and graph language models, while Ollama also supplies embeddings.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMem0 MCP Selfhosted AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/elvismdev-mem0-mcp-selfhosted?style=directory)](https://allmcps.com/mcp/elvismdev-mem0-mcp-selfhosted)
HTML Embed
<a href="https://allmcps.com/mcp/elvismdev-mem0-mcp-selfhosted"><img src="https://allmcps.com/api/badge/elvismdev-mem0-mcp-selfhosted?style=directory" alt="Mem0 MCP Selfhosted on AllMCPs" /></a>