Skip to main content

At a glance

Credentials

Set these per environment. See Connect an integration.
VariableRequiredDescription
CLOUDFLARE_API_TOKENYesCloudflare API token (scoped Bearer token, not the legacy Global API Key) Docs.

Setup

  1. Sign in to Cloudflare: Go to https://dash.cloudflare.com and sign in. A free account with at least one zone added is sufficient for testing.
  2. Create an API token: Open My Profile > API Tokens (https://dash.cloudflare.com/profile/api-tokens) and create a token. The ‘Edit zone DNS’ template covers the DNS tools; add Zone:Read and Account:Read permissions for listing.
  3. Set the environment variable: Add the token to your .env as CLOUDFLARE_API_TOKEN=… (use a scoped API token, not the legacy Global API Key).
  4. Verify access: Run the Verify Token tool, then List Zones.
  • Cloudflare authenticates with ‘Authorization: Bearer <token>’
  • Account-scoped endpoints need an account ID - use List Accounts to find yours
  • Tokens can be scoped per zone; if List Zones returns nothing, widen the token’s zone resources
Provider API reference: https://developers.cloudflare.com/api/

Tools

ToolAccessDescription
Verify TokenReadCheck that the configured Cloudflare API token is valid and active
List ZonesReadList zones (domains) the token can access
Get ZoneReadGet details of a zone by ID
List DNS RecordsReadList DNS records in a zone
Create DNS RecordWriteCreate a DNS record in a zone
Update DNS RecordWriteUpdate fields of an existing DNS record
List AccountsReadList Cloudflare accounts the token can access (account IDs are needed for account-scoped APIs)

Example prompts

  • List the DNS records for one of my Cloudflare zones and flag anything unusual.
  • Create a DNS record in one of my Cloudflare zones after confirming the type, name, and content with me.