agents-sdk

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

5|1|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/charl-kruger/cf-agents --skill agents-sdk-charl-kruger
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agents-sdk
Source: https://github.com/charl-kruger/cf-agents/tree/main/.agents/skills/agents-sdk
Command: npx skills add https://github.com/charl-kruger/cf-agents --skill agents-sdk-charl-kruger

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Developers need a scalable, stateful platform to build AI agents that run on Cloudflare Workers, with built-in support for durable workflows, real-time communication, scheduling, and easy React integration.

Core Features & Use Cases

  • Persistent state management and agent lifecycle with RPC and routing
  • Durable workflows for long-running tasks and multi-step processes
  • Real-time WebSocket apps, scheduling, MCP integration, and React hooks for client apps

Quick Start

Start by installing the Agents SDK, define a class that extends Agent with an initial state, implement state management, and export a fetch entry point that routes requests to your agent.

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 installing the Agents SDK and defining a class that extends the Agent base class to manage persistent state. Export a fetch entry point to route requests to your agent.

How do I run durable workflows for long-running tasks on Cloudflare Workers?

Durable workflows on Cloudflare Workers are handled by the Agents SDK to manage long-running tasks and multi-step processes. The SDK maintains agent state and lifecycle throughout the execution of extended operations.

Can I use WebSockets for real-time communication in Cloudflare Workers agents?

Yes, the Agents SDK supports building real-time WebSocket applications directly on Cloudflare Workers. This allows your stateful agents to maintain persistent, bi-directional communication channels with connected clients.

How do I manage agent state and RPC in Cloudflare Workers?

Agent state and RPC on Cloudflare Workers are managed by extending the Agent class with an initial state definition. The SDK provides built-in state management, RPC endpoints, and routing mechanisms to handle agent lifecycle and communication.

Do I need React to build a frontend for Cloudflare Workers AI agents?

No, React is not required, but the Agents SDK provides React hooks for client applications to easily integrate with your agents. You can connect any frontend environment using standard WebSocket or fetch API requests.

What is the best way to integrate MCP with stateful agents on Cloudflare Workers?

The best way to integrate MCP with stateful agents on Cloudflare Workers is using the Agents SDK, which provides built-in MCP integration. Define your Agent class, manage its state, and connect your MCP tools to the agent's lifecycle.