cf-memory
CF Memory Plugin
あらゆるAIコーディングエージェントとLLMフレームワークのためのCloudflare Agent Memory。
あなたのエージェントに、クラウド上で永続的かつセッションをまたいだメモリを提供します。Cloudflare Agent Memoryを利用します。これはリコール、事実抽出、プロフィールサマリーを処理するマネージドサービスです。ベクトルDBの運用も、エンベディングの管理も、Workerのデプロイも不要です。
対象となるユーザー
AIコーディングエージェント(Claude Code、Codex、Cursor、Hermes、OpenClaw、TRAE、OpenCode、pi)— セッションをまたいでコンテキストを記憶する必要があるもの
LLMフレームワーク(LangChain、LangGraph)— 永続的なメモリを持つエージェントを構築するもの
MCPクライアント — Model Context Protocolをサポートするあらゆるツール
A2Aプロトコルを使用するエージェント間システム
AIエージェント向けのシンプルなホスト型メモリバックエンドを求めるすべての人
機能
機能 | 説明 |
記憶 | 事実、指示、イベントを保存 — CFが自動的に分類します |
リコール | 合成された回答を生成するセマンティック検索(生の一致結果だけではありません) |
取り込み | 会話のやり取りを渡す — CFが事実/イベント/指示/タスクを抽出します |
サマリー | 保存されたすべての内容のMarkdownプロフィールを自動生成 |
名前空間 | アプリ、ユーザー、環境ごとにメモリを分離 |
クイックスタート(任意のエージェント)
pip install git+https://github.com/hansakoch/cf-memory-plugin.git
# Set credentials
export MCP_CLOUDFLARE_API_KEY="your-cf-api-token"
export CF_ACCOUNT_ID="your-account-id"
# Test it works
cf-memory testエージェント連携
MCPクライアント(汎用)
MCP互換のあらゆるクライアント(Claude Desktop、Cursor、Windsurf、Continue、Zedなど)で動作します。
{
"mcpServers": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID": "your-account-id"
}
}
}
}公開されるツール: remember、recall、list_memories、get_memory、delete_memory、ingest、summary、list_namespaces、create_namespace、delete_namespace
Hermes
pipエントリポイント経由で自動検出されます。コピーするファイルはありません。
# Install
pip install git+https://github.com/hansakoch/cf-memory-plugin.git
# Activate
hermes config set memory.provider cloudflare-memory
# Verify
hermes memory status
# Management
hermes cloudflare-memory status
hermes cloudflare-memory test
hermes cloudflare-memory namespaces
hermes cloudflare-memory cardHermesが利用できるもの:
prefetch()— 0ms(キャッシュ+バックグラウンドでのリコール)sync_turn()— 0ms(デーモンスレッドによる取り込み)エージェントツール6種:
cf_remember、cf_recall、cf_list、cf_get、cf_summary、cf_deleteon_session_end— セッション全体を自動取り込みし、事実を抽出プロバイダーの状態を含むシステムプロンプトの注入
Claude Code
プロジェクトの.claude/mcp.jsonに追加します:
{
"mcpServers": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID": "your-account-id"
}
}
}
}またはグローバルに追加します: claude mcp add cf-memory -- cf-memory serve
Codex(OpenAI)
~/.codex/config.tomlに追加します:
[mcp_servers.cf-memory]
command = "cf-memory"
args = ["serve"]
env = { MCP_CLOUDFLARE_API_KEY = "your-token", CF_ACCOUNT_ID = "your-account-id" }Cursor
プロジェクトの.cursor/mcp.jsonに追加します:
{
"mcpServers": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID": "your-account-id"
}
}
}
}OpenClaw
OpenClawの設定に追加します:
{
"mcpServers": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID": "your-account-id"
}
}
}
}TRAE / TRAE CN / TraeCode CLI 2.0
TRAEの設定、または.trae/mcp.jsonでMCPサーバーを追加します:
{
"mcpServers": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID": "your-account-id"
}
}
}
}OpenCode
~/.opencode/config.jsonに追加します:
{
"mcp": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID": "your-account-id"
}
}
}
}pi
piの設定にMCPサーバーを追加します:
{
"mcpServers": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID = "your-account-id"
}
}
}
}Agent Plugins 1.0
プラグインとしてインストールします:
pip install git+https://github.com/hansakoch/cf-memory-plugin.gitこのパッケージはhermes_agent.memory_providersエントリポイント経由で登録されます。Agent Plugins 1.0互換のホストは、自動的にそれを検出します。
LangChain / LangGraph
import asyncio
from cloudflare_memory import CloudflareMemoryClient
# Use as a memory backend in your LangChain/LangGraph agent
client = CloudflareMemoryClient(
account_id="your-account-id",
api_token="your-token",
namespace="my-agent",
profile="user-123",
)
# Store a fact
entry = asyncio.run(client.remember("User prefers Python over JavaScript."))
# Recall
result = asyncio.run(client.recall("What programming language does the user prefer?"))
print(result.answer) # "Python"
# Ingest a conversation
asyncio.run(client.ingest([
{"role": "user", "content": "I'm building a RAG pipeline."},
{"role": "assistant", "content": "Great! Let me help with that."},
]))
# Get summary
summary = asyncio.run(client.get_summary())A2A(Agent-to-Agent)
ピアエージェントが検出して呼び出せるように、A2Aサーバーを起動します:
cf-memory a2a --port 9120エージェントカード: http://localhost:9120/.well-known/agent.json
スキル: remember、recall、ingest、list、get、summary
Python(スタンドアロン)
import asyncio
from cloudflare_memory import CloudflareMemoryClient
async def main():
async with CloudflareMemoryClient(
account_id="your-account-id",
api_token="your-token",
namespace="my-app",
profile="default",
) as client:
# Remember
entry = await client.remember("User is based in London.")
print(f"[{entry.type}] {entry.summary}")
# Recall
result = await client.recall("Where is the user based?")
print(result.answer)
# Ingest conversation (async — memories appear 3-8s later)
await client.ingest([
{"role": "user", "content": "I prefer dark mode."},
{"role": "assistant", "content": "Noted!"},
])
# Summary
print(await client.get_summary())
asyncio.run(main())設定
環境変数
変数 | 必須 | 説明 |
| Yes | Agent Memory権限を持つCloudflare APIトークン |
| No | CloudflareアカウントID(デフォルト: Iceberg Media) |
| No | 名前空間名(デフォルト: |
| No | プロフィール名(デフォルト: |
Cloudflare APIトークンの取得
Agent Memory権限を持つトークンを作成します
有料のWorkersサブスクリプションとAgent Memoryのベータアクセスが必要です
制限(公式)
機能 | 制限 |
ingest()あたりのメッセージ | 500 |
メッセージの内容 | 32 KB UTF-8 |
Recallクエリ | 1 KB UTF-8 |
セッションID | 64文字 |
プロフィール名 | 100文字 |
名前空間名 | 32文字 |
パフォーマンス
エージェントのターンに遅延を加えないよう設計されています:
操作 | レイテンシ | ブロックする? |
| 0ms | いいえ — キャッシュ+バックグラウンド |
| 0ms | いいえ — デーモンスレッド |
| 1.3–3.8 | ユーザー起動 |
| ~5s | ユーザー起動 |
| ~0.4s | ユーザー起動 |
| ~0.8s | ユーザー起動に起動 |
CLI リファレンス
# Standalone
cf-memory test # Connectivity check
cf-memory serve [--transport stdio|sse] # MCP server
cf-memory a2a [--port 9120] # A2A agent server
cf-memory card # Print agent card JSON
# Hermes plugin
hermes cloudflare-memory status # Provider status
hermes cloudflare-memory test # Full connectivity test
hermes cloudflare-memory namespaces # List namespaces
hermes cloudflare-memory create-ns NAME # Create namespace
hermes cloudflare-memory delete-ns NAME # Delete namespace
hermes cloudflare-memory card # Print agent card開発
git clone https://github.com/hansakoch/cf-memory-plugin.git
cd cloudflare-memory
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest tests/ -vライセンス
MIT
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 Connectors
Shared, governed long-term memory for AI agents across tools and sessions via MCP and REST.
Shared long-term memory vault for AI agents with 20 MCP tools.
Your memory, everywhere AI goes. Build knowledge once, access it via MCP anywhere.
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/hansakoch/cf-memory-plugin'
If you have feedback or need assistance with the MCP directory API, please join our Discord server