Cloudflare
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
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
Maintainer
Works with
Installation
Manual Installation
npx cloudflare-mcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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.).
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"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}"
}
}
}
}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 deployStart 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.
Cloudflare Alternatives — Similar Cloud Services Servers
Looking for alternatives to Cloudflare? Here are other popular cloud services servers you can use with Claude, Cursor, and VS Code.
Open WebUI
★ 138.2kUser-friendly AI Interface (Supports Ollama, OpenAI API, ...)
Anything LLM
★ 60.4kThe all-in-one AI productivity accelerator. On device and privacy first with no annoying setup or configuration.
LocalAI
★ 46.4kLocalAI is the open-source AI engine. Run any model - LLMs, vision, voice, image, video - on any hardware. No GPU required.
Nacos
★ 33.0kan easy-to-use dynamic service discovery, configuration and service management platform for building AI cloud native applications.
Xiaozhi ESP32
★ 26.7k本项目为xiaozhi-esp32提供后端服务,帮助您快速搭建ESP32设备控制服务器。Backend service for xiaozhi-esp32, helps you quickly build an ESP32 device control server.
Gateway
★ 11.8kA blazing fast AI Gateway with integrated guardrails. Route to 1,600+ LLMs, 50+ AI Guardrails with 1 fast & friendly API.
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.
Set Up Cloudflare in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.