Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to the Cloudflare MCP server

Vendor MCP
Open markdown

The Cloudflare MCP connector routes your AI agent's tool calls to Cloudflare's own MCP server through Scalekit. Each user signs in to Cloudflare once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 3 tools.

Tools
3
What they doRead · write · destructive
2 · 1 · 02 read1 write0 destructive
Users sign in with
OAuth app
Scalekit's or your own

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    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. Create the Cloudflare MCP connection

    In AgentKit > Connections, create a Cloudflare MCP connection. The name you give it is the connection_name your code passes. See Configure connections.

    Scalekit credentials are available for Cloudflare, so you don't need to register an OAuth app.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'cloudfaremcp'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Cloudflare MCP:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'cloudfaremcp_docs',
    toolInput: { query: 'YOUR_QUERY' },
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • cloudfaremcp_docsSearch the Cloudflare documentation.Read-only

    Cloudflare Docs Search

    Search the Cloudflare documentation. Use this tool to answer any question about Cloudflare products or features, including Workers, Pages, R2, Images, Stream, D1, Durable Objects, KV, Workflows, Hyperdrive, Queues, AI Search, Workers AI, Vectorize, AI Gateway, Browser Rendering, Zero Trust, Access, Tunnel, Gateway, Browser Isolation, WARP, DDOS, Magic Transit, Magic WAN, CDN, Cache, DNS, Zaraz, Argo, Rulesets, Terraform, Account and Billing. Results are returned as semantically similar chunks to the query.

    Inputs

    querystringrequired
    Cloudflare documentation search query.
  • cloudfaremcp_executeExecute JavaScript code against the Cloudflare API using the `cloudflare.request()` helper.Write

    Cloudflare Execute

    Execute JavaScript code against the Cloudflare API using the `cloudflare.request()` helper. Use the search tool first to discover the right endpoint path and schema.

    Inputs

    codestringrequired
    JavaScript async arrow function that calls `cloudflare.request()` to interact with the Cloudflare API.
    account_idstring
    Your Cloudflare account ID. Auto-selected if you only have one account.