Cloudflare Memory MCP
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., "@Cloudflare Memory MCPremember that the billing client uses Stripe subscriptions"
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.
Cloudflare Memory MCP
A per-project memory MCP server for opencode, hosted entirely on Cloudflare's free tier:
Notes — plain keyed memories with tags and types
Vector — semantic recall via Vectorize (embeddings from Workers AI
@cf/baai/bge-m3, 1024-dim, multilingual)Graph — entities + relations in D1 (SQLite) with recursive traversal
Web dashboard — open
/in a browser to see every project with memories. Each project card opens a detail view with an interactive force-directed graph of its entities and relations (wheel = zoom, drag = pan, double-click or buttons = reset, hover = highlight neighbors) and a Delete project button that removes the project, its notes, graph, FTS rows, caches, and vector embeddings
opencode ── MCP (streamable HTTP + Bearer auth) ──> Worker
├─ Vectorize memory-vectors (namespace per project)
├─ D1 projects / notes / nodes / edges / FTS5
├─ Workers AI bge-m3 embeddings
└─ KV recent-memories cacheScreenshots
Project List
The dashboard lists every project known to the account, including memory, entity, relation, and last-active counts.
Knowledge Graph
Open a project to inspect its memories and graph. The graph supports curved, directional edges, hover highlighting, wheel zoom, drag panning, and reset controls.
Related MCP server: MCP Memory
How folder isolation works
The server runs its MCP sessions inside a Durable Object (free tier, SQLite backend), which pins every message for a session to one isolate. Project identity is resolved in this order:
project_roottool argument (recommended) — you pass your working folder to any tool, e.g.remember({ project_root: "D:/Projects/foo", content: ... }). The server hashes a normalized form of the path into a stable project id and remembers it for the rest of the session, so later calls can omit it. Theidentify_projecttool exists for explicitly locking it in.project_idtool argument — an explicit id (also cached for the session).x-project-root/x-project-idheaders — for clients that configure them.MCP roots — automatic folder detection when the client supports it.
Because the identity is just a hash of the normalized path, the same folder opened
from a different absolute path still resolves to the same project. Every read and
write is scoped to that id — Vectorize queries use a namespace-per-project and
every D1 query filters on project_id, so two folders can never see each other's
memory.
Using it from opencode
opencode knows its working directory (your bash cwd). The agent should pass it
once per session. This repo ships a ready-to-copy template at AGENTS.md —
copy it into any project you want memory in, set PROJECT_ROOT to that project's
directory, and the agent will handle identity automatically:
When using the memory MCP tools, pass project_root (your bash cwd) on the first
memory call of the session.Setup
Prereqs: Node 18+, a Cloudflare account, and npx wrangler login done once.
npm install
npm run setup # creates D1 db, KV namespace, Vectorize index; patches wrangler.toml
npm run db:migrate:remote
npx wrangler secret put MEMORY_AUTH_TOKEN # optional but strongly recommended
npm run deployYour endpoints:
MCP:
https://cloudflare-memory-mcp.<your-subdomain>.workers.dev/mcpDashboard:
https://cloudflare-memory-mcp.<your-subdomain>.workers.dev/
Local development:
npm run dev # wrangler dev --local (AI + Vectorize are remote-only)
npm run db:migrate:localWiring into opencode
One entry — the same config works in every project. No per-project values needed:
// ~/.config/opencode/opencode.jsonc
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"memory": {
"type": "remote",
"url": "https://cloudflare-memory-mcp.<your-subdomain>.workers.dev/mcp",
"oauth": false,
"headers": {
"Authorization": "Bearer {env:MEMORY_AUTH_TOKEN}"
}
}
}
}Project identity is then driven by the agent itself: it passes its working folder
as project_root on the first memory call of each session (see the AGENTS.md tip
above), and the server scopes everything to that folder from then on.
The dashboard (/) prompts for the same MEMORY_AUTH_TOKEN once and stores it in
localStorage. If you leave MEMORY_AUTH_TOKEN unset, everything is public — only
do that for personal/throwaway experiments.
MCP tools
Tool | Purpose |
| Lock the project identity for the session from a |
| Save a note (embeds it for semantic recall); optionally upserts |
| Semantic/vector search — recall by meaning. Note: Vectorize mutations are async, so a note is queryable semantically a few seconds after |
| Exact keyword search (D1 FTS5) |
| Latest notes for the project |
| Bundle stats + recent memories + top entities + recent relations (call explicitly) |
| Build the knowledge graph deliberately |
| Neighbors of an entity (depth 1–3) or most-connected entities |
| Delete a note + its embedding |
All tools accept an optional project_root (folder path or file:// URI) and
project_id; once either is supplied in a session it is remembered.
Free-tier budget
Resource | Free allowance | Notes |
Durable Object | 100k requests/day, ~28h/day active compute | Hosts MCP sessions; ~1 request per MCP message |
Vectorize | 5M stored dims account-wide | ~4,800 embedded notes @1024-dim; prune with |
Workers AI | 10k neurons/day | bge-m3 embedding of a 1k-token note ≈ 1 neuron → thousands/day |
D1 | 5 GB / 500 MB per DB | notes + graph + FTS are effectively unlimited for personal use |
KV / Worker | 1 GB / 100k req/day | caches + serving; a few requests per opencode session |
Design levers if you ever approach the vector ceiling: embed only durable memories
(remember with type: "decision" | "fact") and let search_memory (FTS5, uncapped)
hold the long tail; or recreate the index with bge-small (384-dim, English-only)
for ~3× capacity.
Project layout
src/index.ts fetch router: dashboard, /api/*, /mcp -> Durable Object
src/session-do.ts MCP session host (Durable Object): sessions, SSE, roots, identity
src/tools.ts the 10 tool definitions (zod schemas + implementations)
src/store.ts D1 / Vectorize / KV data layer
src/identity.ts project-id derivation from folder roots
src/embed.ts Workers AI bge-m3 embeddings
src/api.ts dashboard API (projects, detail, graph, delete)
src/web.ts dashboard page (token-gated)
migrations/ D1 schema
scripts/setup.mjs creates Cloudflare resources and patches wrangler.toml
AGENTS.md template to copy into projects that use this memory serverThis 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 Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to remember user information and preferences across conversations using vector search technology. Built on Cloudflare infrastructure with isolated user namespaces for secure, persistent memory storage.16MIT
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to remember and retrieve user information across conversations using vector search technology. Built on Cloudflare infrastructure with isolated user namespaces for secure, persistent memory storage.16
- FlicenseNot gradedqualityDmaintenanceProvides cross-device access to a persistent knowledge graph via Cloudflare Workers, enabling memory storage and retrieval through both MCP protocol and REST API with full-text search capabilities.
- AlicenseNot gradedqualityAmaintenanceSelf-hosted semantic memory layer for Claude and MCP-compatible AI clients. Store notes, search by meaning not keywords, and recall relevant context automatically across sessions. Runs free on Cloudflare Workers, D1, Vectorize, and Workers AI4737MIT
Related MCP Connectors
Universal memory for AI agents and tools. Save, organize and search context anywhere.
Cross-session, cross-device memory for your agent: remember and recall notes. No key to start.
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
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/ady133t/Cloudflare-Memory-Mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server