The official Python library for the cloudflare API
Cloudflare MCP server is a locally run integration for AI assistants that speak the Model Context Protocol. The official Python library for the cloudflare API.
The Cloudflare Python library provides convenient access to the Cloudflare REST API from any Python 3.9+ application. The library includes type definitions for all request params and response fields, and offers both synchronous and asynchronous clients powered by httpx.
Installation goes through your MCP client rather than a global install: point it at cloudflare on PyPI and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.
Once Cloudflare is connected, these are the calls the assistant has available:
Retries — Certain errors are automatically retried 2 times by default, with a short exponential backoff. Connection errors (for example, due to a networkTimeouts — By default requests time out after 1 minute. You can configure this with a timeout option, which accepts a float or anLogging — We use the standard library logging moduleYou will need 3 environment variables: CLOUDFLARE_LOG, CLOUDFLARE_API_TOKEN, CLOUDFLARE_BASE_URL. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.
Python 3.9 or higher.
This sits in the cloud and infrastructure group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Cloudflare's toolset — Retries, Timeouts, Logging — is a fair guide to whether it matches your workflow.
This entry was verified against Cloudflare's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.
| Tool | What it does |
|---|---|
| Retries | Certain errors are automatically retried 2 times by default, with a short exponential backoff. Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, an |
| Timeouts | By default requests time out after 1 minute. You can configure this with a timeout option, which accepts a float or an [httpx.Timeout](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object |
| Logging | We use the standard library [logging](https://docs.python.org/3/library/logging.html) module. |
{
"mcpServers": {
"cloudflare-1": {
"command": "uvx",
"args": ["cloudflare"],
"env": {
"CLOUDFLARE_LOG": "your-value",
"CLOUDFLARE_API_TOKEN": "your-value",
"CLOUDFLARE_BASE_URL": "your-value"
}
}
}
}Add to claude_desktop_config.json, then restart Claude Desktop.
Python 3.9 or higher.
| Variable | Description | Required |
|---|---|---|
| CLOUDFLARE_LOG | Configuration value read at startup. | Optional |
| CLOUDFLARE_API_TOKEN | Credential the server authenticates with. | Yes |
| CLOUDFLARE_BASE_URL | Endpoint or connection string the server talks to. | Yes |
Manage your whole Supabase project in conversation — database, auth, storage, Edge Functions and branches.
Stop letting your assistant hallucinate n8n node parameters — this server hands it the real schemas, templates and validation.
AWS Labs' official server suite — current AWS docs, CDK guidance, cost analysis and service tools.
Cloud browsers for AI agents — automation sessions that run in Browserbase's fleet, not on your machine.
Workers, KV, R2 and D1 by conversation — Cloudflare's official remote servers for building and observability.
Dashboards, Prometheus and Loki queries, incidents and alerts — observability by conversation.