Cloudflare connector
OAuth 2.0Developer ToolsMonitoringAutomationCloudflare is a cloud platform providing DNS management, CDN, security, and networking services. This connector enables automated management of zones, DNS...
Cloudflare connector
-
Install the SDK
Section titled “Install the SDK”Terminal window npm install @scalekit-sdk/nodeTerminal window pip install scalekit -
Set your credentials
Section titled “Set your credentials”Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret> -
Set up the connector
Section titled “Set up the connector”Register your Cloudflare credentials with Scalekit so it handles the token lifecycle. You do this once per environment.
Dashboard setup steps
Register your Scalekit environment with Cloudflare so Scalekit handles the OAuth flow and token lifecycle for your users. Create a Cloudflare OAuth client, then add its Client ID and Client Secret to your Scalekit connection.
-
Copy the redirect URI from Scalekit
-
In the Scalekit dashboard, go to AgentKit > Connections > Create Connection. Find Cloudflare and click Create.
-
Click Use your own credentials and copy the redirect URI. It looks like
https://<SCALEKIT_ENVIRONMENT_URL>/sso/v1/oauth/<CONNECTION_ID>/callback.
-
-
Create an OAuth client in Cloudflare
-
Sign in to the Cloudflare dashboard and go to Manage account > OAuth clients.
-
Click Create OAuth client.
-
Fill in the Configure OAuth client form:
- Client Name — for example,
Agent Auth - Response Type —
Code, Token - Grant type —
Authorization Code - Token Authentication Method —
None (PKCE) - Redirect (Callback) URLs — paste the redirect URI you copied from Scalekit, then press Return to add it
- Client Name — for example,
-
Click Next to continue to Select permission scopes.

