Droid + Cloudflare
FactoryFactory 推出的模型无关编程 Agent,可通过终端、桌面应用或云端进行规划、编辑文件、运行命令以及自动化 CI。
-
安装 Droid
安装 Droid CLI。对于 Windows、Homebrew 或 npm,请参阅 Droid 快速入门指南 ↗。
curl -fsSL https://app.factory.ai/cli | sh -
安装 Cloudflare 插件
从 shell 注册 Cloudflare marketplace 并安装 plugin。此操作会一步安装 Cloudflare Skills 并注册 Cloudflare MCP server。
droid plugin marketplace add https://github.com/cloudflare/skills droid plugin install cloudflare@skills -
在项目中启动 Droid
从项目根目录启动 Droid;如果
wrangler.jsonc已存在,它应位于该目录中。droid -
尝试提示词
例如:
创建 Logpush 作业,将 Workers 分析数据流式传输到我的数据仓库。
展开任意部分以了解更多。
Cloudflare Skills
持久的平台上下文,教会 Agent Cloudflare 如何工作。
Skills 是 Agent 按需加载的说明。 cloudflare/skills 包覆盖平台的每一层 — 因此 Agent 了解你的约定,无需你反复解释。
- agents-sdkBuild, debug, or review Cloudflare Agents SDK applications using the agents package.
- basinBuild and troubleshoot Cloudflare Basin analytics workflows with Basin Pipelines, Basin Catalog, and Basin SQL. Use for streaming data into R2 Iceberg tables, managing catalogs, or querying those tables; also use for requests using the former Data Platform, Pipelines, R2 Data Catalog, or R2 SQL names.
- cf-cliCloudflare's official cf CLI (beta) for the public Cloudflare API and Workers projects. Use for finding and running Cloudflare commands from the terminal — sign-in and profiles, cf cli search, cf schema, cf deploy/dev/build, resource commands for DNS, zones, D1, KV, and R2 — and for choosing between cf and Wrangler in a project.
- cloudflareDiscover and choose Cloudflare products for apps, APIs, AI agents, storage, networking, and security. Use for architecture and product selection, including when the user describes a need without naming a Cloudflare product; then find the relevant skill or documentation. Also use when a Cloudflare-proxied site shows a Cloudflare error page, a `52x` status, a 1xxx error code, or a Cloudflare `403`, to decide whether to fix Cloudflare configuration or the origin.
- cloudflare-app-bootstrapGet a Cloudflare Workers app to a working local request by connecting its bindings, secrets, and initial data, then verifying real application behavior. Use for app setup or onboarding after the project exists; use frameworks-on-cloudflare or cf-cli to create or configure the project, and wrangler or cf-cli for isolated commands.
- cloudflare-email-serviceImplement or troubleshoot Cloudflare Email Sending and Email Routing integrations and their delivery configuration.
- cloudflare-oneDesign, configure, troubleshoot, or review Cloudflare One Zero Trust and SASE deployments. Use cloudflare-one-migrations for migration planning from other vendors. Also use when an agent, script, crawler, or other non-browser client needs to reach a webpage or API protected by Cloudflare Access.
- cloudflare-one-migrationsAssess and plan migrations from existing VPN, SWG, or SASE platforms to Cloudflare One, including policy mapping, parity gaps, and rollout.
- durable-objectsBuild, debug, or review Cloudflare Durable Objects code for persistent state and coordination.
- frameworks-on-cloudflareBuild, migrate, and deploy web-framework applications on Cloudflare Workers. Use when a framework project such as Astro, SvelteKit, React Router, TanStack Start, Nuxt, Hono, or a React or Vue SPA targets Cloudflare, or when a framework repository contains Workers deployment configuration.
- gateway-workersBuild, debug, or review Cloudflare Workers invoked by the Forward action in Gateway HTTP policies, including the GatewayMiddleware entrypoint, Gateway types, context, and continuation.
- k2Build and troubleshoot Cloudflare K2 or K2 Streams durable logs. Use for stream setup, producing from Workers or HTTP, configuring retention and inputs, and consuming through subscriptions.
- nextjs-on-cloudflareBuild, migrate, and deploy Next.js apps on Cloudflare Workers with vinext. Use when starting a Next.js project on Cloudflare, moving an existing app to Workers, choosing between vinext and OpenNext, or setting up vinext for Workers. For setup, migration, or deployment, install vinext's upstream skills with `npx skills add cloudflare/vinext` if missing, then read and follow the applicable skill and docs.
- sandbox-migrate-to-nextMigrate Cloudflare Sandbox apps from stable @cloudflare/sandbox to @cloudflare/sandbox@next (SDK 1.0 preview). Use sandbox-next for apps already on the preview.
- sandbox-nextBuild or maintain Cloudflare Sandbox apps on @cloudflare/sandbox@next (SDK 1.0 preview). Use sandbox-migrate-to-next when porting a stable app.
- sandbox-stableBuild or maintain Cloudflare Sandbox apps on the stable @cloudflare/sandbox package. Use sandbox-next for preview apps and sandbox-migrate-to-next for stable-to-preview migrations.
- turnstile-spinSet up, repair, or migrate to Cloudflare Turnstile bot verification in an existing frontend and backend, including server-side Siteverify.
- web-perfAudit, diagnose, or optimize website loading and interaction performance, Core Web Vitals, and Lighthouse performance scores.
- workers-best-practicesCloudflare Workers best practices for production applications. Use when writing, reviewing, or configuring Workers.
- workers-developmentRun, inspect, and debug Cloudflare Workers during local development with cf dev, wrangler dev, or the Cloudflare Vite plugin, using Local Explorer to read and seed binding data and query local traces and logs. Also routes production debugging to Workers observability. Use for debugging requests whether or not the project uses Wrangler.
- workers-profilingProfile or debug CPU usage and memory allocation in deployed Cloudflare Workers and Durable Objects. Then use this information to optimize your code.
- wranglerRun or troubleshoot Wrangler CLI commands in projects that have a wrangler.jsonc, wrangler.json, or wrangler.toml file, including local development, Previews, deployment, and resource management. For new projects and projects without a Wrangler configuration file, use the cf CLI instead.
MCP 服务器
实时访问 Cloudflare API、文档和可观测性。
MCP 服务器提供类型化工具,以便在运行时调用 Cloudflare。有两种选择:Code Mode — 一台覆盖整个 Cloudflare API 的服务器(约 1,000 个 token 覆盖 2,500+ 个端点)— 或者一组聚焦特定领域的服务器,托管在 cloudflare/mcp-server-cloudflare 仓库中。完整目录也在 Cloudflare 的 MCP 服务器 文档中。
- Cloudflare API MCP ServerCode ModeBest when you want broad access across Cloudflare's APIs through code executionhttps://mcp.cloudflare.com/mcp
- Code mode APICode ModeBroad access to the full Cloudflare API via code execution, with minimal token overheadhttps://mcp.cloudflare.com/mcp
- Browser Run serverFetch web pages, convert them to markdown and take screenshotshttps://browser.mcp.cloudflare.com/mcp
- Cloudflare Blog serverSearch and read posts from the Cloudflare Bloghttps://blog.mcp.cloudflare.com/mcp
- Cloudflare One CASB serverQuickly identify any security misconfigurations for SaaS applications to safeguard users & datahttps://casb.mcp.cloudflare.com/mcp
- Container serverSpin up a sandbox development environmenthttps://containers.mcp.cloudflare.com/mcp
- Demo Day serverDemonstrate a minimal Cloudflare MCP serverhttps://demo-day.mcp.cloudflare.com/mcp
- Digital Experience Monitoring serverGet quick insight on critical applications for your organizationhttps://dex.mcp.cloudflare.com/mcp
- Documentation serverGet up-to-date reference information on Cloudflarehttps://docs.mcp.cloudflare.com/mcp
Wrangler CLI
本地开发、部署和 Workers 专用命令。
使用 Wrangler 进行本地开发、部署以及运行产品专用命令,例如 wrangler d1 migrations apply 或 wrangler tail。 捆绑的 wrangler Skill 会教 Agent 何时使用它。
面向 Agent 的文档
为 Agent 优化的、节省 token 的参考资料。
在任意 Cloudflare 文档 URL 后追加 /index.md 即可获得干净的 Markdown 版本。每个顶级产品部分也有自己的 llms.txt — 一份适合单个上下文窗口的页面索引。常用文件包括:
- developers.cloudflare.com/llms.txt — 包含每个 Cloudflare 产品的目录。
- developers.cloudflare.com/workers/llms.txt
- developers.cloudflare.com/agents/llms.txt
- developers.cloudflare.com/r2/llms.txt
- developers.cloudflare.com/d1/llms.txt
关于这些文档如何面向 Agent 组织的完整概览,请参阅面向 Agent 的文档指南。
- Skills plugin 包含 wrangler Skill — Droid 会自动判断何时使用
npx wrangler deploy、wrangler d1 migrations apply和其他 CLI 命令。 - 尝试使用
/build-agentslash command 构建完整的 Agents SDK 项目,或使用/build-mcp构建远程 MCP server。 - Cloudflare API MCP server 使用 Code Mode — Droid 针对 TypeScript API 编写 JavaScript,以约 1,000 个 token 访问 2,500 多个 endpoint 中的任意一个。
- 在 Droid 中运行
/mcp,检查 Cloudflare server 的连接状态并完成 OAuth 身份验证。 - Droid 与模型无关 — 可使用
/model为每个任务选择 Claude、GPT 或 Gemini,也可使用你自己的 API key。 - 在 CI/CD 中使用
droid exec以 headless 方式运行 Cloudflare 部署和维护任务。有关详细信息,请参阅 Droid Exec 文档 ↗。 - 有关安装其他 MCP server,或何时使用 Code Mode 而不是传统 MCP server 的详细信息,请参阅 Cloudflare MCP server 仓库 ↗。
Should I use Skills, the MCP server, Wrangler CLI, or all of them?
三者都需要 — Cloudflare plugin 会一起配置它们。Skills 为
Droid 提供持久的 Cloudflare 知识(何时使用 Durable Objects 或 KV、
良好的 Workers 项目布局是什么样)。Cloudflare API MCP
server 处理平台操作(DNS、WAF、R2 bucket、Zero Trust)。
Wrangler 运行本地开发和 Workers 专用命令。wrangler Skill
会教 Droid 何时选择哪一个。
How do I give Droid access to my Cloudflare account?
Droid 首次调用 Cloudflare tool 时,会将你重定向到 OAuth 授权页面,
以选择授予哪些权限。你也可以在 Droid 内的 /mcp manager 中
管理身份验证。
Can Droid deploy to existing Workers projects?
可以。在包含 wrangler.jsonc 的现有项目目录中运行 Droid,
它会理解你的项目配置并相应地进行部署。
Can I use Droid outside the terminal?
可以。Factory 桌面和 Web 应用程序 ↗使用带图形界面的同一 agent。桌面 session 在本地或远程计算机上运行,并共享 CLI 配置, 因此快速入门中安装的 Cloudflare plugin 也可在其中使用。你还可以在 Factory 管理的计算机上运行云 session,或在 VS Code、JetBrains IDE 和 Zed 中使用 Droid。
Which AI models does Droid support?
Droid 与模型无关。它内置 Anthropic、
OpenAI 和 Google 的前沿模型,并支持自带密钥 (BYOK) 提供商和
本地模型。使用 /model 命令可以在 session 中途切换模型。
MCP server connection fails or times out
从 shell 运行 droid mcp list,验证 Cloudflare server 是否已
注册;也可以使用 Droid 内的 /mcp manager 检查连接
状态。如果 server 卡住,请将其移除并重新添加:先运行 droid mcp remove cloudflare-api,
再运行 droid mcp add cloudflare-api https://mcp.cloudflare.com/mcp --type http。
Droid cannot authenticate with Cloudflare
MCP server 使用 OAuth。在 Droid 中打开 /mcp manager,选择
Cloudflare server,然后在浏览器中完成授权流程。
Getting outdated information about Cloudflare products
启用 Cloudflare docs MCP server,让 agent 可以在运行时获取
最新文档。如果不想使用 MCP server,请将 agent 直接指向
developers.cloudflare.com/llms.txt 以获取所有产品的目录,
或指向 developers.cloudflare.com/<product>/llms.txt 以获取
特定产品的索引。
Cloudflare 不只是 Agent 的部署目标,也是用来构建你自己 Agent 的完整技术栈。