mcp-mem0
mcp-mem0
面向 mem0(自托管 / 开源)的 MCP 服务器,由 Qdrant 提供支持。每个请求都针对一个 以 HTTP 标头命名的 Qdrant 集合,因此发送相同名称的客户端可以共享记忆,而不同的名称则会相互隔离。
工具
工具 | 用途 |
| 存储记忆(LLM 事实提取,或使用 |
| 在请求的集合内进行语义搜索 |
| 按 id 替换记忆的内容 |
| 按 id 删除记忆 |
| 按 id 获取一条记忆 |
| 列出某作用域下的记忆 |
| 记忆的变更历史 |
| 删除某作用域下的所有记忆 |
Related MCP server: mem0-open-mcp
集合路由的工作原理
集合名称 从 HTTP 请求的标头(默认
X-Collection)中读取,并映射到 Qdrant 集合mem0_<name>(前缀可配置;将其留空则以原样使用该值)。标头值会针对^[A-Za-z0-9_-]{1,64}$进行验证。共享: 发送相同集合名称的任何客户端都共享相同的记忆。不同的名称相互隔离。
每个集合都会构建并缓存一个
AsyncMemory实例。集合 仅由标头决定 —
user_id/agent_id/run_id绝不会影响使用哪个集合;它们只是在 集合内部 进行收窄,并且是可选的。不带并集合进行搜索 / 列出将覆盖整个集合。add_memory仍然需要至少一个 id 才能存储(mem0 的要求);当调用方在写入时省略全部三个时,会应用默认的user_id(MEM0_DEFAULT_USER_ID)。
快速开始
# 1. Start Qdrant
docker compose up -d qdrant
# 2. Configure
cp .env.example .env
# edit .env: set OPENAI_API_KEY (or switch to the Ollama block for a key-free setup)
# 3. Run the server (streamable-HTTP on :8080/mcp)
uv run -m mcp_mem0健康检查:curl localhost:8080/health
Docker
Dockerfile 是多阶段构建,有两个目标:runtime(服务器)和 test(测试套件)。
使用 docker compose(推荐)
cp .env.example .env # set OPENAI_API_KEY (or the Ollama block)
# Qdrant + server together
docker compose up -d --build qdrant server
curl localhost:8080/health
# Run unit tests (no Qdrant / keys needed)
docker compose run --rm tests
# End-to-end smoke against the running server (needs an embedder key)
docker compose run --rm tests python tests/smoke.py在 compose 网络内部,服务器通过 QDRANT_HOST=qdrant(自动设置)访问 Qdrant;测试通过 MCP_URL=http://server:8080/mcp 访问服务器。
使用纯 docker
# Service image
docker build --target runtime -t mcp-mem0 .
docker run --rm -p 8080:8080 --env-file .env -e QDRANT_HOST=host.docker.internal mcp-mem0
# Test image
docker build --target test -t mcp-mem0-test .
docker run --rm mcp-mem0-test # pytest -q验证
# Unit tests (no Qdrant needed)
uv run pytest -q
# End-to-end smoke test (server + Qdrant + embedder must be running)
uv run python tests/smoke.py
# Confirm per-client collections were created
curl localhost:6333/collections配置
所有设置都来自环境变量 / .env — 请参阅 .env.example。
关键项:MEM0_COLLECTION_HEADER、MEM0_COLLECTION_PREFIX、QDRANT_HOST/QDRANT_PORT(或 QDRANT_URL+QDRANT_API_KEY)、MEM0_EMBEDDING_DIMS(必须与嵌入器匹配),以及 MEM0_LLM_* / MEM0_EMBEDDER_* 提供商配置块(openai / ollama / …)。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides memory management tools for AI agents, enabling adding, searching, updating, and deleting memories via the Mem0 API.41MIT
- AlicenseNot gradedqualityCmaintenanceOpen-source MCP server for mem0 that enables memory storage and retrieval using local LLMs, self-hosted, and Docker-free.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceA fully local, self-hosted memory server for MCP clients (Claude Code, Cursor, etc.) that provides persistent memory storage with semantic search, using local embeddings and a local Qdrant vector store.MIT
- AlicenseBqualityCmaintenanceAn MCP server for storing and retrieving memories using Qdrant vector search, acting as a semantic memory layer.2Apache 2.0
Related MCP Connectors
An MCP memory server. One memory your agents share — across models, devices and apps.
Cloud-hosted MCP server for durable AI memory
Shared, governed long-term memory for AI agents across tools and sessions via MCP and REST.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/schwarzesonne13/mem0-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server