What the official Cloudflare MCP server does
Cloudflare’s hosted API MCP server lets a compatible assistant search the Cloudflare API and call it, and search Cloudflare’s developer documentation. The directory listing is Cloudflare on MCP Server Hub. The server Cloudflare recommends is maintained in the cloudflare/mcp repository. Behavior, tools, and auth rules are defined in Cloudflare’s MCP docs. If this walkthrough and those docs disagree, follow Cloudflare.
People looking up “cloudflare mcp”, “cloudflare mcp server”, or “install cloudflare mcp” usually want that hosted URL and a client config. The general pattern for any server is in how to install an MCP server. The rest of this page is Cloudflare-specific, including the other official MCP servers and how to choose one.
Which Cloudflare MCP server to connect
Cloudflare runs more than one remote MCP server. The docs call https://mcp.cloudflare.com/mcp the server most people need. It reaches the Cloudflare API, which Cloudflare describes as more than 2,500 endpoints across DNS, Workers, R2, Zero Trust, and the rest of the platform, plus documentation search. It does that with Code Mode: the model writes JavaScript against a typed API, and the generated code runs in an isolated Dynamic Worker. Cloudflare’s comparison puts Code Mode at about 1,000 tokens for two API tools, against roughly 1,170,000 tokens if all 2,594 endpoints were loaded as full native tool schemas.
Product-specific servers are optional. Use one when you want a smaller, typed tool list for a single job, such as browser rendering or a documentation search that does not need the rest of the API. Cloudflare’s current docs list these:
- Documentation. Current reference information on Cloudflare.
https://docs.mcp.cloudflare.com/mcp - Container. A sandbox development environment.
https://containers.mcp.cloudflare.com/mcp - Browser Run. Fetch web pages, convert them to markdown, and take screenshots.
https://browser.mcp.cloudflare.com/mcp - Digital Experience Monitoring. Insight on critical applications for your organization.
https://dex.mcp.cloudflare.com/mcp - Cloudflare One CASB. Security misconfigurations for SaaS applications.
https://casb.mcp.cloudflare.com/mcp - Agents SDK documentation. Token-efficient search of the Cloudflare Agents SDK documentation.
https://agents.cloudflare.com/mcp
The mcp-server-cloudflare repository is where those domain servers live, except the Agents SDK documentation server. That README also publishes a Blog server at https://blog.mcp.cloudflare.com/mcp and a Demo Day server at https://demo-day.mcp.cloudflare.com/mcp. The same README marks an older set, including observability, Radar, Workers bindings, Workers Builds, GraphQL, DNS analytics, Logpush, Audit Logs, AI Gateway, and AutoRAG, as deprecated and tells you to move those workflows to the API server.
Cloudflare’s docs say to connect each server’s Streamable HTTP endpoint at /mcp. In the domain-server repository, a request to the retired /sse path returns 410 Gone and names the /mcp URL. Connect a product server the same way as the API server: put its URL in the client and finish OAuth. Some features in that repository can require a paid Workers plan. The API server is still the default install.
Endpoint and authentication
The API server URL is https://mcp.cloudflare.com/mcp. Cloudflare documents two ways to authenticate.
- OAuth for a person using a remote MCP client. The client opens Cloudflare’s consent screen and you select the permissions. OAuth starts with the baseline scopes
user:readandaccount:read. Those scopes let a laterGET /accountslist visible account IDs. They do not by themselves grant every other API operation. If a call needs another scope and your client supports scope challenges, approve the prompt. Cloudflare’s API server README says Claude receives that as an HTTP 403insufficient_scopechallenge, and Codex and ChatGPT receive it in the tool result. - A Cloudflare API token for CI or another client that cannot complete OAuth. Create one in the API tokens dashboard with only the permissions that job needs, and pass it as a bearer token in the
Authorizationheader. User tokens and account tokens both work. An account token needs the Account Resources: Read permission so the server can detect the account ID. Tokens with Client IP Address Filtering are not supported. Keep the token in the client’s secret store. Do not paste it into the chat or into code the model writes.
Cloudflare also names Windsurf and the Cloudflare AI Playground as clients. The Playground accepts a server URL in its interface. The cloudflare-api label in the samples below is the name from Cloudflare’s MCP docs. Their agent-setup prompt uses the label cloudflare for the same URL. The label is local to your config file.
Connect Cloudflare in Cursor
Cloudflare’s Cursor setup guide starts with the Cloudflare plugin, which installs Cloudflare skills and registers the MCP servers. In Cursor, run /add-plugin cloudflare, or install Cloudflare from the Cursor Marketplace. The first time Cursor calls a Cloudflare tool, the browser opens so you can authorize with OAuth and choose permissions.
To add the API server yourself, put this in ~/.cursor/mcp.json or in .cursor/mcp.json for one project. Cloudflare’s MCP docs publish this URL shape, and the Cursor agent-setup prompt uses the same url field. There is no API token in the file.
{
"mcpServers": {
"cloudflare-api": {
"url": "https://mcp.cloudflare.com/mcp"
}
}
} Restart Cursor after you edit the file. Cloudflare’s troubleshooting note for this client is to check that .cursor/mcp.json is valid JSON. Skills are the instruction pack in cloudflare/skills. They are listed separately from servers on MCP Skill Hub. The plugin installs both. The MCP server is what calls the API.
Connect Cloudflare in Claude and Claude Code
Cloudflare’s Claude Code guide uses the skills plugin, which registers the MCP servers. Inside Claude Code, run these one at a time:
/plugin marketplace add cloudflare/skills
/plugin install cloudflare@cloudflare Cloudflare’s agent-setup prompt then says to run /reload-plugins. The same prompt says to use those plugin commands rather than claude mcp add. The first Cloudflare tool call opens OAuth. For CI, that Claude Code guide says to pass a Cloudflare API token as a bearer token instead of using OAuth. claude mcp list is the check Cloudflare names for seeing that the servers are connected.
A hand-written Claude Code entry still needs "type": "http". That field is in the API server README, and Claude Code skips a URL entry that omits it. Cursor’s file does not use the field, so a block copied from Cursor into Claude Code is a common miss. The value below is the manual fallback, not the plugin path.
{
"mcpServers": {
"cloudflare-api": {
"type": "http",
"url": "https://mcp.cloudflare.com/mcp"
}
}
} Cloudflare’s server catalog names Claude as an OAuth client and links the general MCP quickstart, not a Claude.ai click-path. The Visual Studio Code setup guide says this same URL works in Claude Desktop. That page does not list Claude Desktop’s menus. Use a Claude client that accepts a remote MCP URL, then complete the Cloudflare consent screen.
Connect Cloudflare in ChatGPT
Cloudflare does not publish a chatgpt.com setup page for mcp.cloudflare.com. The OpenAI client they document is Codex. The Codex setup guide says to install the Cloudflare plugin: run /plugins in the Codex CLI and install Cloudflare, or install the Cloudflare plugin from the Codex desktop app. That plugin registers the MCP servers. OAuth runs the first time Codex calls a Cloudflare tool.
The manual commands in Cloudflare’s agent-setup prompt are codex mcp add cloudflare --url https://mcp.cloudflare.com/mcp and codex mcp login cloudflare. The Codex guide also says to confirm the server with codex mcp list and /mcp.
The API server README does mention ChatGPT: missing OAuth scopes are returned in the tool result, which is where ChatGPT looks for them, and whoami is declared as an OpenAI profile tool. That is evidence the server can talk to ChatGPT. It is not a documented click-path. If your ChatGPT plan can add a remote MCP server, the URL and OAuth consent are the same ones above. Treat any menu labels you find outside Cloudflare’s docs as unverified.
Tools the API server exposes
The default Code Mode connection does not publish one MCP tool per API method. Cloudflare’s docs list these tools:
search. Runs JavaScript against the local OpenAPIspec. It makes no API call and does not expose acloudflareobject. Cloudflare’s example argument reads one path summary:
{
"code": "async () => spec.paths['/accounts'].get.summary"
} execute. Calls the API throughcloudflare.request()with the connection’s credentials. For more than one account, passaccount_idso the sandbox bindsaccountId. A single-account session already has that binding. Cloudflare’s example lists accounts:
{
"code": "async () => (await cloudflare.request({ method: 'GET', path: '/accounts' })).result"
} docs. Searches Cloudflare developer documentation. The documented argument is aquerystring.whoami. Takes no arguments. It returns an opaque profile id and, when available, an email or name. OAuth and user API tokens come back asuser:<USER_ID>. Account API tokens come back asaccount:<ACCOUNT_ID>. That id is not an account id for an API path. CallGET /accountsinexecutewhen you need the raw id.whoamidoes not list your permissions.submit_feedback. When the server has it enabled, it is available in both Code Mode and the per-endpoint mode. It sends feedback about Cloudflare products or the MCP server.
If your client already runs its own Code Mode and needs one tool per API operation, connect to https://mcp.cloudflare.com/mcp?codemode=false. docs and whoami stay. The README says this mode registers about 3,000 tools, one per API method, with arguments grouped as path, query, headers, and body. Cloudflare’s token table puts that style of native schema in the hundreds of thousands of tokens. Stay on the default URL unless the client requires the expanded tool list.
The API server README caps each Code Mode search and execute result at about 6,000 tokens. A cut stays valid JSON and is marked --- TRUNCATED ---. An agent that writes the result to a file, rather than reading it into the conversation, can pass truncate: false on that call. Leave the cap on when the result goes back to the model. The same README says GraphQL Analytics queries go through execute as well.
Setup questions that waste an afternoon
cloudflare is not definedinsidesearch.searchonly sees the OpenAPI spec. Look up the path there, then callcloudflare.request()insideexecute. Reconnecting does not add that object tosearch.- Token verify returns HTTP 401, code 1000.
GET /user/tokens/verifyandGET /accounts/{account_id}/tokens/verifycheck API tokens. An OAuth connection fails those calls even when MCP is healthy. Callwhoami. For a real API token, use the verify endpoint that matches theuser:oraccount:prefixwhoamireturned. - A read comes back empty. OAuth may lack the scope, and some endpoints, including
GET /zones, answer with an empty list in that case. Cloudflare says the server treats an empty list for a read the connection has no accepted scope for as a refusal. Read the tool error for the scope, approve the challenge if one appears, or reconnect and grant that scope. If the operation has no OAuth support, use an API token that includes the permission. - The client still requests
/sse. That path is retired. Point the client at the server’s/mcpURL. The 410 response includes that URL. - Claude Code never saves a URL you pasted from Cursor. Add
"type": "http", or use the plugin commands above so you do not maintain that JSON yourself. - Cursor does not pick up the server. Confirm
.cursor/mcp.jsonparses, then restart Cursor. OAuth starts when a Cloudflare tool is actually called.
This walkthrough, the official docs, and the listing
Use Cloudflare’s MCP server docs for the current server list and tool table, and the API server README for Code Mode limits, token auth, and the codemode=false switch. Use this page to pick a server and a client flow. Use the Cloudflare listing for the endpoint, the source repository, and the short setup card. Other infrastructure servers are in Cloud and DevOps.
Common questions
What is the Cloudflare MCP server URL?
The official Cloudflare API MCP server is https://mcp.cloudflare.com/mcp. Product-specific servers use their own hosts, such as https://docs.mcp.cloudflare.com/mcp. Cloudflare’s docs say each server exposes Streamable HTTP at /mcp. In the cloudflare/mcp-server-cloudflare repository, the retired /sse path returns 410 Gone and names the /mcp URL.
Should I use OAuth or an API token to install Cloudflare MCP?
Use OAuth for an interactive client such as Cursor, Claude Code, or Codex. Cloudflare redirects you to choose the permissions. Use a Cloudflare API token as a bearer token for CI or another client that cannot open a browser. Account tokens need the Account Resources: Read permission. Tokens with Client IP Address Filtering are not supported. Do not paste the token into the chat.
Which Cloudflare MCP server should I connect?
Connect https://mcp.cloudflare.com/mcp unless you want typed tools for one product. Cloudflare’s docs call that API server the one most people need: Code Mode covers the Cloudflare API and documentation search. Optional product servers are listed on the Cloudflare MCP docs and in the cloudflare/mcp-server-cloudflare repository. That repository marks an older set of product servers as deprecated and tells you to move to the API server.
Can I connect Cloudflare MCP from Claude, Cursor, and ChatGPT?
Cursor and Claude Code have Cloudflare setup guides. Cursor can also use the remote URL in mcp.json. Cloudflare’s Visual Studio Code guide says the same URL works in Claude Desktop, and it does not publish separate Claude Desktop menu steps. Cloudflare does not publish a chatgpt.com walkthrough for this server. The documented OpenAI path is Codex. The API server README says ChatGPT receives a missing-scope challenge in the tool result.
Where are the official Cloudflare MCP docs?
Cloudflare maintains the server catalog at https://developers.cloudflare.com/agents/model-context-protocol/cloudflare/servers-for-cloudflare/ and the API server source at https://github.com/cloudflare/mcp. This page is a walkthrough of that setup and a link back to the MCP Server Hub listing. Tool names and server URLs change there first.