Cloudflare MCP server: which one to use, setup and fixes

Cloudflare runs many MCP servers. The one to use now (the Cloudflare API server), its setup, permissions and Code Mode tools, the deprecated servers, and fixes.

Updated

Short answer

Cloudflare runs several MCP servers (connectors that let an AI agent use Cloudflare), but now points everyone to one: the Cloudflare API server at https://mcp.cloudflare.com/mcp. It reaches the whole Cloudflare API through two tools, search and execute, and you choose its permissions when you sign in. In Claude Code:

claude mcp add --transport http cloudflare-api https://mcp.cloudflare.com/mcp

Then run /mcp and pick Read only on Cloudflare's permission page unless the agent needs to change things. The older per-product servers, such as Workers Bindings, Builds and Observability, were deprecated in 2026. Want to host your own MCP server on Cloudflare instead? See building one on Cloudflare.

Cloudflare's MCP servers

Server Address Sign-in
Cloudflare API (recommended) https://mcp.cloudflare.com/mcp OAuth or API token
Documentation https://docs.mcp.cloudflare.com/mcp None
Agents SDK docs https://agents.cloudflare.com/mcp None
Container (a sandbox to run code) https://containers.mcp.cloudflare.com/mcp OAuth
Browser Run (formerly Browser Rendering) https://browser.mcp.cloudflare.com/mcp OAuth
Digital Experience Monitoring https://dex.mcp.cloudflare.com/mcp OAuth
Cloudflare One CASB https://casb.mcp.cloudflare.com/mcp OAuth
Cloudflare Blog https://blog.mcp.cloudflare.com/mcp None

Sources: Cloudflare's server list and the mcp-server-cloudflare README. Cloudflare's docs page calls the API server "the only MCP server you need to work with Cloudflare".

Deprecated in 2026, and still answering for now: Workers Bindings (bindings.mcp.cloudflare.com), Workers Builds, Observability, AI Gateway, DNS Analytics and Logpush (all October 6), Audit Logs (September), GraphQL (July), Radar (May) and AutoRAG (April). Cloudflare asks you to move to the API server.

Every server is at /mcp. Cloudflare retired the /sse addresses on October 22, 2026: they now return 410 Gone, "This MCP URL has moved to /mcp".

The Cloudflare API server

Address https://mcp.cloudflare.com/mcp (Streamable HTTP)
Sign-in OAuth, where you pick permissions, or a Cloudflare API token as Authorization: Bearer
Tokens User or account API tokens. Account tokens need Account Resources : Read. Tokens with IP address filtering don't work
Accounts Picked automatically when your login or token has one; otherwise the agent passes account_id
Plans No plan of its own. It reaches what your account's products allow
Code cloudflare/mcp, launched in February 2026

How Code Mode works

Instead of one tool per API endpoint, the server gives the agent a few tools and lets it write code:

Tool What it does
search Runs JavaScript over Cloudflare's OpenAPI spec to find the endpoints it needs
execute Runs JavaScript that calls the Cloudflare API, in a sandboxed Worker with outside fetches off
docs Searches Cloudflare's documentation
whoami Says which user or account the connection is signed in as
submit_feedback Sends feedback to Cloudflare

Cloudflare's Code Mode post puts it at about 2,500 endpoints in about 1,000 tokens of tool definitions. Results are cut at about 6,000 tokens unless the agent asks otherwise. For one tool per endpoint, add ?codemode=false to the address: that's about 3,000 tools, too many for some clients.

Permissions and built-in guards

  • Presets on the consent page: Minimal (the default: identity and accounts only), Read only (every read permission) or Full access. You can also untick single permissions.
  • Step-up. When a call needs a permission you didn't grant, the server asks your client to approve it, and keeps what you already granted.
  • Spending is fenced off. The server refuses domain registrations, credit top-ups, invoice payments and payment methods. Starting a paid subscription, such as Workers Paid or R2, needs you to confirm the price in your client, or happens in the dashboard.
  • Some AI models are refused, including third-party models and those that make images, video or audio.

