mcp-mem0
mcp-mem0
mem0(セルフホスト / オープンソース)向けの MCPサーバーで、Qdrant をバックエンドに使用します。各リクエストは HTTPヘッダーで指定された名前の Qdrant コレクション を対象とするため、同じ名前を送信するクライアントはメモリを共有し、異なる名前は分離されたままになります。
ツール
Tool | 目的 |
| メモリを保存します(LLMによるファクト抽出、または |
| リクエストのコレクション内をセマンティック検索します |
| IDでメモリの内容を置き換えます |
| IDでメモリを削除します |
| IDで1件のメモリを取得します |
| スコープ内のメモリを一覧表示します |
| メモリの変更履歴 |
| スコープ内のすべてのメモリを削除します |
Related MCP server: mem0-open-mcp
コレクションルーティングの仕組み
コレクション名 は HTTPヘッダー(デフォルトでは
X-Collection)から読み取られ、Qdrant コレクションmem0_<name>にマッピングされます(プレフィックスは設定可能。空に設定すると値をそのまま使用します)。ヘッダー値は^[A-Za-z0-9_-]{1,64}$に対して検証されます。共有: 同じコレクション名を送信するクライアントは同じメモリを共有します。異なる名前は分離されます。
コレクションごとに1つの
AsyncMemoryインスタンスが構築され、キャッシュされます。コレクションはヘッダーのみで選択されます。
user_id/agent_id/run_idは使用するコレクションに一切影響せず、コレクション内の絞り込みにのみ使用され、省略可能です。これらを指定せずに検索・一覧表示すると、コレクション全体が対象になります。add_memoryは保存時に1つのIDを必要とします(mem0の要件)。書き込み時に呼び出し側が3つすべてを省略した場合は、デフォルトの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(テストスイート)の2つのターゲットがあります。
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.pycompose ネットワーク内では、サーバーは 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