cf-memory
CF Memory Plugin
面向 AI 代理的持久化内存,由 Cloudflare Agent Memory 提供支持。
此插件是一个轻量客户端。Cloudflare 负责存储、分类和回忆记忆。您无需运行向量数据库、嵌入管道或 Worker。
私有测试版。 需要付费 Workers。仅付费 Workers 还不够——您还需要 Agent Memory 权限。
需求 | 链接 |
加入测试版 | |
产品文档 | |
HTTP API | |
定价 | |
限制 | |
创建令牌 | |
创建令牌(文档) | |
Workers 付费版 | |
设计说明 |
60 秒设置
pip install git+https://github.com/hansakoch/cf-memory-plugin.git
export MCP_CLOUDFLARE_API_KEY="cf-api-token-with-agent-memory"
export CF_ACCOUNT_ID="your-32-char-account-id"
cf-memory testCF_ACCOUNT_ID 是必需的。没有默认账户。您可以在 Cloudflare 仪表板 侧边栏中找到它。
在 dash.cloudflare.com/profile/api-tokens 创建令牌,仅授予 Agent Memory 权限。不要重复使用全局 API 密钥。
Related MCP server: agentram-mcp
这是什么
您调用 | Cloudflare 执行 |
| 存储一个事实 / 指令 / 事件 |
| 搜索并综合答案(约 5 秒) |
| 从对话中提取记忆(写入在 3–8 秒后生效) |
| 所存储内容的 Markdown 概要 |
| 检查或删除条目 |
成本
项目 | 当前 | 来源 |
Agent Memory | 私有测试版期间 $0。 计费前 30 天通知。 | |
Workers 付费版(申请必需) | 每月 $5 最低 | |
此插件 | 免费(MIT)。仅您自己的 HTTP 调用。 | — |
建议:在将保存记忆的账户上使用 Workers 付费版。不要将生产记忆放在免费账户上。不要假设每个付费 Workers 账户都有 Agent Memory——我们已验证付费 ≠ 权限。
测试版结束后,请将 Agent Memory 视为单独账单。Cloudflare 尚未公布正式版(GA)费率。
依赖项
运行时:
可选:
附加 | 包 | 用途 |
| starlette, uvicorn | A2A 对等服务器 |
| pytest, pytest-asyncio, respx | 测试 |
此插件不需要 Cloudflare Worker、Wrangler、D1、Vectorize 或 Workers AI 绑定。这些是此客户端不使用的 Cloudflare 产品。
安全
遵循 Cloudflare 的令牌规则:API 令牌最佳实践。
将
MCP_CLOUDFLARE_API_KEY存储在环境变量或密钥存储中。切勿提交它。将令牌范围限定为单个账户上的 Agent Memory。
自行设置
CF_ACCOUNT_ID。此插件不会回退到其他账户。cf-memory a2a默认绑定到127.0.0.1。未经认证,请勿将其暴露到公共互联网。ingest和sync_turn会将对话文本发送到 Cloudflare。请勿摄取您无权存储的机密、密码或客户 PII。每个应用使用一个命名空间,每个用户/租户使用一个配置文件。
如果令牌泄露,请从 API 令牌 页面轮换它。
参见 SECURITY.md。
在代理中使用
所有地方使用相同的 MCP 块。只有配置文件路径不同。
{
"mcpServers": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID": "your-account-id"
}
}
}
}代理 | 放置位置 | 文档 |
| ||
| OpenAI Codex | |
| Cursor MCP | |
| ||
主机 MCP 配置 | OpenClaw | |
| TRAE | |
| OpenCode | |
主机 MCP 配置 | pi | |
任何 MCP 客户端 | stdio | |
Python | LangChain | |
A2A 对等方 |
| 位于 |
Hermes 是唯一的原生提供程序。它在后台预取,因此回忆不会为每次对话增加约 5 秒的延迟。
hermes config set memory.provider cloudflare-memory
hermes cloudflare-memory testPython:
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:
await client.remember("User prefers concise answers.")
result = await client.recall("How should I answer?")
print(result.answer)
asyncio.run(main())CLI
cf-memory test # connectivity
cf-memory serve # MCP (stdio)
cf-memory a2a --port 9120 # A2A on localhost
cf-memory card # print agent card
hermes cloudflare-memory status
hermes cloudflare-memory namespaces部署落地页(可选)
插件本身不是 Worker。位于 cloudflare-memory.pages.dev 的公共页面是一个静态 Cloudflare Pages 站点。
# token needs Pages:Edit on the same account
export CLOUDFLARE_API_TOKEN=...
export CLOUDFLARE_ACCOUNT_ID=...
npx wrangler pages deploy ./public --project-name cf-memory-plugin致谢
内存后端:Cloudflare Agent Memory(博客、Discord、社区)
Hermes 提供程序契约:Nous Research Hermes Agent
HTTP 客户端:httpx
此仓库与 Cloudflare 或 Nous Research 无关。
许可证
This server cannot be deployed
Maintenance
Related MCP Connectors
Cross-tool persistent memory and context for AI assistants over MCP.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
1Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
- KogniteOAuthdev.kognite
Hosted agent memory: store, search, and recall facts across sessions from any MCP client.
Related MCP Servers
- AlicenseAqualityDmaintenancePersistent memory for AI agents. Store, recall, and share knowledge across sessions with five MCP tools: remember, recall, context, forget, and share. Includes semantic search and agent/user/org scoping.53Apache 2.0
- AlicenseAqualityBmaintenanceProvides persistent memory for AI agents via 10 MCP tools that map to the AgentRAM REST API, enabling store, retrieve, search, and share memories across personal and shared namespaces.1033 npmMIT
- AlicenseNot gradedqualityBmaintenanceProvides long-term memory for AI agents via MCP tools to store, recall, and delete memories, with per-user scoping and usage limits.AGPL 3.0
- FlicenseAqualityCmaintenanceEnables LLM agents to persist, search, update, forget, summarize, and manage user cognitive memories through MCP tools.7-