All integrationsGet an API key
Cloudflare
DNS, zones, Workers, R2 and Cloudflare's product documentation.
Cloud and infrastructure
Docs and knowledge
How an agent reaches it
MCPREST APICLI
How you authenticate
API key
No credential needed
- Create a scoped API TOKEN (not the legacy Global API Key) with only the permissions you need.
- The documentation MCP server needs no credential at all.
Connection details
- Base URL
- https://api.cloudflare.com/client/v4
- Pagination
- page
- MCP server
- https://docs.mcp.cloudflare.com/mcp
Common endpoints
| verify the token | GET /user/tokens/verify |
| list zones | GET /zones |
| list DNS records | GET /zones/{zone_id}/dns_records |
| create a DNS record | POST /zones/{zone_id}/dns_records |
| purge cache | POST /zones/{zone_id}/purge_cache |
Worth knowing
- Every response is wrapped in {success, errors, messages, result}. A 200 with success:false is a failure.
- The legacy Global API Key uses X-Auth-Email plus X-Auth-Key instead of a bearer token. Prefer scoped tokens.
- Zone ids, not domain names, appear in paths.