cf-memory
Provides access to Cloudflare Agent Memory for storing facts, recalling semantically with synthesized answers, ingesting conversations, generating summaries, and managing namespaces.
Adds Cloudflare memory as a Hermes provider with background prefetch/turn sync, memory management tools, session-end ingest, and provider status integration.
Can be used as a memory backend in LangChain to store facts, recall answers, ingest conversations, and retrieve summaries.
Can be used as a memory backend in LangGraph applications to store facts, recall answers, ingest conversations, and retrieve summaries.
Lets OpenAI Codex agents persist and recall cross-session memories using Cloudflare Agent Memory.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cf-memoryremember that the user prefers Python over TypeScript for new projects"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CF Memory Plugin
Cloudflare Agent Memory for every AI coding agent and LLM framework.
Gives your agent persistent, cross-session memory powered by Cloudflare Agent Memory — a managed service that handles recall, fact extraction, and profile summaries. No vector DB to run, no embeddings to manage, no Worker to deploy.
Who this is for
AI coding agents (Claude Code, Codex, Cursor, Hermes, OpenClaw, TRAE, OpenCode, pi) that need to remember context across sessions
LLM frameworks (LangChain, LangGraph) building agents with persistent memory
MCP clients (any tool supporting Model Context Protocol)
Agent-to-agent systems using the A2A protocol
Anyone who wants a simple, hosted memory backend for their AI agent
What it does
Capability | Description |
Remember | Store facts, instructions, events — CF classifies them automatically |
Recall | Semantic search with synthesized answers (not just raw matches) |
Ingest | Feed conversation turns — CF extracts facts/events/instructions/tasks |
Summary | Markdown profile of everything stored, auto-generated |
Namespaces | Isolate memory per app, user, or environment |
Quick start (any agent)
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 testAgent integrations
MCP clients (universal)
Works with any MCP-compatible client: Claude Desktop, Cursor, Windsurf, Continue, Zed, and more.
{
"mcpServers": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID": "your-account-id"
}
}
}
}Tools exposed: remember, recall, list_memories, get_memory, delete_memory, ingest, summary, list_namespaces, create_namespace, delete_namespace
Hermes
Auto-discovered via pip entry point. No files to copy.
# 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 cardWhat Hermes gets:
prefetch()— 0ms (cached + background recall)sync_turn()— 0ms (daemon thread ingest)6 agent tools:
cf_remember,cf_recall,cf_list,cf_get,cf_summary,cf_deleteon_session_end— auto-ingests full session for fact extractionSystem prompt injection with provider status
Claude Code
Add to .claude/mcp.json in your project:
{
"mcpServers": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID": "your-account-id"
}
}
}
}Or add globally: claude mcp add cf-memory -- cf-memory serve
Codex (OpenAI)
Add to ~/.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
Add to .cursor/mcp.json in your project:
{
"mcpServers": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID": "your-account-id"
}
}
}
}OpenClaw
Add to your OpenClaw config:
{
"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
Add MCP server in TRAE settings or .trae/mcp.json:
{
"mcpServers": {
"cf-memory": {
"command": "cf-memory",
"args": ["serve"],
"env": {
"MCP_CLOUDFLARE_API_KEY": "your-token",
"CF_ACCOUNT_ID": "your-account-id"
}
}
}
}OpenCode
Add to ~/.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
Add MCP server to pi config:
{
"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
Install as a plugin:
pip install git+https://github.com/hansakoch/cf-memory-plugin.gitThe package registers via hermes_agent.memory_providers entry point. Any Agent Plugins 1.0 compatible host discovers it automatically.
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)
Start the A2A server for peer agents to discover and call:
cf-memory a2a --port 9120Agent card at http://localhost:9120/.well-known/agent.json
Skills: remember, recall, ingest, list, get, summary
Python (standalone)
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())Configuration
Environment variables
Variable | Required | Description |
| Yes | Cloudflare API token with Agent Memory permission |
| No | Cloudflare Account ID (defaults to Iceberg Media) |
| No | Namespace name (default: |
| No | Profile name (default: |
Getting a Cloudflare API token
Create a token with Agent Memory permission
You need a paid Workers subscription and beta access to Agent Memory
Limits (official)
Feature | Limit |
Messages per ingest() | 500 |
Message content | 32 KB UTF-8 |
Recall query | 1 KB UTF-8 |
Session ID | 64 chars |
Profile name | 100 chars |
Namespace name | 32 chars |
Performance
Designed to never add latency to your agent's turns:
Operation | Latency | Blocking? |
| 0ms | No — cached + background |
| 0ms | No — daemon thread |
| 1.3–3.8s | User-initiated |
| ~5s | User-initiated |
| ~0.4s | User-initiated |
| ~0.8s | User-initiated |
CLI reference
# 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 cardDevelopment
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/ -vLicense
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