Connect it to your client

Claude Code. Cloudflare's own route is its plugin: /plugin marketplace add cloudflare/skills, then /plugin install cloudflare@cloudflare. It adds the API server and Cloudflare's skills. Or run the claude mcp add command above. In .mcp.json, include "type": "http".

Cursor. /add-plugin cloudflare, or add {"mcpServers":{"cloudflare":{"url":"https://mcp.cloudflare.com/mcp"}}} to .cursor/mcp.json.

VS Code. In .vscode/mcp.json, use {"servers":{"cloudflare-api":{"type":"http","url":"https://mcp.cloudflare.com/mcp"}}}, then click Start. Cloudflare warns that an mcpServers key there silently does nothing.

Windsurf. {"mcpServers":{"cloudflare":{"serverUrl":"https://mcp.cloudflare.com/mcp"}}} in ~/.codeium/windsurf/mcp_config.json.

Codex. codex mcp add cloudflare --url https://mcp.cloudflare.com/mcp, then codex mcp login cloudflare. Codex 0.147.0 or later.

Claude. Claude's directory lists "Cloudflare Developer Platform", but it still uses the deprecated Workers Bindings server. For the API server, add https://mcp.cloudflare.com/mcp as a custom connector.

ChatGPT. Cloudflare publishes a plugin in ChatGPT's directory.

mcp-remote. Cloudflare stopped recommending it in August 2026. Use your client's own remote support.

Cloudflare's agent setup pages cover twelve agents.

Where the API server stops

  • Approvals see one tool. Nearly everything goes through execute, so your client's approve-per-tool setting can't tell a read from a delete. The permissions you grant are the real limit.
  • Several accounts need account_id. With more than one account on your login, the agent has to name the account on each call.
  • Each client keeps its own record of what the agent ran; Cloudflare's audit logs show the changes.

With Read only permissions, or a read-only API token, the API server is enough for most people.

Building an MCP server on Cloudflare

"Cloudflare MCP" also means hosting your own. Cloudflare's remote MCP guide starts with npm create cloudflare@latest -- remote-mcp-server-authless --template=cloudflare/ai/demos/remote-mcp-authless and deploys with npx wrangler@latest deploy. It uses createMcpHandler, with the Workers OAuth Provider for sign-in. The older McpAgent class is deprecated and feature-frozen.

For companies, MCP server portals in Cloudflare Zero Trust put approved MCP servers behind one address with Access policies and logs. They've been generally available since September 2026. More on gateways in what is an MCP gateway.

Upsy and Cloudflare

Upsy is one MCP server, https://upsy.ai/connect, that holds your apps, with a level per agent and a history of every call. For Cloudflare, know what's there today:

  • Upsy's built-in Cloudflare connector uses the Workers Bindings server, which Cloudflare deprecated on October 6, 2026. It still works, for Workers (list and read code), KV, R2, D1 and Hyperdrive. Read-only there allows the list and get tools, not d1_database_query, which runs any SQL. If your login reaches several accounts, tell the agent the account ID.
  • For the whole Cloudflare API, add the API server to Upsy yourself. On Apps, click Connect an app, then Add on the MCP Server card under Any MCP server. Paste https://mcp.cloudflare.com/mcp as the MCP Endpoint. Sign in and choose permissions, or paste a Cloudflare API token under API key or token as a Bearer token. A read-only token is a hard limit, whatever the agent tries.

Upsy's levels on the API server work a little differently, because Cloudflare marks only whoami as read-only:

  • For read-only, grant read permissions at Cloudflare (or use a read-only token), then give the agent Full access in Upsy.
  • To let an agent look things up but run nothing, use Pick actions with docs, search and whoami: it can find endpoints and read the docs, but not call the API.
  • A server you add starts off for every assistant; turn it on for the ones that need it.

