Cloudflare MCP Server provides token-efficient access to the entire Cloudflare API via Model Context Protocol. Instead of exposing 2,500+ endpoints as individual tools, it uses a Code Mode pattern where agents write JavaScript to search specs and execute API calls. Reduces token overhead from hundreds of thousands to ~1,069 tokens. Covers Workers, KV, R2, D1, Pages, DNS, and all Cloudflare products through just two tools: search and execute.
git clone https://github.com/cloudflare/mcp.git
// Claude Desktop config
{
"mcpServers": {
"cloudflare": {
"command": "npx",
"args": ["@cloudflare/mcp-server"],
"env": {
"CLOUDFLARE_API_TOKEN": "your-token"
}
}
}
}
// Then ask: "List my Workers" or "Create a KV namespace"