cloudflare

Query and manage the Cloudflare v4 API for DNS, cache, WAF, Workers, and Zero Trust resources.

2|Updated Jul 28, 2026
One-click install
npx skills add https://github.com/mbadali25/useful-claude-add-ons --skill cloudflare-mbadali25
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare
Source: https://github.com/mbadali25/useful-claude-add-ons/tree/main/skills/cloudflare
Command: npx skills add https://github.com/mbadali25/useful-claude-add-ons --skill cloudflare-mbadali25

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Working with the Cloudflare v4 API requires handling scoped token authentication, zone versus account scoping, offset pagination, undocumented rate-limit behavior, and risky production mutations. This Skill provides a self-contained Python client and reference guides that handle all of that boilerplate and safety logic so you can query or modify Cloudflare resources directly and safely. ## Core Features & Use Cases - Full API coverage: Read and manage DNS records, zones, cache purge, firewall/WAF rulesets, page rules, SSL/TLS, DNSSEC, Workers/KV/R2, Zero Trust (Access, Gateway, tunnels), account members, and analytics through one CLI. - Safe mutations: Built-in dry-run previews and a read-only mode (CLOUDFLARE_READ_ONLY=1) block accidental changes to production DNS, cache, or firewall rules. - Robust client behavior: Handles the standard response envelope, offset and cursor pagination, exponential backoff on 429s (Cloudflare sends no Retry-After), and both scoped token and legacy Global API Key auth. - Use Case: Export every DNS record in a zone for audit, then upsert a single A record with a dry-run preview before applying the change to live traffic. ## Quick Start Export your Cloudflare API token and zone ID as environment variables, then ask the assistant to list all DNS records for your zone using the cloudflare client script.

Frequently Asked Questions about cloudflare

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I authenticate with the Cloudflare v4 API?

Use a scoped API token sent as an Authorization: Bearer header, set via the CLOUDFLARE_API_TOKEN environment variable. The legacy Global API Key (X-Auth-Email plus X-Auth-Key) still works but is root-equivalent over the whole account and should be avoided for automation.

How do I manage Cloudflare DNS records from the command line?

Run the cloudflare_client.py script with get, post, put, or delete against /zones/{zone_id}/dns_records. Resolve the zone ID first with the zone-id command, and use --dry-run to preview any mutation before sending it.

Why does listing Cloudflare zones return 403 or an empty array with a valid token?

A scoped API token often lacks permission to enumerate /zones or /accounts even when it has full access to one specific resource. Set CLOUDFLARE_ZONE_ID and CLOUDFLARE_ACCOUNT_ID directly from the dashboard to skip the lookup entirely.

Does the Cloudflare API send a Retry-After header on 429 rate limits?

No, Cloudflare does not send Retry-After on 429 responses. The limit is 1,200 requests per 5-minute rolling window, and the client handles this with exponential backoff automatically.

Can I still use the Cloudflare Firewall Rules API for WAF custom rules?

No, the legacy Firewall Rules and Filters APIs were sunset on 2025-06-15. WAF custom rules are now managed through the Rulesets engine using the http_request_firewall_custom phase entrypoint with atomic read-modify-write updates.

How do I safely purge the Cloudflare cache without an origin load spike?

Prefer targeted purges of specific URLs, hosts, or cache tags via POST /zones/{zid}/purge_cache instead of purge_everything. A full purge can spike origin load, so the client supports --dry-run to preview the request before confirming.