Claude Code + Cloudflare·续
Cloudflare MCP server repository
Installing additional MCP servers, and when to use Code Mode versus traditional MCP servers.
FAQ
<details>
<summary>Should I use Skills, the MCP server, a CLI, or all of them?
</summary>
All three — and the Skills plugin configures them together. Skills give Claude persistent Cloudflare knowledge (when to use Durable Objects vs KV, what a good Workers project layout looks like). The Cloudflare API MCP server handles platform operations (DNS, WAF, R2 buckets, Zero Trust). Wrangler runs local dev and Workers-specific commands. The <code>wrangler</code> Skill teaches Claude when to reach for which. For tasks across the whole Cloudflare API, Claude can also use the <a href="https://developers.cloudflare.com/cf/">Cloudflare CLI</a>, <code>cf</code>.
</details>
<details>
<summary>Can Claude Code use the Cloudflare CLI?
</summary>
Yes. The <a href="https://developers.cloudflare.com/cf/">Cloudflare CLI</a>, <code>cf</code>, is in beta and covers the whole Cloudflare API and prints JSON output. Install it with <code>npm install -g cf</code>, sign in with <code>cf auth login</code>, and tell Claude Code to prefer it in <code>CLAUDE.md</code>. Refer to <a href="https://developers.cloudflare.com/cf/agents/">Use cf with AI agents</a>.
</details>
<details>
<summary>How do I give Claude Code access to my Cloudflare account?
</summary>
The first time Claude calls a Cloudflare tool, you will be redirected to authorize via OAuth and choose what permissions to grant.
</details>
<details>
<summary>Can Claude Code deploy to existing Workers projects?
</summary>
Yes. Run Claude Code from your existing project directory where <code>wrangler.jsonc</code> or <code>cloudflare.config.ts</code> is located, and it will understand your project configuration and deploy accordingly.
</details>
<details>
<summary>What does Code Mode mean for MCP?
</summary>
Code Mode is how the Cloudflare API MCP server fits all 2,500+ API endpoints into \~1,000 tokens. Instead of exposing every endpoint as a separate tool, it exposes two — <code>search()</code> and <code>execute()</code> — and Claude writes JavaScript to call them. <a href="https://blog.cloudflare.com/code-mode-mcp/">Learn more about Code Mode ↗︎</a>.
</details>
Troubleshooting
<details>
<summary>MCP server connection fails or times out
</summary>
Run <code>claude mcp list</code> to verify the server is registered. If you installed the Cloudflare plugin, run <code>/reload-plugins</code> to reload its MCP configuration.
</details>
<details>
<summary>Claude cannot authenticate with Cloudflare
</summary>
The MCP server uses OAuth. When prompted, complete the authorization flow in your browser. For CI/CD, create a Cloudflare API token and pass it as a bearer token instead.
</details>
<details>
<summary>Getting outdated information about Cloudflare products
</summary>
Point the agent directly at <a href="https://developers.cloudflare.com/llms.txt">developers.cloudflare.com/llms.txt</a> for a directory of every product, or <code>developers.cloudflare.com/<product>/llms.txt</code> for a product-specific index.
</details>
Build agents on Cloudflare
Cloudflare is not just a deploy target for agents, it is a full stack for building your own.
Agents SDK Stateful AI agents with state, scheduling, RPC, email, streaming chat — and the Code Mode SDK for token-efficient tool use.Learn more Build an MCP server Ship a remote MCP server on Workers with OAuth, durable state, and streamable HTTP transport.Learn more Workers AI Run open-source LLMs, embedding models, and image models at the edge. Use it as your agent's model provider.Learn more Worker Loader Load user-generated code into isolated Workers on demand. The secure sandbox behind Code Mode.Learn more
Other agents

OpenAI<h3>Codex</h3>OpenAI coding agent available as a terminal CLI and desktop app. It reads and writes files, runs commands, and browses the web in a sandbox.View guide 
Cursor<h3>Cursor</h3>AI-first IDE built on VS Code with multi-file Composer edits and background agents. Made by Cursor.View guide 
GitHub<h3>GitHub Copilot</h3>Editor extension and CLI with agent mode, workspace context, and native PR integration. Made by GitHub.View guide 
Anomaly<h3>OpenCode</h3>Open-source terminal agent with a rich TUI that works with 75+ LLMs. Made by Anomaly.View guide 
Mistral AI<h3>Vibe</h3>Coding agent for terminal, IDE, and cloud workflows that reads files, runs commands, writes code, and opens pull requests. Made by Mistral AI.View guide 
Cognition<h3>Devin</h3>A full IDE with an agent manager built in — the command center for managing all your agents in one place. Made by Cognition.View guide 
Microsoft<h3>Visual Studio Code</h3>Free, open-source code editor with native Model Context Protocol (MCP) client support and Copilot Chat integration. Made by Microsoft.View guide 
Command Code<h3>Command Code</h3>Command Code is one of the most used coding agents for open models. It automatically learns your coding taste and self-improves as you work.View guide 
LM Studio<h3>Bionic</h3>Powerful agent for coding and work. Natively local, with open models in the cloud. By LM Studio.View guide 
Factory<h3>Droid</h3>Model-agnostic coding agent that plans, edits files, runs commands, and automates CI, from the terminal, desktop app, or cloud. Made by Factory.View guide
Was this helpful?
YesNo
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/agent-setup/claude-code/#page","headline":"Claude Code + Cloudflare","description":"Terminal-based coding agent that understands your codebase, runs commands, edits files, and manages git. Made by Anthropic.","url":"https://developers.cloudflare.com/agent-setup/claude-code/","inLanguage":"en","image":"https://developers.cloudflare.com/agent-setup/claude-code/og.png?v=3464f7dc38d715c9","dateModified":"2026-10-26","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: OpenAI coding agent available as a terminal CLI and desktop app. It reads and writes files, runs commands, and browses the web in a sandbox. title: Codex + Cloudflare image: https://developers.cloudflare.com/agent-setup/codex/og.png?v=a071c5162a14c963
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/agent-setup/llms.txt
Use this file to discover all available pages before exploring further.


OpenAI
