Cloudflare MCP

Cloudflare MCP

cloudflare
GitHub

About

A token-efficient MCP server for the entire Cloudflare API providing access to 2,500+ endpoints. Uses Code Mode to compress the 2M token OpenAPI spec into just ~1k tokens.

Authentication

Supports two authentication methods:

  1. OAuth (Recommended): Connect to the MCP URL and authorize via Cloudflare to select permissions
  2. API Token: Use a Cloudflare API token for CI/CD or automation. Both user tokens and account tokens are supported. For account tokens, include Account Resources : Read permission for auto-detection of account ID.

Note: API tokens with Client IP Address Filtering are not currently supported.

Features

Code Mode (Default)

Uses code execution to query the Cloudflare API spec and make API calls. Only 2 tools with ~1k token cost:

  • search: Write JavaScript to query spec.paths and find endpoints
  • execute: Write JavaScript to call cloudflare.request() with discovered endpoints

Native Mode (Optional)

Disable code mode with ?codemode=false query parameter to register individual tools for each API endpoint (~244k tokens). Use this when composing with other code mode servers.

Supported Products

Workers, KV, R2, D1, Pages, DNS, Firewall, Load Balancers, Stream, Images, AI Gateway, Vectorize, Access, Gateway, GraphQL Analytics API, and more.

Usage Examples

  • "List all my Workers"
  • "Create a KV namespace called 'my-cache'"
  • "Add an A record for api.example.com pointing to 192.0.2.1"

The agent will search for the right endpoints and execute API calls automatically.

GraphQL Analytics API

Automatically detects and handles Cloudflare's GraphQL Analytics API endpoints through the same execute tool.

This server runs through your single 1Server connection. No extra config required.

0Installs
475Stars

Categories

CloudAPIInfrastructure

Tags

Official