Fly.io
Connect Claude, ChatGPT or Cursor to Fly.io via MCP. Manage apps, Machines, volumes, secrets, IPs, and certificates with an org or deploy token.
Example questions
Try asking your AI client
-
Which Fly apps are in my personal org right now?
-
Did the web Machine in ams finish starting after last night?
-
Summarize Machines that are stopped or failing checks.
-
Write a draft create_machine plan for nginx in ams - do not create it.
-
Which volumes and certificates look unused or expired?
Overview
Connect Fly.io so AI clients can manage apps, Machines, volumes, secrets, IP assignments, and certificates through the Fly.io Machines API.
stackgate.ai stores your access token encrypted and calls https://api.machines.dev/v1 on your behalf. Tool results are returned to your AI client for that request.
Prerequisites
Getting credentials
- Create a scoped token with
fly tokens create. Prefer an org token, a readonly token, or an app deploy token. See fly tokens create. - Copy the token as shown (often prefixed with
FlyV1). Do not usefly auth token. - In stackgate.ai, open My Integrations → Fly.io, paste the token, and click Connect & enable.
- Optionally choose a default organization and app from the dropdowns, or skip.
Treat the token like a password. Revoke or rotate it with flyctl if it is exposed.
After connect, use Edit tool access to keep the hub on Read-only if the token can write.
Using with AI clients
- Dedicated endpoint:
POST /mcp/fly-iowith a Sanctum bearer token - Private gateway: one config for all integrations - use
fly-io__*namespaced tools
See Documentation for HTTP authentication and private gateway setup.
Suggested workflow
get_current_token- confirm the token and its scope.list_regions- pick a region code before create tools.list_apps/get_app- find app names.org_slugdefaults to the saved org orpersonal.list_machines/get_machine- inspect state, region, image, and checks.start_machine/stop_machine/suspend_machine/restart_machine/wait_machine- lifecycle.create_machine- requires a container image. Confirm beforeexec_machine.list_volumes/create_volume- volumes are host-local; create the volume before the Machine that mounts it.list_secrets/set_secret- never print secret values unless the user asks.list_ip_assignments/assign_ipand certificate tools - public routing and TLS.list_postgres_clusters/get_postgres_cluster- inspect managed Postgres. This server does not create or rotate clusters.
Troubleshooting
- 422 integration not configured - paste a Fly.io access token in My Integrations.
- 401 Unauthorized - create a new org, readonly, or app deploy token with
fly tokens createand update My Integrations. Do not paste afly auth token. - 403 Forbidden - the token may be read-only, app-scoped to a different app, or missing permission. Hub Read/Write tool access is separate from Fly token scope.
- Missing org or app - set defaults on the Fly.io defaults page, or pass
org_slug/app_nameon the tool call. - 429 Too many requests - Fly limits Machine actions to about 1 request per second. Do not poll
wait_machinein a tight loop. - Destructive actions -
delete_app,delete_machine,delete_volume,remove_ip,delete_secret, andexec_machinecan cause outages. Confirm intent before approving Write access.
Available tools
-
get_current_token
Get metadata for the connected Fly.io access token.
-
list_regions
List Fly.io platform regions available for Machines and volumes.
-
list_apps
List Fly apps in an organization.
-
get_app
Get details for a Fly app, including organization slug and status.
-
create_app
Create a Fly app. App names must be unique. Machines belong to an app.
-
delete_app
Delete a Fly app. Stop Machines first, or set force to stop and delete immediately. This cannot be undone.
-
list_machines
List Machines for a Fly app. Optionally filter by region or include deleted Machines.
-
get_machine
Get a Fly Machine, including config, state, region, and image.
-
create_machine
Create a Fly Machine from a container image. Optional guest size defaults to shared 1 CPU and 256 MB. This can fail on capacity; retry or pick another region.
-
start_machine
Start a stopped or suspended Fly Machine.
-
stop_machine
Stop a Fly Machine without destroying it. Optional signal (default SIGINT) and timeout before SIGKILL.
-
suspend_machine
Suspend a Fly Machine and snapshot memory. The next start tries to resume from the snapshot.
-
restart_machine
Restart a Fly Machine.
-
wait_machine
Wait until a Machine reaches a state. Default state is started. Do not poll this in a tight loop.
-
delete_machine
Permanently delete a Fly Machine. This cannot be undone.
-
exec_machine
Run a command on a Fly Machine. Confirm before executing. Prefer a read-only command unless the user asked to change state.
-
list_machine_events
List recent events for a Fly Machine.
-
list_machine_processes
List processes running on a Fly Machine.
-
cordon_machine
Stop routing public requests to a Fly Machine (useful for blue-green deploys).
-
uncordon_machine
Resume routing public requests to a previously cordoned Fly Machine.
-
list_org_machines
List Machines across all apps in an organization.
-
list_volumes
List volumes for a Fly app.
-
get_volume
Get a Fly volume by ID.
-
create_volume
Create a Fly volume in a region. Volumes are host-local; create the volume before the Machine that will mount it.
-
extend_volume
Increase a Fly volume size. size_gb is the new total size, not the increment.
-
delete_volume
Destroy a Fly volume. Detach or destroy Machines using it first. This cannot be undone.
-
list_org_volumes
List volumes across all apps in an organization.
-
list_secrets
List secret names for a Fly app. Metadata only - do not echo values unless the user asks.
-
get_secret
Get a Fly app secret by name. Avoid echoing the value unless the user asked for it.
-
set_secret
Create or update a Fly app secret. Existing Machines must be updated or restarted to pick up new secrets.
-
delete_secret
Delete a Fly app secret.
-
list_ip_assignments
List IP addresses assigned to a Fly app.
-
assign_ip
Assign an IP address to a Fly app so it can receive public traffic.
-
remove_ip
Remove an IP assignment from a Fly app.
-
list_certificates
List TLS certificates for a Fly app.
-
get_certificate
Get TLS certificate details for a hostname on a Fly app.
-
request_acme_certificate
Request an ACME certificate for a hostname on a Fly app.
-
check_certificate
Check DNS and re-validate a Fly app certificate.
-
delete_certificate
Remove a TLS certificate from a Fly app.
-
list_postgres_clusters
List Fly Postgres clusters visible to the connected token.
-
get_postgres_cluster
Get a Fly Postgres cluster by ID.
MCP endpoint:
https://stackgate.ai/mcp/fly-io
(HTTP) or via the
private gateway.