agents-sdk

Build durable, stateful AI agents on Cloudflare Workers.

2.6k|242|Updated Dec 10, 2025
One-click install
npx skills add https://github.com/cloudflare/skills --skill agents-sdk-cloudflare
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agents-sdk
Source: https://github.com/cloudflare/skills/tree/main/skills/agents-sdk
Command: npx skills add https://github.com/cloudflare/skills --skill agents-sdk-cloudflare

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Enable developers to build durable, stateful AI agents on Cloudflare Workers.

Core Features & Use Cases

  • Persistent state and SQL-backed storage with auto-broadcast to connected clients.
  • Durable workflows and scheduling via AgentWorkflow, including MCP integration.
  • HTTP/WebSocket RPC via @callable and streaming, plus React hooks for client apps.

Quick Start

Install the Agents SDK package, extend the Agent class, implement a simple @callable method, and wire up a Worker fetch handler. Then deploy to Cloudflare Workers and interact with the agent using a client library or direct RPC.

Frequently Asked Questions about agents-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build durable, stateful AI agents on Cloudflare Workers?

You can build stateful AI agents on Cloudflare Workers by installing the agents package, extending the Agent class, and wiring up a Worker fetch handler. This provides persistent state, SQL-backed storage, and auto-broadcasts updates to connected clients.

Can I use WebSockets for real-time streaming in Cloudflare AI agents?

Yes, the Agents SDK supports real-time WebSocket applications via HTTP/WebSocket RPC. You can use @callable methods and streaming to enable real-time communication, along with React hooks for integrating the client applications.

Do I need a specific environment to run Cloudflare Agents SDK workflows?

Yes, running the Agents SDK requires a Cloudflare Workers environment. You must install the agents package via npm and deploy your configured Agent class and Worker fetch handler to the Cloudflare platform to execute durable workflows.

What is the best way to manage state and scheduling for AI workflows?

The best way to manage state and scheduling for AI workflows is using the AgentWorkflow feature. It enables durable workflows and task scheduling on Cloudflare, backed by persistent SQL storage and integrated MCP server capabilities.

Does the Agents SDK support MCP server integration on Cloudflare?

Yes, the Agents SDK supports MCP server integration. You can implement durable workflows and scheduling via AgentWorkflow with MCP integration directly within your Cloudflare Workers environment.