cf-memory
Provides MCP tools for persistent, cross-session memory via Cloudflare Agent Memory, enabling agents to store, recall, ingest, summarize, and manage memory namespaces.
README
CF Memory Plugin
Persistent memory for AI agents, backed by Cloudflare Agent Memory.
This plugin is a thin client. Cloudflare stores, classifies, and recalls memories. You do not run a vector DB, embeddings pipeline, or Worker.
Private beta. Paid Workers is required. Paid Workers alone is not enough — you still need Agent Memory entitlement.
| Need | Link |
|---|---|
| Join the beta | Waitlist form |
| Product docs | developers.cloudflare.com/agent-memory |
| HTTP API | HTTP API |
| Pricing | Agent Memory pricing |
| Limits | Platform limits |
| Create a token | API Tokens |
| Create a token (docs) | Create API token |
| Workers Paid | Workers pricing |
| Design notes | Introducing Agent Memory |
60-second setup
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 test
CF_ACCOUNT_ID is required. There is no default account. Find it in the
Cloudflare dashboard sidebar.
Create the token at dash.cloudflare.com/profile/api-tokens with Agent Memory permission only. Do not reuse a Global API Key.
What this is
| You call | Cloudflare does |
|---|---|
remember |
Store one fact / instruction / event |
recall |
Search + synthesize an answer (~5s) |
ingest |
Extract memories from a conversation (writes land 3–8s later) |
summary |
Markdown profile of what is stored |
list / get / delete |
Inspect or remove entries |
Cost
| Item | Today | Source |
|---|---|---|
| Agent Memory | $0 during private beta. 30-day notice before billing. | Pricing |
| Workers Paid (required to apply) | $5/month minimum | Workers pricing |
| This plugin | Free (MIT). Your own HTTP calls only. | — |
Recommended: Workers Paid on the account that will hold memory. Do not put production memory on a free account. Do not assume every paid Workers account has Agent Memory — we verified paid ≠ entitlement.
After beta, treat Agent Memory as a separate bill. Cloudflare has not published GA rates yet.
Dependencies
Runtime:
| Package | Why |
|---|---|
| httpx | HTTPS client to api.cloudflare.com |
| mcp | MCP server (cf-memory serve) |
Optional:
| Extra | Packages | When |
|---|---|---|
pip install 'cf-memory-plugin[a2a]' |
starlette, uvicorn | A2A peer server |
pip install 'cf-memory-plugin[dev]' |
pytest, pytest-asyncio, respx | Tests |
No Cloudflare Worker, Wrangler, D1, Vectorize, or Workers AI binding is required for this plugin. Those are Cloudflare products this client does not use.
Security
Follow Cloudflare's token rules: API token best practices.
- Store
MCP_CLOUDFLARE_API_KEYin the environment or a secret store. Never commit it. - Scope the token to Agent Memory on one account.
- Set
CF_ACCOUNT_IDyourself. This plugin will not fall back to another account. cf-memory a2abinds to127.0.0.1by default. Do not expose it to the public internet without auth.ingestandsync_turnsend conversation text to Cloudflare. Do not ingest secrets, passwords, or customer PII you are not allowed to store.- Use one namespace per app and one profile per user/tenant.
- Rotate the token from the API Tokens page if it leaks.
See SECURITY.md.
Use it from an agent
Same MCP block everywhere. Only the config file path changes.
{
"mcpServers": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID": "your-account-id"
}
}
}
}
| Agent | Where to put it | Docs |
|---|---|---|
| Claude Code | .claude/mcp.json or claude mcp add cf-memory -- cf-memory serve |
MCP |
| Codex | ~/.codex/config.toml → [mcp_servers.cf-memory] |
OpenAI Codex |
| Cursor | .cursor/mcp.json |
Cursor MCP |
| Hermes | hermes config set memory.provider cloudflare-memory |
Memory providers |
| OpenClaw | host MCP config | OpenClaw |
| TRAE | .trae/mcp.json |
TRAE |
| OpenCode | ~/.opencode/config.json |
OpenCode |
| pi | host MCP config | pi |
| Any MCP client | stdio cf-memory serve |
MCP spec |
| LangChain / LangGraph | Python CloudflareMemoryClient |
LangChain |
| A2A peers | cf-memory a2a --port 9120 |
Agent card at /.well-known/agent.json |
Hermes is the only native provider. It prefetches in the background so recall does not add ~5s to every turn.
hermes config set memory.provider cloudflare-memory
hermes cloudflare-memory test
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:
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
Deploy the landing page (optional)
The plugin itself is not a Worker. The public page at cloudflare-memory.pages.dev is a static Cloudflare Pages site.
# 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
Credits
- Memory backend: Cloudflare Agent Memory (blog, Discord, Community)
- Protocol: Model Context Protocol
- Hermes provider contract: Nous Research Hermes Agent
- HTTP client: httpx
This repo is not affiliated with Cloudflare or Nous Research.
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。