Cloudflare MCP Server

Connect AI models to the Cloudflare API and developer documentation through Cloudflare's managed remote MCP server.

October 19, 2026
MCP ServerDevelopment Tools & DevOpsCloudflare MCP Server
GitHub starsOfficial

Overview

The Cloudflare API MCP server is a managed remote MCP server that exposes the entire Cloudflare API β€” over 2,500 endpoints across DNS, Workers, R2, Zero Trust, and every other product β€” plus Cloudflare developer documentation.

It uses the search-and-execute Code Mode pattern: instead of registering a separate tool for every API endpoint, the model searches the API and writes JavaScript against a typed representation of the OpenAPI spec, which runs inside an isolated Dynamic Worker sandbox.

Official Server:

Developed and maintained by Cloudflare. The Streamable HTTP endpoint is https://mcp.cloudflare.com/mcp.

Key Features

🌐

Full Cloudflare API

Access over 2,500 endpoints across DNS, Workers, R2, Zero Trust, and every Cloudflare product.

⚑

Code Mode

Model-written JavaScript runs against a typed API client in a sandbox, using about 1,000 tokens instead of over a million.

πŸ“š

Documentation Search

Search Cloudflare developer documentation alongside the API.

πŸ”

OAuth or API Token

Authorize with OAuth and scoped permissions, or pass a Cloudflare API token as a bearer token for automation.

Available Tools

Quick Reference

ToolPurposeCategory
searchFind API endpoints to callAPI Discovery
executeRun JavaScript against the Cloudflare APIAPI Execution
docsSearch Cloudflare developer documentationDocumentation

Detailed Usage

searchβ–Ά

Searches the Cloudflare API for endpoints that match a task.

use_mcp_tool({
  server_name: "cloudflare-api",
  tool_name: "search",
  arguments: {
    query: "update DNS record"
  }
});
executeβ–Ά

Runs JavaScript against the typed Cloudflare API client in an isolated Dynamic Worker sandbox.

use_mcp_tool({
  server_name: "cloudflare-api",
  tool_name: "execute",
  arguments: {
    code: "// JavaScript that calls the typed Cloudflare API client"
  }
});
docsβ–Ά

Searches Cloudflare developer documentation.

use_mcp_tool({
  server_name: "cloudflare-api",
  tool_name: "docs",
  arguments: {
    query: "Workers KV"
  }
});

Product-Specific Servers

Cloudflare also runs optional servers for targeted use cases. The main API server already covers the full API, so these are only needed for specific workflows.

ServerPurposeURL
DocumentationSearch Cloudflare reference documentationhttps://docs.mcp.cloudflare.com/mcp
ContainerSpin up a sandbox development environmenthttps://containers.mcp.cloudflare.com/mcp
Browser RunFetch pages, convert to markdown, take screenshotshttps://browser.mcp.cloudflare.com/mcp
Digital Experience MonitoringAnalyze critical applications for your organizationhttps://dex.mcp.cloudflare.com/mcp
Cloudflare One CASBIdentify SaaS security misconfigurationshttps://casb.mcp.cloudflare.com/mcp
Agents SDK DocumentationSearch the Agents SDK documentationhttps://agents.cloudflare.com/mcp

Installation

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

For Claude Code, run claude mcp add --transport http cloudflare-api https://mcp.cloudflare.com/mcp.

When you connect, you are redirected to Cloudflare to authorize via OAuth and select the permissions to grant.

Client Compatibility:

Use Streamable HTTP. Historical /sse URLs are aliases for the same handler, but the deprecated HTTP+SSE transport is no longer served.

Common Use Cases

1. Manage DNS and Zones

Ask the agent to find and call the right API endpoints for records, zones, and settings:

use_mcp_tool({
  server_name: "cloudflare-api",
  tool_name: "search",
  arguments: {
    query: "create DNS record"
  }
});

2. Automate Workers and Infrastructure

Use execute to script multi-step changes across Workers, R2, and other services in one sandboxed call.

3. Answer Product Questions from Docs

Search current Cloudflare documentation instead of relying on training data:

use_mcp_tool({
  server_name: "cloudflare-api",
  tool_name: "docs",
  arguments: {
    query: "Durable Objects alarms"
  }
});

Security

  • OAuth authorization lets you grant only the scopes the agent needs
  • API tokens for automation should follow least privilege and be rotated regularly
  • Model-written code runs in an isolated Dynamic Worker sandbox
  • Review changes before granting write permissions

Limitations

  • Uses the search-and-execute pattern rather than one native tool per endpoint
  • Product-specific servers are optional and narrower than the main API server
  • Some accounts and products require specific token permissions

Resources

Sources