Open-source project
cloudflare/mcp avatar
cloudflare/mcp

Cloudflare's MCP Server: 2,500 API Endpoints Behind Three Tools

MCP server for the Cloudflare API

836 stars116 forksTypeScriptApache-2.0

At a glance

What is it?
Cloudflare's MCP server puts its entire API behind a search-and-execute pair of tools instead of one tool per endpoint. The README's own token table explains why, and the same table explains when you should turn that design off.
Who is it for?
Adopt this server if your agent needs broad Cloudflare coverage and your context budget is tight, because the README's own table puts code mode at roughly 1,100 tokens against 244,047 for minimal native schemas. Do not adopt it if your client has no JavaScript execution path for tool payloads, or if you need a token with Client IP Address Filtering, which the README states is not supported.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 6 days ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The context bill that Cloudflare's API spec runs up

The Cloudflare OpenAPI spec is the problem this project was built around. The README states it is 2 million tokens, and that exposing the API as native MCP tools with full schemas costs 1,170,523 tokens across 2,594 tools. Trimming schemas to required parameters only still lands at 244,047 tokens, which the README's own table scores at 122 percent of a 200K context window. That is the failure mode: the server does not run out of endpoints, the agent runs out of room for the user's actual request. This server targets engineers wiring Cloudflare into an agent that also has to hold a conversation, a codebase, or a runbook. If your only goal is one scripted API call, an MCP server is the wrong layer entirely and curl against the REST API is shorter.

Three tools, a spec on the server, and a JavaScript sandbox in between

The README describes three tools. `docs` searches Cloudflare developer documentation. `search` runs JavaScript against `spec.paths` to find endpoints. `execute` runs JavaScript that calls `cloudflare.request()` with the endpoints that search turned up. The data flow is the point: the spec stays on the server, the agent writes code that queries it, and only the execution result crosses back. The README's diagram shows exactly two round trips, search then execute. Nothing in the supplied material describes which JavaScript runtime executes that code, how long it may run, or what it can reach beyond `spec.paths` and `cloudflare.request()`. That is a gap worth naming rather than guessing at, because the security properties of this design rest entirely on a sandbox the README does not document. The GraphQL Analytics API is handled through the same `execute` tool, with the README showing a POST to `/client/v4/graphql` carrying a `query` and a `variables` object.

Getting it connected: OAuth, bearer tokens, and the codemode flag

The MCP URL is `https://mcp.cloudflare.com/mcp`. OAuth is the recommended path: connect to that URL and you are redirected to Cloudflare to authorize and pick permissions. The README's JSON block uses `"type": "http"` and the `url` key under `mcpServers`. The token path is for CI/CD and automation. Create a Cloudflare API token with the permissions you need; both user tokens and account tokens work. For account tokens, add Account Resources : Read so the server can auto-detect your account ID, which removes the need to pass `account_id` on every `execute` call. Two constraints are stated plainly. API tokens with Client IP Address Filtering enabled are not currently supported. And if you want the per-endpoint tool layout instead of code mode, append `?codemode=false` to the URL, which registers tools like `get_workers_scripts` and `post_d1_database` with schemas derived from path parameters, query parameters and request body. The README warns that this raises cost to roughly 244k tokens and says to disable code mode only when composing with another code mode system.

The codemode=false path is a different product, not a setting

The two modes do not share a cost profile, and the README is direct about it. Code mode is about 1,100 tokens. The full per-endpoint layout is roughly 244,047. That is a difference of two orders of magnitude from one query parameter. The per-endpoint path also changes what the agent does: tools make direct API calls with no code execution involved, and path parameters like `account_id` are auto-resolved when there is a single account. So the fallback is not merely more expensive, it is a different interaction model in which the agent picks a tool by name rather than writing a query. If your client cannot execute JavaScript that the server hands back, or if it already runs its own code mode and would nest two of them, the fallback is the correct choice despite the token hit. The `docs` tool remains available in both modes, per the README.

Where the token table stops being an argument

The README's comparison table is the strongest evidence in the repository, and it is also the least independently checkable part of it. No methodology, no tokenizer, no measurement date accompanies the figures. Treat 1,100 tokens as a claim from the project, not a benchmark. The more useful limitation is structural: code mode trades a fixed context cost for variable output cost. A `search` call that returns a wide slice of `spec.paths`, or an `execute` call that returns a large API response, spends tokens in the result rather than in the schema. The README's example search loops over every path and method and pushes a summary for each match, which is exactly the shape that can return more than expected. The fixed-schema approach has the opposite profile: expensive up front, predictable per call. Which one is cheaper depends on how many endpoints you touch per session, and the README does not model that.

What to compare against: the official Cloudflare MCP servers

Cloudflare publishes separate, product-scoped MCP servers, and the README's own Supported Products list (Workers, KV, R2, D1, Pages, DNS, Firewall, Load Balancers, Stream, Images, AI Gateway, Vectorize, Access, Gateway) describes what this single server covers. The difference in approach is scope versus precision. A product-scoped server exposes a handful of tools with hand-written schemas for one service, so the agent sees a small, reviewed surface and cannot reach anything outside it. This server exposes the whole REST surface through code, so reach is effectively unbounded but every call is composed at runtime from a spec the agent queried. If your agent only manages R2 buckets, a scoped server gives you a smaller blast radius and schemas somebody wrote deliberately. If your agent has to move between Workers, DNS and D1 in one session, four scoped servers means four connections and four token budgets, and this one server is the better fit.

Licence, maintenance, and what the repository material does not say

The licence is Apache-2.0, which permits commercial use and modification and includes an explicit patent grant. That is a permissive licence, not a legal opinion, and if you fork or redistribute the server you should read the notice and attribution requirements yourself. On maintenance cost, the repository is TypeScript on the `main` branch with no releases retrieved, so there is no versioned artifact to pin against and no changelog to diff. The practical upgrade cost sits on the server side rather than yours: the spec and the endpoint surface live behind `https://mcp.cloudflare.com/mcp`, so endpoint coverage can change without a change in your config. The `?codemode=false` flag and the Account Resources : Read requirement are the two config details most likely to matter if the server's behaviour shifts, and both are worth re-checking against the README after any change in tool behaviour rather than assumed stable. Nothing in the supplied material states a support policy, a deprecation process, or a compatibility guarantee for the hosted endpoint.

Editorial conclusion

Adopt this server if your agent needs broad Cloudflare coverage and your context budget is tight, because the README's own table puts code mode at roughly 1,100 tokens against 244,047 for minimal native schemas. Do not adopt it if your client has no JavaScript execution path for tool payloads, or if you need a token with Client IP Address Filtering, which the README states is not supported. Verify first that your client can handle the search then execute round trip, and that a single account token carries Account Resources : Read so account_id auto-detection works.

Official sources

  1. cloudflare/mcp on GitHub
  2. Issues
  3. License: Apache-2.0
  4. Project website
  5. README
Community notes

Community notes