Cloudflare Agents SDK
Build stateful globally distributed AI agents on Durable Objects, SQLite, and Workers
Replaces hand-rolled scripts and custom 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 agentsBest 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
- Open-source codebase you can inspect or self-host
Tradeoffs
- Usage limits apply on free or starter tiers
- Self-hosting requires managing your own keys and runtime
Tags & capabilities
Compare with alternatives
| Tool | Pricing | Open source | Type |
|---|---|---|---|
| Cloudflare Agents SDK (this dossier) | Freemium | Yes | Infrastructure |
| E2B | Freemium | Yes | Infrastructure |
| Runloop | Paid | No | Infrastructure |
| Fly Machines | Paid | No | Infrastructure |
| Beam Cloud | Freemium | No | Infrastructure |
Questions
Is Cloudflare Agents SDK open source?
Yes. Cloudflare Agents SDK is open source and available on GitHub (https://github.com/cloudflare/agents).
What are the top alternatives to Cloudflare Agents SDK?
Top alternatives in Sandboxes & Code Execution include E2B, Runloop, Fly Machines, Beam Cloud.