Cloudflare

v1.0.0Cloud Servicesstable

Enables interaction with the complete Cloudflare API using a codemode pattern that allows agents to search the OpenAPI spec and execute API calls via JavaScript. This approach minimizes token usage by keeping the massive specification on the server a

cloudflare-mcpmcpai-integration
Share:
129
Stars
0
Downloads
0
Weekly
0/5

What is Cloudflare?

Cloudflare is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables interaction with the complete cloudflare api using a codemode pattern that allows agents to search the openapi spec and execute api calls via javascript. this approach minimizes token usage by...

Enables interaction with the complete Cloudflare API using a codemode pattern that allows agents to search the OpenAPI spec and execute API calls via JavaScript. This approach minimizes token usage by keeping the massive specification on the server a

This server falls under the Cloud Services category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Enables interaction with the complete Cloudflare API using a

Use Cases

Manage DNS records and domain settings.
Control Cloudflare services through natural language.
Automate website configuration tasks.
mattzcarey

Maintainer

LicenseApache 2.0
Languagetypescript
Versionv1.0.0
UpdatedApr 29, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx cloudflare-mcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Cloudflare

Cloudflare MCP Server enables AI agents to interact with the complete Cloudflare API through a codemode pattern where the agent first searches the OpenAPI specification for relevant endpoints, then executes API calls via JavaScript. This approach keeps the massive Cloudflare OpenAPI spec on the server side, minimizing token usage while exposing all Cloudflare products including Workers, KV, R2, D1, DNS, Firewall, and Access. Platform engineers and developers can manage their entire Cloudflare infrastructure through natural language without memorizing API endpoints.

Prerequisites

  • A Cloudflare account with an API token
  • A Cloudflare API token created at dash.cloudflare.com/profile/api-tokens (with permissions for the services you want to manage)
  • An MCP-compatible client such as Claude Desktop or the Claude Code CLI
  • Node.js and npm installed if deploying the server yourself
1

Create a Cloudflare API token

Go to dash.cloudflare.com/profile/api-tokens and create a new API token. For Account tokens (recommended), include 'Account Resources: Read' permission so the server can auto-detect your account ID. Add permissions for the specific services you want to manage (DNS, Workers, KV, etc.).

2

Connect via Claude Code CLI

The easiest way to add the server is with the Claude Code CLI using the deployed Cloudflare Worker endpoint. Set your API token as an environment variable first.

export CLOUDFLARE_API_TOKEN="your-token-here"
claude mcp add --transport http cloudflare-api \
  https://cloudflare-mcp.mattzcarey.workers.dev/mcp \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
3

Configure via opencode.json (alternative)

For opencode users, add this configuration to your opencode.json. The {env:CLOUDFLARE_API_TOKEN} syntax reads the token from your shell environment.

{
  "mcp": {
    "cloudflare-api": {
      "type": "remote",
      "url": "https://cloudflare-mcp.mattzcarey.workers.dev/mcp",
      "headers": {
        "Authorization": "Bearer {env:CLOUDFLARE_API_TOKEN}"
      }
    }
  }
}
4

Deploy your own instance (optional)

If you prefer to self-host, clone the repository and deploy your own Cloudflare Worker instance.

git clone https://github.com/mattzcarey/cloudflare-mcp
cd cloudflare-mcp
npm i
npm run deploy
5

Start managing Cloudflare through Claude

Ask Claude to manage your Cloudflare resources. Claude uses the 'search' tool to find the right API endpoint in the OpenAPI spec, then 'execute' to call it with JavaScript.

Cloudflare Examples

Client configuration

MCP configuration connecting to the hosted Cloudflare MCP Worker with API token authentication. Replace 'your-token-here' with your actual Cloudflare API token.

{
  "mcp": {
    "cloudflare-api": {
      "type": "remote",
      "url": "https://cloudflare-mcp.mattzcarey.workers.dev/mcp",
      "headers": {
        "Authorization": "Bearer your-token-here"
      }
    }
  }
}

Prompts to try

Example prompts for managing Cloudflare infrastructure through Claude.

- "List all my Cloudflare Workers and show their status and last deployment time."
- "Add an A record for api.example.com pointing to 203.0.113.10 in my example.com zone."
- "Create a KV namespace called 'session-cache' in my account and show the binding configuration I need to add to my Worker."

Troubleshooting Cloudflare

API calls fail with '403 Forbidden' or 'insufficient permissions'

Your API token does not have the required permissions for the resource you are trying to manage. Edit the token at dash.cloudflare.com/profile/api-tokens and add the specific permissions needed (e.g., Zone:DNS:Edit for DNS record management).

account_id is required but not provided

Switch to an Account token type and include the 'Account Resources: Read' permission so the server can auto-detect your account ID. Alternatively, pass your account_id explicitly in the prompt: 'using account ID abc123, list my Workers'.

Connection to cloudflare-mcp.mattzcarey.workers.dev fails

Verify the Worker is still deployed and accessible by visiting the URL in a browser. If it is unavailable, deploy your own instance: clone the repo, run 'npm i && npm run deploy', and update your MCP config to point to your own Worker URL.

Frequently Asked Questions about Cloudflare

What is Cloudflare?

Cloudflare is a Model Context Protocol (MCP) server that enables interaction with the complete cloudflare api using a codemode pattern that allows agents to search the openapi spec and execute api calls via javascript. this approach minimizes token usage by keeping the massive specification on the server a It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Cloudflare?

Follow the installation instructions on the Cloudflare GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Cloudflare?

Cloudflare works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Cloudflare free to use?

Yes, Cloudflare is open source and available under the Apache 2.0 license. You can use it freely in both personal and commercial projects.

Browse More Cloud Services MCP Servers

Explore all cloud services servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "cloudflare-mcp": { "command": "npx", "args": ["-y", "cloudflare-mcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Cloudflare?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides