Skip to content
Scalekit Docs
Talk to an EngineerDashboard

Cloudflare connector

OAuth 2.0Developer ToolsMonitoringAutomation

Cloudflare is a cloud platform providing DNS management, CDN, security, and networking services. This connector enables automated management of zones, DNS...

Cloudflare connector

  1. Terminal window
    npm install @scalekit-sdk/node

    Full SDK reference: Node.js | Python

  2. Add your Scalekit credentials to your .env file. 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>
  3. 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.

    1. 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.

    2. 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 TypeCode, Token
        • Grant typeAuthorization Code
        • Token Authentication MethodNone (PKCE)
        • Redirect (Callback) URLs — paste the redirect URI you copied from Scalekit, then press Return to add it
      • Click Next to continue to Select permission scopes.

        Cloudflare Create OAuth client form showing Client Name, Response Type, Grant type, Token Authentication Method, and Redirect URLs fields

    3. Select permission scopes

      Enable at least the scopes Scalekit requires:

      ScopeRequired
      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.

    4. 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.
    5. 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.
  4. 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.actions
    const connector = 'cloudflare'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { 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 call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'cloudflare_account_list',
    toolInput: {},
    })
    console.log(result)

Connect this agent connector to let your agent:

  • List access application, account, dns record — List all Zero Trust Access applications configured in a Cloudflare account, with optional filtering by name or domain
  • Get user — Retrieve the profile details of the currently authenticated Cloudflare user, including name, email, and account memberships

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_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.

NameTypeRequiredDescription
account_idstringrequiredThe ID of the Cloudflare account
domainstringoptionalFilter applications by domain
namestringoptionalFilter applications by name
pageintegeroptionalPage number of results to return
per_pageintegeroptionalNumber of results per page
cloudflare_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.

NameTypeRequiredDescription
directionstringoptionalSort direction for results
namestringoptionalFilter accounts by name (partial match supported)
pageintegeroptionalPage number of results to return
per_pageintegeroptionalNumber of results per page
cloudflare_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.

NameTypeRequiredDescription
zone_idstringrequiredThe unique identifier for the zone to list DNS records from
contentstringoptionalFilter DNS records by content/value
directionstringoptionalSort direction (asc or desc)
matchstringoptionalWhether to match all or any filter conditions
namestringoptionalFilter DNS records by name
orderstringoptionalField to order results by
pageintegeroptionalPage number for pagination (default 1)
per_pageintegeroptionalNumber of results per page (default 20, max 100)
typestringoptionalFilter DNS records by type
cloudflare_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_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.

NameTypeRequiredDescription
account_idstringrequiredThe Cloudflare account identifier
cloudflare_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.

NameTypeRequiredDescription
directionstringoptionalSort direction (asc or desc)
matchstringoptionalWhether to match all or any filter conditions
namestringoptionalFilter zones by domain name (exact match)
orderstringoptionalField to order results by
pageintegeroptionalPage number for pagination (default 1)
per_pageintegeroptionalNumber of results per page (default 20, max 50)
statusstringoptionalFilter zones by status