← Back to directory
C

Cloudflare Agents

Official
Framework / SDK
Official Cloudflare SDK for building persistent, stateful AI agents on Durable Objects, with optional MCP server/client support as one of many built-in features.

This is a framework for building MCP servers or agents, not a server you connect a client to.

Category
Dev Tools #176 of 438
Stars
★ 5.9k Very popular
Transport
SSE · Streamable HTTP
Runtime
Node.js 24+
Credentials
No credential needed
License
MIT
Last commit
56FMRS · C

cloudflare/agents is a comprehensive, officially maintained agent SDK from Cloudflare; MCP server/client support is one feature among many rather than the repo's sole purpose. Documentation and examples are extensive, but the project does not accept external PRs and has no standalone MCP install configuration separate from writing code.

Strongest · Maintenance 15/20 Weakest · Reliability 7/20

Reliability
7/20
Security and permissions
11/20
Maintenance
15/20
Documentation
14/20
Setup experience
9/20
Why each score
Reliability 7/20
This repository is actually a general-purpose Cloudflare Agent SDK (state, scheduling, voice, workflows, payments, etc.), with MCP being just one of many features rather than a standalone runnable MCP server. No server manifest was cached, and 'repository root' is not a clear single entry point — the README only points to example directories like examples/mcp-server and mcp-worker without showing an actual MCP init/tool-list handshake or verified tool behavior. The README mentions vitest/vitest-pool-workers and Playwright test tooling, indicating some test infrastructure exists, but no CI workflow file or evidence that tests cover the MCP-specific code paths was provided, so per the static calibration rule this cannot score above the capped range.
Security and permissions 11/20
The framework includes several higher-risk capabilities — the x402 payment protocol (potential real payments), email send/receive, sandboxed code execution, and MCP client/server connectivity — but the README does not specify their permission scope, least-privilege design, or how credentials are handled. The only visible risk-mitigation signal is that 'Workflows' explicitly mentions human-in-the-loop approval, implying some irreversible actions have a confirmation gate, but this isn't shown to extend to payments, email, or other risky features. No exposed secrets or hard red-line issues were found, but overall permission boundaries and data-flow disclosure are insufficient.
Maintenance 15/20
The project uses pnpm workspaces with Nx for task orchestration, has a changeset release process, and lint/typecheck/test scripts, indicating solid engineering practices and active maintenance. MIT license is clear, high star count and issue activity suggest a real user base, and the repo is not archived. However, the README shows no explicit release/version history, security-response channel, or vulnerability disclosure process, and the project states it 'is not accepting external pull requests at this time,' which may limit community contribution — so it does not receive a top score.
Documentation 14/20
The README is well organized, listing a feature table, package structure, 30+ example demos, guides, and design decision records, and links out to the official docs site (developers.cloudflare.com/agents), suggesting a layered documentation approach. However, this review only has access to the README itself — specifics for the MCP feature (tool parameters, authentication, rate limits, cost, troubleshooting) are not directly shown and would require inspecting examples/mcp-server and related directories, leaving hidden assumptions about documentation depth unverified.
Setup experience 9/20
The README provides two install paths (scaffold template or npm install) plus a wrangler.jsonc configuration example, giving reasonably clear top-level steps. However, this is the setup flow for building a general agent app, not specific instructions for connecting an MCP client, and it additionally requires a Cloudflare account, Durable Objects bindings, and SQLite migrations — a moderately complex multi-step setup limited to the Cloudflare Workers platform. Without verifiable execution evidence (e.g., an actual client connection or CI validation), the static review rules prevent a high score here.

Static review · not runListed 2026-08-06

Read the FMRS scoring method →

Fit and risk

What it can accessRuns commands or codeUses the networkConnects to a database

Best for

  • TypeScript developers building stateful AI agents on the Cloudflare Workers/Durable Objects platform
  • Teams that want to expose their own agent capabilities as an MCP server
  • Builders needing an integrated stack of scheduling, WebSockets, voice, and workflows for agentic apps

Not for

  • Users looking for a turnkey MCP server with a fixed tool list to drop straight into a Claude Desktop config
  • Teams not deploying to Cloudflare Workers/Durable Objects
  • External contributors hoping to land code via pull request (the repo currently does not accept external PRs)

Required permissions

  • A Cloudflare account with SQLite-backed Durable Objects enabled
  • Workers deployment and binding configuration permissions
  • Additional credentials/bindings depending on features used (e.g. AI model calls, email service)

Risks and side effects

  • MCP server/client behavior is implemented by the developer, so missing authorization checks could expose agent state or callable methods
  • Code Mode and sandboxed execution run LLM-generated code — misconfigured isolation could introduce execution risk
  • Incorrect Durable Object bindings or SQLite migration tags can cause state loss or failed migrations
  • The repo does not accept external PRs, so community-reported issues depend entirely on Cloudflare's own fix timeline

Setup

Before you start

Runtime:Node.js 24+

Run npm install agents in an existing Cloudflare Workers project, or scaffold a new one with npm create cloudflare@latest -- --template cloudflare/agents-starter. Declare your Agent class as a Durable Object and configure the matching durable_objects binding plus a SQLite migration (new_sqlite_classes) in wrangler.jsonc, along with an appropriate compatibility_date and the nodejs_compat flag. To expose an Agent as an MCP server or connect it as an MCP client, follow the patterns in the repo's examples/mcp* directories — there is no separate one-step MCP installer or client config file provided.

Check that it works

This is a TypeScript SDK for building agents, not a directly connectable MCP server. After npm install agents, import { Agent, routeAgentRequest } from "agents", configure the Durable Object binding and SQLite migration in wrangler.c, and confirm a local run serves the agent route with its initial state.

Troubleshooting

  1. Verify the `durable_objects` binding name in `wrangler.jsonc` matches the class name listed under the migration's `new_sqlite_classes`
  2. Check that `compatibility_date` and the `nodejs_compat` flag are set as shown in the README example
  3. Building the repo itself requires Node 24+ and pnpm; run `pnpm run check` to catch type/lint/test issues
  4. Reference the `examples/mcp*` and `examples/webmcp` directories for working MCP integration patterns
  5. Consult the `docs/` and `design/` directories for architecture details and design rationale

Things to try

Once connected, you can ask your AI assistant things like:

  • Scaffold a new AI Agent project with the cloudflare/agents-starter template
  • Write a TypeScript agent extending the Agent class from the agents package with persistent counter state
  • How do I expose a Cloudflare Agent as an MCP server and also connect as an MCP client?

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

Overview

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.

Similar servers

Context7 80 · B

Upstash's official server providing up-to-date third-party library docs for AI coding assistants

★ 64.1k · Tools 2 Compare with this →

Source revision 455b47ec93f9 Data synced 2026-11-04 Read the FMRS scoring method