Build AI agents with Cloudflare Agents SDK on Workers + Durable Objects. Provides WebSockets, state persistence, scheduling, and multi-agent coordination. Prevents 23 documented errors. Use when: building WebSocket agents, RAG with Vectorize, MCP servers, or troubleshooting "Agent class must extend", "new_sqlite_classes", binding errors, WebSocket payload limits.
View on GitHubSelect agents to install to:
npx add-skill https://github.com/jezweb/claude-skills/blob/main/skills/cloudflare-agents/SKILL.md -a claude-code --skill cloudflare-agentsInstallation paths:
.claude/skills/cloudflare-agents/# Cloudflare Agents SDK
**Status**: Production Ready ✅
**Last Updated**: 2026-01-09
**Dependencies**: cloudflare-worker-base (recommended)
**Latest Versions**: agents@0.3.3, @modelcontextprotocol/sdk@latest
**Production Tested**: Cloudflare's own MCP servers (https://github.com/cloudflare/mcp-server-cloudflare)
**Recent Updates (2025-2026)**:
- **Jan 2026**: Agents SDK v0.3.6 with callable methods fix, protocol version support updates
- **Nov 2025**: Agents SDK v0.2.24+ with **resumable streaming** (streams persist across disconnects, page refreshes, and sync across tabs/devices), MCP client improvements, schedule fixes
- **Sept 2025**: AI SDK v5 compatibility, automatic message migration
- **Aug 2025**: MCP Elicitation support, http-streamable transport, task queues, email integration
- **April 2025**: MCP support (MCPAgent class), `import { context }` from agents
- **March 2025**: Package rename (agents-sdk → agents)
### Resumable Streaming (agents@0.2.24+)
AIChatAgent now supports **resumable streaming**, enabling clients to reconnect and continue receiving streamed responses without data loss. This solves critical real-world scenarios:
- Long-running AI responses that exceed connection timeout
- Users on unreliable networks (mobile, airplane WiFi)
- Users switching between devices mid-conversation
- Background tasks where users navigate away and return
- Real-time collaboration where multiple clients need to stay in sync
**Key capability**: Streams persist across page refreshes, broken connections, and sync across open tabs and devices.
**Implementation** (automatic in AIChatAgent):
```typescript
export class ChatAgent extends AIChatAgent<Env> {
async onChatMessage(onFinish) {
return streamText({
model: openai('gpt-4o-mini'),
messages: this.messages,
onFinish
}).toTextStreamResponse();
// ✅ Stream automatically resumable
// - Client disconnects? Stream preserved
// - Page refresh? Stream continues
// - Multiple