Cloudflare Agents

Guide to the Cloudflare Agents SDK for building stateful AI agents on Workers plus Durable Objects. Covers the Agent class, this.setState and this.sql state, WebSocket and streaming chat via AIChatAgent and useAgentChat, scheduling with this.schedule (delays, dates, cron), triggering Workflows, Browser Rendering, RAG with Vectorize and Workers AI embeddings, MCP servers with McpAgent, human-in-the-loop review, and routing through routeAgentRequest, getAgentByName, useAgent and AgentClient. Documents 15+ pitfalls: missing new_sqlite_classes, non-atomic migrations, Agent class not exported, binding name mismatches, global uniqueness surprises, state size limits, MCP transport confusion and bypassed authentication. Use when building AI agents, chat agents, MCP servers or multi-agent systems on Cloudflare, or debugging Agent binding, migration and state-sync errors.

jackspace Updated

File contents

jackspace/ClaudeSkillz/tree/main/skills/cloudflare-agents commit 8055d78698

Frequently asked questions

npx skillmds@latest add jackspace/cloudflare-agents