Cloudflare MCP Server
Published
At a glance
- Category
- Cloud & DevOps
- GitHub repository
- cloudflare/mcp-server-cloudflare
- Watch out for
- The API server can call any endpoint your token or OAuth grant allows, including destructive ones. Grant the narrowest permissions you can.
Cloudflare runs several remote MCP servers, and this repository holds the domain-specific ones: small servers with typed tools for one product area each, hosted at addresses like docs.mcp.cloudflare.com/mcp. Alongside them sits a separate project, the Cloudflare API MCP Server at mcp.cloudflare.com (in the cloudflare/mcp repository), which covers the whole Cloudflare API. Knowing which one you want saves a lot of confusion.
The API server is the interesting one technically. Rather than registering thousands of tools, it uses what Cloudflare calls Code Mode: two tools, search and execute. The model writes a little JavaScript to search the OpenAPI spec for the endpoints it needs, then writes JavaScript that calls them, and that code runs in an isolated Worker. Cloudflare's own comparison puts the cost at roughly a thousand tokens of tool definitions, against hundreds of thousands for one tool per endpoint.
Several of the older domain servers in this repository, including Workers Bindings, Workers Builds, Observability, Radar, DNS Analytics, GraphQL, Logpush, Audit Logs, AI Gateway and AutoRAG, are now marked deprecated with a request to move to the API server. The ones still recommended cover documentation, Browser Run, containers, Digital Experience Monitoring, Cloudflare One CASB and the Cloudflare blog.
How it connects
Your AI app
An assistant or agent that supports MCP
Cloudflare MCP Server
Runs as
- Remote (HTTP)
Gives the agent
- Whole-API access through Code Mode
- Documentation server
- Browser Run
- Container sandbox
- Security and monitoring servers
Cloudflare
Signs in with
- OAuth / browser sign-in
- Token
What it can do
- Whole-API access through Code Mode
- The API server's search and execute tools reach Cloudflare's full API, including the GraphQL Analytics API, with each result capped at about 6,000 tokens to avoid flooding the context.
- Documentation server
- Answers questions from current Cloudflare reference docs, which helps because Workers and its bindings change faster than most models' training data.
- Browser Run
- Fetches web pages, converts them to Markdown and takes screenshots using Cloudflare's browser infrastructure.
- Container sandbox
- Spins up a sandbox development environment the agent can use to run code away from your machine.
- Security and monitoring servers
- The CASB server flags security misconfigurations in connected SaaS apps; Digital Experience Monitoring reports on the health of critical applications.
Setting it up
All of these are remote servers, so there is nothing to install. Add an HTTP server in your client: https://mcp.cloudflare.com/mcp for the API server, or a product address such as https://docs.mcp.cloudflare.com/mcp. OAuth is the recommended login; you are redirected to Cloudflare to choose permissions. For CI or automation you can instead send a Cloudflare API token as a bearer token, but tokens with Client IP Address Filtering are not supported. Old /sse URLs now return 410 Gone, so update any configuration that still uses them. If your client already uses code mode, add ?codemode=false to the API server URL.
Where each client keeps its MCP config file, and the JSON it expects (cheat sheet)
Where it helps
- Asking an agent to check a zone's DNS records or firewall rules through the API server
- Getting current Workers and bindings documentation while writing a Worker
- Fetching a page as Markdown or a screenshot without running a browser locally
- Reviewing CASB findings for misconfigured SaaS apps in a Zero Trust setup
Limitations and things to watch
- The API server can call any endpoint your token or OAuth grant allows, including destructive ones. Grant the narrowest permissions you can.
- Many domain servers in this repository are deprecated; check the README before building on one.
- Some features need a paid Workers plan, as the README notes.
- Code Mode depends on the model writing correct JavaScript. Weaker models may struggle compared with one tool per action.
Sources
Written from the project's own documentation, checked November 2026.
- github.com /cloudflare/mcp-server-cloudflare
- github.com /cloudflare/mcp
- blog.cloudflare.com /code-mode-mcp
How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.