Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Fly.io

Scalekit connector
Open markdown

The Fly.io connector lets your AI agent act in each user's Fly.io account. Each user connects their own Fly.io access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 54 tools.

Tools
54
What they doRead · write · destructive
24 · 22 · 824 read22 write8 destructive
Users sign in with

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 Fly.io connection

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

  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 = 'fly'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Fly.io:', 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: 'fly_get_current_token',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Fly.io credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • fly_check_placementsSimulate where Machines could be placed without creating any.Read-only

    Check Machine Placement

    Simulate where Machines could be placed without creating any. Returns each candidate region with its count and concurrency. Read-only despite using POST. Use before fly_create_machine to pick a region with capacity.

    Inputs

    org_slugstringrequired
    Slug of the Fly organization, or personal for your personal organization.
    countinteger
    Number of Machines to simulate. Defaults to 0, which returns the organization's limit per region.
    regionstring
    Region code, for example iad, ams or syd. Use fly_list_regions to see valid codes.
  • fly_get_appRetrieve one Fly app by name.Read-only

    Get App

    Retrieve one Fly app by name. Returns the app's id, name, status, network, machine count and organization. Use fly_list_apps to browse apps.

    Inputs

    app_namestringrequired
    Name of the Fly app, for example my-app. Use fly_list_apps to find app names.
  • fly_get_certificateRetrieve the certificate for one hostname on a Fly app.Read-only

    Get Certificate

    Retrieve the certificate for one hostname on a Fly app. Returns the hostname, status, DNS requirements, validation state and issued certificates. Use fly_list_certificates to browse.

    Inputs

    app_namestringrequired
    Name of the Fly app, for example my-app. Use fly_list_apps to find app names.
    hostnamestringrequired
    Hostname the certificate covers, for example www.example.com.
  • fly_get_current_tokenShow what the connected Fly API token can access.Read-only

    Get Current Token

    Show what the connected Fly API token can access. Returns each token's organization, org slug, permitted apps and any Machine restriction. Use this to find the org_slug other tools need.

    Inputs

    This tool takes no inputs.

  • fly_get_machineRetrieve one Machine in a Fly app.Read-only

    Get Machine

    Retrieve one Machine in a Fly app. Returns the Machine's id, name, state, region, config, image ref, events and checks. Use fly_list_machines to find Machine IDs.

    Inputs

    app_namestringrequired
    Name of the Fly app, for example my-app. Use fly_list_apps to find app names.
    machine_idstringrequired
    ID of the Machine, for example 148ed599e12589. Use fly_list_machines to find Machine IDs.
    include_leasesboolean
    When true, include the Machine's lease.
    versionstring
    26-character Machine version ID. When set, returns that version of the Machine instead of the current one.
  • fly_get_machine_leaseRetrieve the current lease on a Machine.Read-only

    Get Machine Lease

    Retrieve the current lease on a Machine. Returns the lease nonce, owner, description and expiry time. Use fly_create_machine_lease to take a lease.

    Inputs

    app_namestringrequired
    Name of the Fly app, for example my-app. Use fly_list_apps to find app names.
    machine_idstringrequired
    ID of the Machine, for example 148ed599e12589. Use fly_list_machines to find Machine IDs.
  • fly_get_machine_metadataRetrieve all metadata key-value pairs on a Machine.Read-only

    Get Machine Metadata

    Retrieve all metadata key-value pairs on a Machine. Returns an object mapping each metadata key to its string value. Use fly_get_machine_metadata_value for a single key.

    Inputs

    app_namestringrequired
    Name of the Fly app, for example my-app. Use fly_list_apps to find app names.
    machine_idstringrequired
    ID of the Machine, for example 148ed599e12589. Use fly_list_machines to find Machine IDs.
  • fly_get_machine_metadata_valueRetrieve the value of one metadata key on a Machine.Read-only

    Get Machine Metadata Value

    Retrieve the value of one metadata key on a Machine. Returns an object with the value. Use fly_get_machine_metadata to see all keys.

    Inputs

    app_namestringrequired
    Name of the Fly app, for example my-app. Use fly_list_apps to find app names.
    keystringrequired
    Metadata key to read, for example role.
    machine_idstringrequired
    ID of the Machine, for example 148ed599e12589. Use fly_list_machines to find Machine IDs.