SecureAuth AI Gateway
IntegrationsResources

Cloudflare

Access the Cloudflare API — DNS, Workers, R2, Zero Trust — via the official Cloudflare MCP server

Cloudflare integration connects your agents to the full Cloudflare API (2,500+ endpoints across DNS, Workers, R2, Zero Trust, and more) through Cloudflare's official MCP server.

Server URL: https://mcp.cloudflare.com/mcp

Setup

  1. Navigate to Resources and click Add Resource
  2. Select Cloudflare from the catalog
  3. The resource is added with all tools and scopes pre-configured

Each user connects their own Cloudflare account via OAuth when they first use a Cloudflare tool. Navigate to Connections to manage linked accounts.

Cloudflare uses Dynamic Client Registration (RFC 7591) — the gateway registers a per-organization OAuth client with Cloudflare automatically on first install. Embedded and bring-your-own modes are not available for this resource. See Credential modes for how this compares to other catalog resources.

Available tools

Both tools take a single code field — a JavaScript async () => { ... } arrow function that the upstream runs in a sandboxed Dynamic Worker and whose return value becomes the tool result.

ToolDescription
searchRun JavaScript against the in-memory Cloudflare OpenAPI spec (all $refs resolved) to discover paths, methods, parameters, and request/response shapes
executeRun JavaScript against the Cloudflare API. The sandbox exposes cloudflare.request({method, path, query, body, contentType, rawBody}) and an injected accountId constant

Cloudflare uses Codemode so two tools cover the entire 2,500+ endpoint API surface (~1k tokens of tool schema instead of the ~1M tokens a one-tool-per-endpoint MCP would need). Typical flow: call search to find the endpoint you want, then execute to call it.

Required scopes

  • offline_access — maintain access when the user is offline

Policy examples

  • Read-only access: deny execute, allow search (callers can discover endpoints but cannot mutate)
  • Audit-only sandbox: allow search and execute, then constrain via CEL conditions so policy decisions inspect the submitted code before it runs

Because execute runs arbitrary JavaScript against the full Cloudflare API client, per-endpoint authorization at the gateway is coarse. For finer-grained control, combine gateway policies with scope-restricted Cloudflare API tokens or CEL conditions that inspect the request payload.

On this page