Cloud ops#Cloud#Deployment

Cloudflare MCP: the whole Cloudflare API in three tools

Cloudflare's remote MCP servers: Code Mode reaches about 2,500 API endpoints with two code tools in roughly 1k tokens; focused servers cover logs and Workers.

Project and installation docs

View project

https://github.com/cloudflare/mcp-server-cloudflare

Cloudflare’s OpenAPI spec runs to about 2 million tokens. Even as minimal MCP tools with only required parameters, the endpoints would take around 244k tokens, more than a context window holds. Cloudflare’s answer is Code Mode: the spec stays on the server, the agent writes a short JavaScript function to search it and another to call the API, and only the result comes back. That recommended server lives in cloudflare/mcp; a dozen-plus product-specific servers live in cloudflare/mcp-server-cloudflare, which had about 4.4k stars as of 2026-10-06.

What it does

  • Code Mode for the full API: search runs JavaScript over spec.paths to find endpoints, execute calls cloudflare.request(), and docs searches the developer docs, covering about 2,500 endpoints across Workers, KV, R2, D1, Pages, DNS, firewall and more.
  • Observability: the Observability server queries Workers logs and analytics; the Logpush server summarizes job health.
  • Building on Workers: Workers Bindings works with storage, AI and compute primitives, Workers Builds reports on builds, and the Container server spins up a sandbox dev environment.
  • More focused servers: Browser Run fetches pages as Markdown or screenshots, AI Gateway searches prompt and response logs, Radar explores internet trends, DNS Analytics debugs DNS performance.

Who it’s for

  • Developers on Workers, R2 and D1 who want the agent to read logs, create KV namespaces or edit DNS records.
  • Operators managing many zones and security rules who want to investigate in plain language.

Setup

All of these are remote servers, so clients with remote MCP support just take a URL. The Code Mode server uses OAuth and redirects you to Cloudflare to pick permissions:

{
  "mcpServers": {
    "cloudflare-api": {
      "type": "http",
      "url": "https://mcp.cloudflare.com/mcp"
    }
  }
}

For CI and automation, pass a Cloudflare API token as a bearer token instead. Product server URLs are in the README table; Observability, for example, is https://observability.mcp.cloudflare.com/mcp.

Our take

Code Mode is why this entry is worth reading: two code-execution tools stand in for 2,500 endpoint tools, cutting context from hundreds of thousands of tokens to about a thousand, an approach other large APIs could borrow. The product servers suit narrower jobs where typed, guided tools are preferable. It really does change your account, adding DNS records or creating KV namespaces, so grant only the permissions you need during OAuth. Some features require a paid Workers plan. Servers that chain many calls, like Observability, can push a conversation to its context limit; the README suggests asking smaller questions. Licensed Apache-2.0.