Provides comprehensive access to the complete Cloudflare API, allowing agents to search for specific endpoints within the OpenAPI spec and execute requests to manage Cloudflare services and configurations.
Enables the management and querying of Cloudflare Workers, including searching for worker-related endpoints and executing scripts to retrieve or update worker resources via the Cloudflare API.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Cloudflare MCPlist all the cloudflare workers in my account"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cloudflare-mcp
A smol MCP server for the complete Cloudflare API.
Uses codemode to avoid dumping too much context to your agent.
The Problem
The Cloudflare OpenAPI spec is 2.3 million tokens in JSON format. Even compressed to TypeScript endpoint summaries, it's still ~50k tokens. Traditional MCP servers that expose every endpoint as a tool, or include the full spec in tool descriptions, leak this entire context to the main agent on every request.
This server solves the problem by using code execution in a codemode pattern - the spec lives on the server, and only the results of queries are returned to the agent.
Tools
Two tools where the agent writes code to search the spec and execute API calls. Akin to ACI.dev's MCP server but with added codemode.
Tool | Description |
| Write JavaScript to query |
| Write JavaScript to call |
Token usage: Only search results and API responses are returned. The 6MB spec stays on the server.
Setup
Create API Token
Create a Cloudflare API token with the permissions you need.
Add to Claude Code
Usage
Token Comparison
Content | Tokens |
Full OpenAPI spec (JSON) | ~2,352,000 |
Endpoint summary (TypeScript) | ~43,000 |
Typical search result | ~500 |
API response | varies |
Architecture
Code execution uses Cloudflare's Worker Loader API to run generated code in isolated workers, following the codemode pattern.