Skip to directory

About Cloudflare API MCP

Official remote MCP for Cloudflare's developer documentation and account APIs, using OAuth or scoped API tokens and progressive Code Mode discovery.

What you can use it for

  • Search Cloudflare documentation from Codex
  • Inspect or manage Cloudflare account APIs
  • Manage Workers, R2, D1, DNS, Stream, AI Gateway, and other Cloudflare products
Connection and setup
Hosting
Cloudflare-managed remote MCP
Transport
Streamable HTTP
Endpoint
https://mcp.cloudflare.com/mcp
Authentication
OAuth authorization is recommended for interactive use and lets the user select permissions. A scoped Cloudflare API bearer token can be used for automation. User and account tokens are supported.

Requirements

  • An MCP client that supports remote Streamable HTTP servers.
  • Authorize through Cloudflare OAuth, or provide a Cloudflare API token limited to the needed permissions.
  • For account tokens that need automatic account selection, include Account Resources: Read. Tokens with Client IP Address Filtering are not currently supported.

Setup steps

  1. Add the remote MCP URL https://mcp.cloudflare.com/mcp to Codex as a remote HTTP MCP server.
  2. Connect and complete Cloudflare OAuth, choosing only the scopes needed for the task; use a narrowly scoped bearer token for non-interactive automation.
  3. Call docs to search Cloudflare product documentation. For account operations, use search to discover API paths and schemas, then execute a bounded read or write request.
  4. Pass account_id to execute when the session can access multiple accounts; it is optional for a single resolved account and account-independent requests.
Tools 4

Four stored rows match current code-mode tool inventory; when codemode=false endpoint tool count is roughly 2,500 and changes with API spec.

  • docs

    Search Cloudflare developer documentation and return relevant passages.

    Parameters: query
    01
  • search

    Run supplied JavaScript against the Cloudflare OpenAPI spec to discover paths, methods, parameters, and schemas; no Cloudflare API request is made.

    Parameters: code
    02
  • execute

    Run supplied JavaScript that calls Cloudflare APIs through cloudflare.request; can read, create, update, or delete resources.

    Parameters: code, account_id (optional)
    03
  • whoami

    Identify the authenticated Cloudflare user or account for this connection.

    04
Limitations and notes
  • The broad API server is not a video analyzer; use a video MCP for captions, frames, OCR, and audiovisual analysis.
  • execute can create, update, or delete production account resources. Grant only necessary OAuth scopes or API-token permissions and review writes carefully.
  • Code Mode progressively searches a large API surface to keep tool context small; it is not equivalent to loading every API endpoint schema into the client.
  • When Code Mode is disabled, native endpoint tools increase context use substantially (the maintainer estimates about 244,000 tokens for minimal schemas).
  • Responses are capped near 6,000 tokens by default; disabling truncation can produce very large results.
  • Cloudflare docs note that some endpoints can return empty results when a permission is missing; an empty result may therefore reflect authorization rather than no account data.
  • Inventory is mode-dependent; code mode is the default compact surface.
Source discrepancies
  • Tool counts vary across official sources: the Cloudflare MCP overview describes two API Code Mode tools (search and execute); the repository README token comparison says three, but its tool list and current source register four total MCP tools (docs, search, execute, whoami). The catalog follows the current source registrations for the four named tools; no live tools/list check was performed.
Original sources
  • official product documentation

    Documents the managed server, endpoint, OAuth flow, Streamable HTTP transport, API coverage, and product-specific servers. Its tool summary lists search and execute.

  • maintainer repository readme

    Documents Code Mode and native endpoint mode, OAuth and API token setup, four tools, account selection, token limitations, context costs, result truncation, products, and authorization behavior.

  • maintainer tool source

    Registers search with one code string parameter and describes its read-only OpenAPI-spec execution.

  • maintainer tool source

    Registers execute with code and optional account_id, and documents that calls can read, create, update, or delete resources.

  • maintainer tool source

    Registers docs with the required query parameter.

  • maintainer tool source

    Registers whoami with an empty input schema and profile identification output.

  • vendor documentation

    Cloudflare official docs say endpoint https://mcp.cloudflare.com/mcp; maintainer README lists docs, search, execute and whoami. Code mode exposes four tools; disabling it exposes thousands of API endpoint tools.

Documentation checked 2026-10-28T00:00:00Z. Connection has not been runtime tested.