agents-sdk

Build stateful AI agents on Cloudflare Workers with the Agents SDK.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/dallay/opencode-docker --skill agents-sdk-dallay
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: agents-sdk
Source: https://github.com/dallay/opencode-docker/tree/main/config/skills/agents-sdk
Command: npx skills add https://github.com/dallay/opencode-docker --skill agents-sdk-dallay

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Building and operating stateful AI agents on Cloudflare Workers is complex, error-prone, and requires coordinating durable state, RPC, scheduling, workflows, and client integration across multiple moving parts; this Skill centralizes guidance and best practices so teams can implement robust agents reliably.

Core Features & Use Cases

  • Persistent Stateful Agents: Patterns for SQLite-backed agent state, validation hooks, and client synchronization.
  • Callable RPC & Streaming: Expose methods over WebSocket, support streaming responses and timeouts for long-running tasks.
  • Scheduling, Workflows & MCP: How to schedule tasks, integrate durable Workflows for long-running jobs, and connect or host MCP servers and tools.
  • Real-time Apps & Clients: Guidance for HTTP/WebSocket routing, resumable streaming chat agents, and React client hooks using useAgent and useAgentChat.
  • Use Case Example: Implement a Counter agent with persistent state, a callable increment method, scheduled background jobs, and a React frontend that stays in sync.

Quick Start

Create a Cloudflare Workers agent that uses SQLite-backed state, exposes a callable increment method, routes requests with routeAgentRequest, and includes a React client using useAgent.

Frequently Asked Questions about agents-sdk

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

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

You can build stateful AI agents on Cloudflare Workers by using the Agents SDK to centralize durable state, callable RPC, scheduled jobs, and React client integration into a single reliable workflow.

How does callable RPC work for streaming responses in Cloudflare Workers?▼

Callable RPC in Cloudflare Workers exposes methods over WebSocket, supporting streaming responses and configurable timeouts to handle long-running tasks and real-time data delivery.

Can I use React hooks to sync with a Cloudflare durable agent instance?▼

Yes, you can use React hooks like useAgent and useAgentChat to connect to a Cloudflare durable agent instance, enabling real-time state synchronization and resumable streaming chat interfaces.

What's the best way to manage persistent state for Cloudflare Workflows?▼

The best way to manage persistent state for Cloudflare Workflows is using SQLite-backed storage patterns with validation hooks, ensuring data durability and seamless client synchronization across instances.

How do I host an MCP server on Cloudflare Workers for agent tooling?▼

You can host and connect MCP servers on Cloudflare Workers by integrating the Agents SDK, which provides the necessary tooling and routing configurations to expose and manage custom tools.