mem0-mcp

mem0-mcp

Self-hosted Mem0 MCP server integrating Qdrant, Neo4j, and Ollama for semantic memory search, graph entity relationships, and memory management via OpenMemory API.

Category
访问服务器

README

mem0-mcp

MCP server for self-hosted Mem0 with Qdrant vector search + Neo4j graph memory.

Looking for Mem0 Cloud? The official mem0-mcp-server works with the managed platform at app.mem0.ai. This project is for self-hosted deployments where you run your own Qdrant, Ollama, and Neo4j.

Why this exists

The official MCP server requires a Mem0 Cloud API key. If you self-host Mem0 with your own Qdrant and Ollama, there's no off-the-shelf MCP server that connects to your infrastructure. This one does.

What it connects to:

  • Qdrant for vector memory (semantic search)
  • Neo4j for graph memory (entity relationships)
  • Ollama for embeddings (no OpenAI/Anthropic keys needed)
  • OpenMemory API for writes (keeps SQLite + Qdrant in sync)

Tools

Tool Description Backend
search_memories Semantic search across all memories Ollama embed + Qdrant
add_memory Store a new memory OpenMemory API
list_memories List all stored memories Qdrant scroll
delete_memory Delete a memory by ID API + Qdrant fallback
search_graph Find entity relationships Neo4j
get_entity Get all connections for an entity Neo4j

Prerequisites

A self-hosted Mem0 stack running somewhere accessible:

  • Qdrant (vector store)
  • Ollama with an embedding model (e.g., nomic-embed-text)
  • OpenMemory API (mem0ai/mem0)
  • Neo4j 5+ Community or Enterprise (optional, for graph memory)

If these are on a remote server, use SSH tunnels to forward the ports locally.

Setup

1. Install

pip install git+https://github.com/tensakulabs/mem0-mcp.git

2. Configure Claude Code

claude mcp add -s user mem0-mcp -- \
  uvx --from git+https://github.com/tensakulabs/mem0-mcp.git mem0-mcp

Or add to your MCP config manually:

{
  "mcpServers": {
    "mem0": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/tensakulabs/mem0-mcp.git", "mem0-mcp"],
      "env": {
        "MEM0_QDRANT_URL": "http://127.0.0.1:6333",
        "MEM0_OLLAMA_URL": "http://127.0.0.1:11435",
        "MEM0_API_BASE": "http://127.0.0.1:8765",
        "MEM0_NEO4J_URL": "bolt://127.0.0.1:7687",
        "MEM0_NEO4J_PASSWORD": "your-password",
        "MEM0_USER_ID": "your-user-id"
      }
    }
  }
}

3. SSH tunnels (if remote)

If your Mem0 stack is on a remote server:

ssh -f -N \
  -L 8765:127.0.0.1:8765 \
  -L 6333:127.0.0.1:6333 \
  -L 11435:127.0.0.1:11434 \
  -L 7687:127.0.0.1:7687 \
  user@your-server

Configuration

All via environment variables with sensible defaults:

Variable Default Description
MEM0_API_BASE http://127.0.0.1:8765 OpenMemory API (for writes)
MEM0_QDRANT_URL http://127.0.0.1:6333 Qdrant REST API
MEM0_OLLAMA_URL http://127.0.0.1:11435 Ollama (for embeddings)
MEM0_EMBED_MODEL nomic-embed-text:latest Embedding model name
MEM0_COLLECTION openmemory Qdrant collection name
MEM0_USER_ID justin User ID for memory filtering
MEM0_NEO4J_URL bolt://127.0.0.1:7687 Neo4j Bolt endpoint
MEM0_NEO4J_USER neo4j Neo4j username
MEM0_NEO4J_PASSWORD mem0graph Neo4j password

Architecture

Claude Code / Claude Desktop
  └── MCP stdio → mem0-mcp
        ├── READS  → Qdrant (vector search, all memories)
        ├── SEARCH → Ollama (embed query) + Qdrant (similarity)
        ├── GRAPH  → Neo4j (entity relationships)
        └── WRITES → OpenMemory API (SQLite + Qdrant sync)

Why hybrid read/write? The OpenMemory API uses SQLite as its source of truth for the memory list. If other agents (like OpenClaw) write directly to Qdrant, the API won't see those memories. Reading from Qdrant directly sees everything. Writing through the API keeps both stores in sync.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选