What Upsy adds: the same Cloudflare connection in Claude, ChatGPT, Cursor, Claude Code, Codex, Grok and Muse; a history of every Cloudflare call under the agent that made it; and Cloudflare next to your GitHub, Sentry and Slack. Then, on the Assistants page, click Add assistant and follow the steps for your client, or see Claude, ChatGPT and Claude Code.

Check that it works

Using Upsy, which Cloudflare account are you signed in to? Then list my Workers.

On the API server, the agent should call whoami, then search and execute. Upsy's History shows each call under that agent.

Troubleshooting

"No currently active accountId. Try listing your accounts (accounts_list)…"

From the old per-product servers. accounts_list and set_active_account were removed in June 2026. Give the agent the account ID, set a cf-account-id header in your client, or move to the API server.

"account_id is required because your credentials can access multiple Cloudflare accounts"

Your login reaches more than one account. Give the agent the account ID from your dashboard's address, or sign in with a token for one account.

410 Gone: "This MCP URL has moved to /mcp"

Your client still uses an /sse address. Change it to /mcp. A sign-in made through /sse fails its next refresh with invalid_grant, so sign in again.

Codex: "Authorization server response missing required issuer"

Update the Codex CLI to 0.147.0 or later (issue #449).

Codex: access_denied after you approve

Two sign-ins were open at once, and Cloudflare keeps only the latest. Close the others and sign in once.

"Unknown OAuth scope: openid, email, profile"

That's mcp-remote asking for scopes Cloudflare doesn't have. Drop mcp-remote and add the server as a remote HTTP server.

VS Code: "Invalid client_id"

VS Code's saved registration expired. Run Developer: Remove Dynamic Authentication Providers, then sign in again.

ChatGPT: "Client metadata is temporarily unavailable. Please try again."

An open issue on Cloudflare's side (cloudflare/mcp#329). Try again later.

Codex: "tools/list exceeded the catalog limit of 2048 items"

You added ?codemode=false, which lists about 3,000 tools. Remove it.

"The user hasn't allowed you to use Cloudflare's "execute""

That's Upsy refusing a tool outside the agent's level. On the API server, Read-only allows only whoami; see the levels above.

Security and privacy

  • Start with Read only. The consent page's default, Minimal, can't do much; Full access can change DNS, Workers and firewall rules across your accounts.
  • Prefer scoped API tokens for automation: one account, the permissions the job needs, and an expiry. Revoke them in the dashboard when you're done.
  • Code runs in a sandbox, with outside fetches off by default, so the agent's code can't simply post your data to another site. It can still change anything your permissions allow.
  • Prompt injection. Logs, page content and DNS records the agent reads can carry instructions. Keep write permissions away from agents that read untrusted content.
  • Through Upsy, agents never get your Cloudflare token: they call Upsy, and Upsy calls Cloudflare. Upsy emails you when one agent reads 100 or more times or deletes 50 or more items in 10 minutes, and when a new agent or app connects.

FAQ

What is the Cloudflare MCP server URL?

https://mcp.cloudflare.com/mcp for the Cloudflare API server. The docs server is https://docs.mcp.cloudflare.com/mcp.

Which Cloudflare MCP server should I use?

The Cloudflare API server. It covers the whole API, and Cloudflare has deprecated most of the per-product servers in its favor.

Is the Workers Bindings MCP server deprecated?

Yes, since October 6, 2026, along with Builds and Observability. It still answers, but Cloudflare asks you to move to the API server.

Can I use a Cloudflare API token instead of OAuth?

Yes. Send it as Authorization: Bearer <token>. An account token needs Account Resources : Read.

Can I make the Cloudflare MCP server read-only?

Yes. Choose Read only on the consent page, or use an API token with read permissions only.

Is there a free Cloudflare docs MCP server?

Yes. https://docs.mcp.cloudflare.com/mcp needs no sign-in.

What is Cloudflare Code Mode?

The API server's approach: the agent writes JavaScript against Cloudflare's API in a sandbox, instead of loading a tool for every endpoint.