Cloudflare Agents SDK
Build stateful globally distributed AI agents on Durable Objects, SQLite, and Workers
Replaces custom scripts and internal glue code for sandboxes & code execution workflows.
Dossier overview
Cloudflare Agents SDK lets developers deploy persistent AI agents directly on Cloudflare's edge network using Durable Objects, WebSockets, scheduled tasks, SQLite state, and built-in remote MCP server hosting.
Quickstart
npm i agentsWhat people say on X
Live feed on X ↗We pull unfiltered builder mentions (praise and complaints) from X on our daily sync. Inspect the live unfiltered stream directly on X right now:
Read latest "Cloudflare Agents SDK" mentions on X ↗Best use cases
- Deploying stateful per-user agents with embedded SQLite
- Hosting remote OAuth-protected MCP servers at the edge
- Running scheduled background agent loops with zero idle cost
Field notes
Strengths
- Hibernatable WebSockets and scheduled alarms
- Embedded SQLite database per agent instance
- Designed specifically for agent builders
Tradeoffs
- Free/starter tiers have rate or seat limits
- Self-hosting requires managing your own model keys and runtime
Compare with Sandboxes alternatives
| Tool | Best for | Runs in | Pricing | Setup |
|---|---|---|---|---|
| Cloudflare Agents SDK | Agent builders | MCP · API / SDK | Freemium | CLI / SDK install |
| E2B | Dev teams / BYOK | API / SDK | Freemium | CLI / SDK install |
| Daytona | Agent builders | API / SDK | Freemium | CLI / SDK install |
| Modal | Agent builders | API / SDK | Freemium | CLI / SDK install |
| Fly Machines | Agent builders | API / SDK | Paid | API / SDK setup |