mcp
by cloudflare·★ 459·Score 53
Token-efficient MCP server for Cloudflare API with 2500 endpoints accessible via Code Mode.
Overview
This is a production-ready MCP server from Cloudflare that provides access to their entire Cloudflare API through a token-efficient Code Mode approach. Instead of exposing every API endpoint as a separate tool (which would require ~244k tokens), it uses code execution where the server executes JavaScript code to search the API spec and make calls, reducing token cost to just ~1k tokens. The server supports both OAuth and API token authentication methods, with special handling for GraphQL Analytics API endpoints.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose this server when you need to interact with Cloudflare's extensive API ecosystem through an AI agent and want maximum token efficiency.
When NOT to choose this
Avoid if you need fine-grained control over each API endpoint as an individual tool (requires disabling Code Mode) or if you're not already using Cloudflare services.
Tools this server exposes
2 tools extracted from the READMEsearchQuery the Cloudflare API specification to find endpoints
executeExecute API calls to the Cloudflare API with discovered endpoints
Comparable tools
Installation
Installation
- Add to Claude Desktop:
{
"mcpServers": {
"cloudflare-api": {
"url": "https://mcp.cloudflare.com/mcp"
}
}
}- For API Token authentication:
{
"mcpServers": {
"cloudflare-api": {
"url": "https://mcp.cloudflare.com/mcp",
"bearerToken": "YOUR_CLOUDFLARE_API_TOKEN"
}
}
}- Disable Code Mode (if needed):
{
"mcpServers": {
"cloudflare-api": {
"url": "https://mcp.cloudflare.com/mcp?codemode=false"
}
}
}FAQ
- How does Code Mode reduce token usage?
- Instead of exposing each of the 2500+ Cloudflare API endpoints as separate tools (which would require ~244k tokens), it uses code execution where the agent writes JavaScript to search the spec and execute API calls, reducing token cost to ~1k tokens.
- What authentication methods are supported?
- Both OAuth (recommended for users) and API tokens (for CI/CD or automated workflows) are supported. API tokens with Client IP Address Filtering enabled are not currently supported.
On Hacker News
Recent discussion from the developer community.
- Story by shakes · 2024-11-28
Compare mcp with
Last updated · Auto-generated from public README + GitHub signals.