-
-
Select permission scopes
Enable at least the scopes Scalekit requires:
Scope Required Zone Read ( zone.read)Yes DNS Read ( dns.read)Yes DNS Write ( dns.write)Only if your agent needs to manage DNS records Cache Purge ( cache.purge)Only if your agent needs to purge cached content Click Create to finish creating the OAuth client.
-
Copy your Client ID and Client Secret
- Cloudflare shows the Client ID and Client Secret once the client is created.
- Copy both values — the secret is shown only once.
-
Add credentials in Scalekit
- Return to the connection you created in Scalekit and enter:
- Client ID — from your Cloudflare OAuth client
- Client Secret — from your Cloudflare OAuth client
- Click Save.
- Return to the connection you created in Scalekit and enter:
-
-
Authorize and make your first call
Section titled “Authorize and make your first call”quickstart.ts import { ScalekitClient } from '@scalekit-sdk/node'import 'dotenv/config'const scalekit = new ScalekitClient(process.env.SCALEKIT_ENV_URL,process.env.SCALEKIT_CLIENT_ID,process.env.SCALEKIT_CLIENT_SECRET,)const actions = scalekit.actionsconst connector = 'cloudflare'const identifier = 'user_123'// Generate an authorization link for the userconst { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })console.log('Authorize Cloudflare:', link)process.stdout.write('Press Enter after authorizing...')await new Promise(r => process.stdin.once('data', r))// Make your first callconst result = await actions.executeTool({connector,identifier,toolName: 'cloudflare_account_list',toolInput: {},})console.log(result)quickstart.py import osfrom scalekit.client import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENV_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "cloudflare"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize Cloudflare:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="cloudflare_account_list",connection_name=connection_name,identifier=identifier,)print(result)
What you can do
Section titled “What you can do”Connect this agent connector to let your agent:
- Update zone setting, ruleset entrypoint, dns record — Change the value of a single zone setting, such as ssl, always_use_https, min_tls_version, security_level, or cache_level
- Get zone setting, zone, worker script — Retrieve the current value of a single zone setting, such as ssl, always_use_https, min_tls_version, security_level, or cache_level
- Cache zone purge — Purge cached content for a Cloudflare zone
- Create zone, worker route, page rule — Add a new domain (zone) to a Cloudflare account
- Dashboard zone analytics — Retrieve aggregate traffic analytics for a Cloudflare zone: requests, bandwidth, threats, and cache statistics over a time window
- Delete worker script, dns record, access application — Permanently delete a Cloudflare Worker script by name
Tool list
Section titled “Tool list”Use the exact tool names from the Tool list below when you call execute_tool. If you’re not sure which name to use, list the tools available for the current user first.
cloudflare_access_application_create#Create a new Zero Trust Access application to protect a domain behind Cloudflare Access authentication policies.5 params
Create a new Zero Trust Access application to protect a domain behind Cloudflare Access authentication policies.
account_idstringrequiredThe ID of the Cloudflare accountdomainstringrequiredThe domain (and optional path) this application protectsnamestringrequiredDisplay name of the applicationsession_durationstringoptionalHow long an authenticated session stays valid before re-authentication is requiredtypestringoptionalType of Access applicationcloudflare_access_application_delete#Permanently delete a Zero Trust Access application and its policies. The protected domain becomes unprotected by Access. This cannot be undone.2 params
Permanently delete a Zero Trust Access application and its policies. The protected domain becomes unprotected by Access. This cannot be undone.
account_idstringrequiredThe ID of the Cloudflare accountapp_idstringrequiredThe ID of the Access application to deletecloudflare_access_application_get#Retrieve details of a single Zero Trust Access application by ID. Use List Access Applications to find an application ID.2 params
Retrieve details of a single Zero Trust Access application by ID. Use List Access Applications to find an application ID.
account_idstringrequiredThe ID of the Cloudflare accountapp_idstringrequiredThe ID of the Access application to retrievecloudflare_access_application_list#List all Zero Trust Access applications configured in a Cloudflare account, with optional filtering by name or domain.5 params
List all Zero Trust Access applications configured in a Cloudflare account, with optional filtering by name or domain.
account_idstringrequiredThe ID of the Cloudflare accountdomainstringoptionalFilter applications by domainnamestringoptionalFilter applications by namepageintegeroptionalPage number of results to returnper_pageintegeroptionalNumber of results per pagecloudflare_account_list#List all Cloudflare accounts the current authenticated user has access to, with optional filtering by account name.4 params
List all Cloudflare accounts the current authenticated user has access to, with optional filtering by account name.
directionstringoptionalSort direction for resultsnamestringoptionalFilter accounts by name (partial match supported)pageintegeroptionalPage number of results to returnper_pageintegeroptionalNumber of results per pagecloudflare_dns_record_create#Create a new DNS record in a Cloudflare zone.7 params
Create a new DNS record in a Cloudflare zone.
contentstringrequiredDNS record content/valuenamestringrequiredDNS record name (the subdomain or root domain)typestringrequiredDNS record typezone_idstringrequiredThe unique identifier for the zone to create the record inpriorityintegeroptionalPriority for MX or SRV recordsproxiedbooleanoptionalWhether the record is proxied through Cloudflare (orange-clouded)ttlintegeroptionalTime to live in seconds. 1 means automatic.cloudflare_dns_record_delete#Permanently delete a DNS record from a Cloudflare zone. This cannot be undone.2 params
Permanently delete a DNS record from a Cloudflare zone. This cannot be undone.
dns_record_idstringrequiredThe unique identifier of the DNS record to deletezone_idstringrequiredThe unique identifier for the zone the record belongs tocloudflare_dns_record_get#Retrieve details of a single DNS record by ID. Use List DNS Records to find a record ID.2 params
Retrieve details of a single DNS record by ID. Use List DNS Records to find a record ID.
dns_record_idstringrequiredThe unique identifier of the DNS record to retrievezone_idstringrequiredThe unique identifier for the zone the record belongs tocloudflare_dns_record_list#List, search, sort, and filter DNS records for a Cloudflare zone. Supports filtering by record type, name, and content.9 params
List, search, sort, and filter DNS records for a Cloudflare zone. Supports filtering by record type, name, and content.
zone_idstringrequiredThe unique identifier for the zone to list DNS records fromcontentstringoptionalFilter DNS records by content/valuedirectionstringoptionalSort direction (asc or desc)matchstringoptionalWhether to match all or any filter conditionsnamestringoptionalFilter DNS records by nameorderstringoptionalField to order results bypageintegeroptionalPage number for pagination (default 1)per_pageintegeroptionalNumber of results per page (default 20, max 100)typestringoptionalFilter DNS records by typecloudflare_dns_record_update#Replace an existing DNS record's type, name, and content. This is a full update — provide all fields you want the record to have, not just the ones changing.8 params
Replace an existing DNS record's type, name, and content. This is a full update — provide all fields you want the record to have, not just the ones changing.
contentstringrequiredDNS record content/valuedns_record_idstringrequiredThe unique identifier of the DNS record to updatenamestringrequiredDNS record name (the subdomain or root domain)typestringrequiredDNS record typezone_idstringrequiredThe unique identifier for the zone the record belongs topriorityintegeroptionalPriority for MX or SRV recordsproxiedbooleanoptionalWhether the record is proxied through Cloudflare (orange-clouded)ttlintegeroptionalTime to live in seconds. 1 means automatic.cloudflare_firewall_rule_create#Create a firewall rule on a Cloudflare zone that takes an action (block, challenge, allow, log, etc.) on requests matching a filter expression.5 params
Create a firewall rule on a Cloudflare zone that takes an action (block, challenge, allow, log, etc.) on requests matching a filter expression.
actionstringrequiredAction to take when a request matches the expressionexpressionstringrequiredCloudflare filter expression that requests must match to trigger this rulezone_idstringrequiredThe unique identifier for the zone to create the rule indescriptionstringoptionalDescription of the firewall rulepausedbooleanoptionalWhether the rule is paused (inactive) on creationcloudflare_firewall_rule_list#List the firewall rules configured on a Cloudflare zone, including their filter expressions and actions.3 params
List the firewall rules configured on a Cloudflare zone, including their filter expressions and actions.
zone_idstringrequiredThe unique identifier for the zone to list firewall rules frompageintegeroptionalPage number for pagination (default 1)per_pageintegeroptionalNumber of results per page (default 20, max 100)cloudflare_load_balancer_create#Create a new Load Balancer on a Cloudflare zone, distributing traffic for a hostname across one or more origin pools.10 params
Create a new Load Balancer on a Cloudflare zone, distributing traffic for a hostname across one or more origin pools.
default_poolsarrayrequiredOrdered list of pool IDs ordinarily used to load balance trafficfallback_poolstringrequiredPool ID used when all default_pools are unhealthynamestringrequiredThe DNS hostname this load balancer will respond onzone_idstringrequiredThe unique identifier for the zone to create the load balancer indescriptionstringoptionalDescription of this load balancerenabledbooleanoptionalWhether the load balancer is enabledproxiedbooleanoptionalWhether the hostname should be proxied through Cloudflaresession_affinitystringoptionalSession affinity method used to bind a client to a originsteering_policystringoptionalHow traffic is steered across default_poolsttlintegeroptionalDNS TTL in seconds for this load balancer's hostnamecloudflare_load_balancer_list#List the Load Balancers configured on a Cloudflare zone.1 param
List the Load Balancers configured on a Cloudflare zone.
zone_idstringrequiredThe unique identifier for the zone to list load balancers fromcloudflare_page_rule_create#Create a page rule on a Cloudflare zone that applies one or more settings to requests matching a URL pattern.5 params
Create a page rule on a Cloudflare zone that applies one or more settings to requests matching a URL pattern.
actionsarrayrequiredJSON array of {id, value} action objects to apply, e.g. cache_level, forwarding_url, always_use_httpsurl_patternstringrequiredURL pattern that requests must match to trigger this rulezone_idstringrequiredThe unique identifier for the zone to create the page rule inpriorityintegeroptionalPriority order when multiple page rules match the same request. Higher numbers take precedence.statusstringoptionalWhether the page rule is active immediatelycloudflare_page_rule_list#List the page rules configured on a Cloudflare zone, including their URL targets, actions, and status.2 params
List the page rules configured on a Cloudflare zone, including their URL targets, actions, and status.
zone_idstringrequiredThe unique identifier for the zone to list page rules fromstatusstringoptionalFilter page rules by statuscloudflare_pages_project_list#List Cloudflare Pages projects in an account.1 param
List Cloudflare Pages projects in an account.
account_idstringrequiredThe Cloudflare account identifiercloudflare_ruleset_entrypoint_update#Deploy or update the active ruleset for a phase (e.g. http_request_firewall_custom for WAF custom rules) on a Cloudflare zone. This replaces the entire set of rules for that phase, so include every rule you want active, not just the ones you're changing.4 params
Deploy or update the active ruleset for a phase (e.g. http_request_firewall_custom for WAF custom rules) on a Cloudflare zone. This replaces the entire set of rules for that phase, so include every rule you want active, not just the ones you're changing.
phase_namestringrequiredThe ruleset phase to deploy torulesarrayrequiredArray of rule objects to make up this phase's rulesetzone_idstringrequiredThe unique identifier for the zone whose ruleset phase to updatedescriptionstringoptionalDescription for this rulesetcloudflare_user_get#Retrieve the profile details of the currently authenticated Cloudflare user, including name, email, and account memberships.0 params
Retrieve the profile details of the currently authenticated Cloudflare user, including name, email, and account memberships.
cloudflare_worker_route_create#Create a Worker route on a Cloudflare zone that dispatches matching requests to a Worker script. Use List Worker Scripts to find a script name first.3 params
Create a Worker route on a Cloudflare zone that dispatches matching requests to a Worker script. Use List Worker Scripts to find a script name first.
patternstringrequiredURL pattern that triggers this routezone_idstringrequiredThe unique identifier for the zone to create the route inscriptstringoptionalName of the Worker script to dispatch matching requests tocloudflare_worker_route_list#List the Worker routes configured on a Cloudflare zone, showing which URL patterns dispatch to which Worker script.1 param
List the Worker routes configured on a Cloudflare zone, showing which URL patterns dispatch to which Worker script.
zone_idstringrequiredThe unique identifier for the zone to list routes fromcloudflare_worker_script_delete#Permanently delete a Cloudflare Worker script by name. Any routes or triggers bound to it stop working. This cannot be undone.2 params
Permanently delete a Cloudflare Worker script by name. Any routes or triggers bound to it stop working. This cannot be undone.
account_idstringrequiredThe Cloudflare account identifierscript_namestringrequiredThe name of the Worker script to deletecloudflare_worker_script_get#Download the raw JavaScript source of a Cloudflare Worker script by name. Use List Worker Scripts to find a script name.2 params
Download the raw JavaScript source of a Cloudflare Worker script by name. Use List Worker Scripts to find a script name.
account_idstringrequiredThe Cloudflare account identifierscript_namestringrequiredThe name of the Worker script to retrievecloudflare_worker_script_list#Fetch a list of all uploaded Worker scripts in a Cloudflare account. Returns script names, creation dates, and modification timestamps.1 param
Fetch a list of all uploaded Worker scripts in a Cloudflare account. Returns script names, creation dates, and modification timestamps.
account_idstringrequiredThe Cloudflare account identifiercloudflare_zone_analytics_dashboard#Retrieve aggregate traffic analytics for a Cloudflare zone: requests, bandwidth, threats, and cache statistics over a time window.3 params
Retrieve aggregate traffic analytics for a Cloudflare zone: requests, bandwidth, threats, and cache statistics over a time window.
zone_idstringrequiredThe unique identifier for the zone to fetch analytics forsincestringoptionalStart of the analytics window (ISO 8601). Defaults to 6 hours ago.untilstringoptionalEnd of the analytics window (ISO 8601). Defaults to now.cloudflare_zone_create#Add a new domain (zone) to a Cloudflare account. After creation, update your domain's name servers to the ones Cloudflare returns to activate it.4 params
Add a new domain (zone) to a Cloudflare account. After creation, update your domain's name servers to the ones Cloudflare returns to activate it.
account_idstringrequiredThe Cloudflare account to create the zone undernamestringrequiredThe domain name to add as a zonejump_startbooleanoptionalAutomatically scan for existing DNS records when the zone is createdtypestringoptionalWhether Cloudflare hosts the full zone or only a partial (CNAME setup) zonecloudflare_zone_get#Retrieve details of a single Cloudflare zone by ID, including status, name servers, and plan information. Use List Zones to find a zone ID.1 param
Retrieve details of a single Cloudflare zone by ID, including status, name servers, and plan information. Use List Zones to find a zone ID.
zone_idstringrequiredThe unique identifier for the zone to retrievecloudflare_zone_list#List, search, sort, and filter all zones in the Cloudflare account. Returns zone details including status, name servers, and plan information.7 params
List, search, sort, and filter all zones in the Cloudflare account. Returns zone details including status, name servers, and plan information.
directionstringoptionalSort direction (asc or desc)matchstringoptionalWhether to match all or any filter conditionsnamestringoptionalFilter zones by domain name (exact match)orderstringoptionalField to order results bypageintegeroptionalPage number for pagination (default 1)per_pageintegeroptionalNumber of results per page (default 20, max 50)statusstringoptionalFilter zones by statuscloudflare_zone_purge_cache#Purge cached content for a Cloudflare zone. Purge everything, or scope the purge to specific file URLs, cache tags, or hostnames. Provide at most one of files, tags, or hosts when not purging everything.5 params
Purge cached content for a Cloudflare zone. Purge everything, or scope the purge to specific file URLs, cache tags, or hostnames. Provide at most one of files, tags, or hosts when not purging everything.
zone_idstringrequiredThe unique identifier for the zone whose cache to purgefilesarrayoptionalJSON array of exact file URLs to purge from cachehostsarrayoptionalJSON array of hostnames to purge all cached content forpurge_everythingbooleanoptionalPurge all cached content for the zonetagsarrayoptionalJSON array of Cache-Tag values to purgecloudflare_zone_setting_get#Retrieve the current value of a single zone setting, such as ssl, always_use_https, min_tls_version, security_level, or cache_level.2 params
Retrieve the current value of a single zone setting, such as ssl, always_use_https, min_tls_version, security_level, or cache_level.
setting_namestringrequiredThe name of the setting to retrievezone_idstringrequiredThe unique identifier for the zone whose setting to retrievecloudflare_zone_setting_update#Change the value of a single zone setting, such as ssl, always_use_https, min_tls_version, security_level, or cache_level. Use Get Zone Setting first to see the current value and accepted options.3 params
Change the value of a single zone setting, such as ssl, always_use_https, min_tls_version, security_level, or cache_level. Use Get Zone Setting first to see the current value and accepted options.
setting_namestringrequiredThe name of the setting to updatevaluestringrequiredThe new value for the setting. Most Cloudflare settings take a string such as 'on', 'off', 'strict', or 'full'.zone_idstringrequiredThe unique identifier for the zone whose setting to update