# elvismdev/mem0-mcp-selfhosted [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/elvismdev/mem0-mcp-selfhosted  
**GitHub Stars:** 107  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/elvismdev-mem0-mcp-selfhosted

## Description
Self-hosted mem0 MCP server for Claude Code with Qdrant vector search, Neo4j knowledge graph, and Ollama embeddings. Zero-config OAT auth, split-model graph routing, session hooks for automatic cross-session memory, and 11 tools. Supports both Anthropic and fully local Ollama setups.

## Tools
Capabilities this server exposes over MCP:

- **add_memory** — Store text or conversation history as memories. Supports `enable_graph`, `infer`, `metadata`.
- **search_memories** — Semantic search with optional `filters`, `threshold`, `rerank`, `enable_graph`.
- **get_memories** — List/filter memories (non-search). Supports `limit` and scope filters.
- **get_memory** — Fetch a single memory by UUID.
- **update_memory** — Replace memory text. Re-embeds and re-indexes in Qdrant.
- **delete_memory** — Delete a single memory by UUID.
- **delete_all_memories** — Bulk-delete all memories in a scope.
- **list_entities** — List users/agents/runs with memory counts. Uses Qdrant Facet API.
- **delete_entities** — Cascade-delete an entity and all its memories.
- **search_graph** — Search Neo4j entities by name substring. Returns entities + outgoing relationships.
- **get_entity** — Get all relationships for an entity (bidirectional: incoming + outgoing).

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "mem0-mcp-selfhosted": {
    "command": "uvx",
    "args": ["--from"],
    "env": {
      "MEM0_USER_ID": ""
    }
  }
}
```

**Requires environment variables:** `MEM0_USER_ID` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

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

_Full upstream README: https://allmcps.com/mcp/elvismdev-mem0-mcp-selfhosted/readme_

