# Cloudflare — MCP Server

> Drive Workers, DNS, R2, D1 and the rest of the Cloudflare API with AI.

**Source:** https://mcpplaygroundonline.com/mcp-servers/cloudflare  
**Transport:** http  
**Requires auth:** Yes

---

## What it does

Cloudflare’s hosted MCP wraps thousands of account-scoped API operations — Workers and Pages, DNS, KV, D1, R2, load balancing, Zero Trust, and more — without hand-writing one integration per product. The default Code Mode server minimises the tool list; you can also disable it with a `?codemode=false` query to register one tool per API route if you prefer traditional fixed schemas. The same product rate limits and permission model apply as the Cloudflare API you already use. Point any MCP client at the URL, authenticate, and the model can help deploy, inspect, or debug infrastructure in natural language.

## Tools exposed

- search — in Code Mode, discover relevant Cloudflare API paths from the spec
- execute — run Cloudflare API calls the model assembles from the spec
- Optional: thousands of per-endpoint tools when `?codemode=false` (see Cloudflare’s MCP README)
- GraphQL / analytics and product-specific subdomains (docs, builds, observability) per Cloudflare’s catalog

## Example queries you can run

- "List all Workers in my account and the routes each one serves."
- "Show the DNS A and CNAME records for my production zone and flag anything unusual."
- "What R2 buckets do I have and which look empty or unused?"
- "Is there a recent spike in 5xx for my production Worker, and in which colos?"

## Details

- **Recommended model:** anthropic/claude-sonnet-4.5 — Claude Sonnet 4.5 handles multi-step infra reasoning and high-risk API plans. For narrow read-only checks, Haiku 4.5 is cheaper; compare in Agent Studio.
- **Transport:** http
- **Authentication:** Required — OAuth in supported UIs, or a Cloudflare API token (My Profile → API Tokens) with least scope; paste the bearer into Agent Studio for token-based clients.
- **Hosted endpoint:** https://mcp.cloudflare.com/mcp
- **Official source:** [cloudflare/mcp on GitHub](https://github.com/cloudflare/mcp)

## Frequently asked questions

### What is the Cloudflare MCP server?

It is Cloudflare’s remote MCP endpoint that connects AI tools to the Cloudflare API. In the default “Code Mode” design, the model searches the published API specification and issues the right `cloudflare.request` style calls, so you can manage Workers, DNS, R2, and other services through chat without custom glue code for every product.

### How do I authenticate the Cloudflare MCP server?

Preferred for humans is OAuth when your client can open a browser. For headless and browser labs, create an API token in the Cloudflare dashboard with only the account permissions the agent should have, and pass it as a bearer token with the MCP request.

### Is it safe to let an LLM act on my production Cloudflare account?

Treat it like any high-privilege API client: use a token scoped to a narrow set of products, start on staging or a throwaway account, and review proposed destructive actions. You can also split “read” and “write” by using a read-only token for exploration.

### Does the Cloudflare MCP server work with Claude, Cursor, ChatGPT, or the browser?

Yes — any MCP client that can reach the hosted URL and complete OAuth or pass a token can work. In MCP Playground, open Agent Studio, pick the Cloudflare template, and paste the URL and token as prompted.

### Which model is best for Cloudflare infrastructure tasks?

For multi-step change plans (DNS plus Workers, comparing regions, parsing errors), use Claude Sonnet 4.5. For one-off “list my buckets” style reads, try Claude Haiku 4.5. Compare models in Agent Studio on a real change before you standardise.

---

_Test this server across 40+ models on MCP Playground: https://mcpplaygroundonline.com/mcp-servers/cloudflare — free, no install._
