cloudflare/agents is Cloudflare's officially maintained TypeScript SDK for building persistent, stateful AI agents on top of Durable Objects — each agent gets its own state, storage, and lifecycle, hibernating when idle and waking on demand. It is not itself a single MCP server with a fixed tool list; rather it's an application framework that lets developers make their own Agent act as an MCP server (exposing it to MCP clients) or as an MCP client (connecting to other MCP servers), over HTTP, SSE, RPC, and with elicitation support. Beyond MCP, the SDK bundles synced persistent state, type-safe callable methods (RPC via @callable()), sub-agent composition, scheduling, WebSockets, AI chat with resumable streaming, WebMCP, durable workflows with human-in-the-loop approval, email send/receive, a voice pipeline, browser-side agents, Code Mode (LLMs write executable code instead of one tool call at a time), sandboxed code execution, and x402 pay-per-call support. The repo is a pnpm/Nx monorepo containing the core agents package plus companion packages (ai-chat, think, codemode, shell, voice, worker-bundler, hono-agents) and 30+ standalone examples, several of them specifically demonstrating MCP usage (mcp, mcp-client, mcp-server, mcp-worker, webmcp). The project does not accept external pull requests but welcomes bug reports and discussion via GitHub Issues/Discussions.
Use cases
Spinning up one persistent, hibernating agent instance per user, session, or game room
Wrapping custom agent logic and exposing it as an MCP server
Having an Agent act as an MCP client to call external tools and other MCP servers
Building real-time chat/collaboration frontends (React or vanilla JS) with synced state and callable methods
Implementing durable, multi-step workflows that require human-in-the-loop approval