cloudflare

126 mods across 18 repositories, 70k stars between them.

agent-class

25

cloudflare/agents

Agent

The core of the agents library is the exported Agent class. Following the pattern from Durable Objects, the main API for developers is to extend the Agent so those classes inherit all the built-in features. While this effectively is a supercharged primitive that allows developers to only write the logic they need in…

5.5k 2d ago A 0 tokens original MIT

agent-tools

26

cloudflare/agents

Agent

Agent tools let one chat agent dispatch another chat-capable sub-agent as part of its work. The child is a real sub-agent with its own Durable Object storage, messages, tools, resumable stream, and drill-in URL. The parent keeps a small run registry so clients can render the child timeline, replay it after refresh…

5.5k 2d ago A 0 tokens original MIT

browse-the-web

27

cloudflare/agents

Agent

Browser tools give your agents full access to the Chrome DevTools Protocol (CDP) through the code mode pattern. Instead of a fixed set of browser actions (click, screenshot, navigate), the LLM writes code that runs CDP commands against a live browser session — accessing all domains, commands, events, and types in the…

5.5k 2d ago A 0 tokens original MIT

callable-methods

28

cloudflare/agents

Agent

Callable methods let clients invoke agent methods over WebSocket using RPC (Remote Procedure Call). Mark methods with @callable() to expose them to external clients like browsers, mobile apps, or other services.

5.5k 2d ago A 0 tokens original MIT

chat-agents

29

cloudflare/agents

Agent

Build AI-powered chat interfaces with AIChatAgent and useAgentChat. Messages are automatically persisted to SQLite, streams resume on disconnect, and tool calls work across server and client.

5.5k 2d ago A 0 tokens original MIT

chat-sdk

30

cloudflare/agents

Agent

Use agents/chat-sdk when you run the Chat SDK inside an Agent and want the Chat SDK StateAdapter to use Agents sub-agents for durable state.

5.5k 2d ago A 0 tokens original MIT

client-sdk

31

cloudflare/agents

Agent

Connect to agents from any JavaScript runtime — browsers, Node.js, Deno, Bun, or edge functions — using WebSockets or HTTP. The SDK provides real-time state synchronization, RPC method calls, and streaming responses.

5.5k 2d ago A 0 tokens original MIT

codemode

33

cloudflare/agents

Agent

Codemode lets LLMs write and execute code that orchestrates your tools, instead of calling them one at a time. Inspired by CodeAct, it works because LLMs are better at writing code than making individual tool calls — they have seen millions of lines of real-world TypeScript but only contrived tool-calling examples.

5.5k 2d ago A 0 tokens original MIT

configuration

34

cloudflare/agents

Agent

This guide covers everything you need to configure agents for local development and production deployment, including wrangler.jsonc setup, type generation, environment variables, and the Cloudflare dashboard.

5.5k 2d ago C 0 tokens original MIT

cloudflare/agents

Agent

When your Agents are deployed, to keep things secure, send a token from the client, then verify it on the server. This mirrors the shape used in PartyKit’s auth guide.

5.5k 2d ago A 0 tokens original MIT

durable-execution

36

cloudflare/agents

Agent

Run work that survives Durable Object eviction. runFiber() registers a task in SQLite, keeps the agent alive during execution, lets you checkpoint intermediate state with stash(), and calls onFiberRecovered() on the next activation if the agent was evicted mid-task.

5.5k 2d ago A 0 tokens original MIT

email

37

cloudflare/agents

Agent

Agents can send and receive email with Cloudflare's Email Service. This guide shows how to send outbound email with the Workers binding, route inbound mail into Agents, and handle follow-up replies securely.

5.5k 2d ago A 0 tokens original MIT

get-current-agent

38

cloudflare/agents

Agent

The framework detects and wraps custom Agent methods during initialization so getCurrentAgent() can resolve the active agent inside them and the functions they call.

5.5k 2d ago A 0 tokens original MIT

getting-started

39

cloudflare/agents

Agent

Build AI agents that persist, think, and act. Agents run on Cloudflare's global network, maintain state across requests, and connect to clients in real-time via WebSockets.

5.5k 2d ago A 0 tokens original MIT

http-websockets

40

cloudflare/agents

Agent

Agents handle both HTTP requests and WebSocket connections, giving you flexibility to build REST APIs, real-time applications, or hybrid architectures.

5.5k 2d ago A 0 tokens original MIT

human-in-the-loop

41

cloudflare/agents

Agent

Human-in-the-loop (HITL) patterns allow agents to pause execution and wait for human approval, confirmation, or input before proceeding. This is essential for compliance, safety, and oversight in agentic systems.

5.5k 2d ago A 0 tokens original MIT

index

42

cloudflare/agents

Agent

Build stateful AI agents on Cloudflare Workers. Every agent is a Durable Object — an addressable, hibernatable actor with its own SQLite database, WebSockets, and scheduling — so you can afford one durable agent per user, account, task, or conversation, with near-zero cost while idle.

5.5k 2d ago A 0 tokens original MIT

lifecycle

43

cloudflare/agents

Agent

Agent "lifecycle" from cloudflare/agents, covering durable object lifecycle, plain durable object, request call path, reusable capabilities and the job queue.

5.5k 2d ago A 0 tokens original MIT

long-running-agents

44

cloudflare/agents

Agent

Build agents that persist for days, weeks, or months — surviving restarts, waking on demand, and managing work that spans far longer than any single request.

5.5k 2d ago B 0 tokens original MIT

mcp-client

45

cloudflare/agents

Agent

Connect your agent to external MCP (Model Context Protocol) servers to use their tools, resources, and prompts. This enables your agent to interact with GitHub, Slack, databases, and other services through a standardized protocol.

5.5k 2d ago C 0 tokens original MIT

mcp-servers

46

cloudflare/agents

Agent

This guide covers the different ways to create MCP servers with the Agents SDK and helps you choose the right approach.

5.5k 2d ago A 0 tokens original MIT

mcp-transports

47

cloudflare/agents

Agent

This guide explains the different transport options for connecting to MCP servers with the Agents SDK.

5.5k 2d ago A 0 tokens original MIT

cloudflare/agents

Agent

This guide covers the changes needed when upgrading from AI SDK v4 to v5 with @cloudflare/ai-chat.

5.5k 2d ago A 0 tokens original MIT