Skip to main content
Glama

mcp-mem0

mem0(セルフホスト / オープンソース)向けの MCPサーバーで、Qdrant をバックエンドに使用します。各リクエストは HTTPヘッダーで指定された名前の Qdrant コレクション を対象とするため、同じ名前を送信するクライアントはメモリを共有し、異なる名前は分離されたままになります。

ツール

Tool

目的

add_memory

メモリを保存します(LLMによるファクト抽出、または infer=false の場合は生のまま)

search_memory

リクエストのコレクション内をセマンティック検索します

update_memory

IDでメモリの内容を置き換えます

delete_memory

IDでメモリを削除します

get_memory

IDで1件のメモリを取得します

list_memories

スコープ内のメモリを一覧表示します

memory_history

メモリの変更履歴

delete_all_memories

スコープ内のすべてのメモリを削除します

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_idMEM0_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.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_HEADERMEM0_COLLECTION_PREFIXQDRANT_HOST/QDRANT_PORT(または QDRANT_URL+QDRANT_API_KEY)、MEM0_EMBEDDING_DIMS(エンベッダーと一致させる必要があります)、および MEM0_LLM_* / MEM0_EMBEDDER_* プロバイダーブロック(openai / ollama / …)。

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

View all related MCP servers

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.

View all MCP Connectors

Latest Blog Posts

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