# Fly.io MCP for AI Agents AI Agent Connect

> Fly.io lets you manage edge infrastructure directly through your AI agent. You can monitor apps, scale compute horizontally, handle persistent volumes, and run remote commands on MicroVMs without jumping between the CLI and the dashboard. It turns complex container orchestration into a simple conversation.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_auAQnLXTRcIdjtuSWpWKn2jSCsP8BhIQLnmdG02e/ai-agent-connect
- **Tags:** edge-computing, container-orchestration, docker, serverless, infrastructure-as-code

## Description

This Fly.io MCP puts your entire edge computing environment into your AI client's reach. Managing edge infrastructure usually means jumping between terminal tabs and dashboard views to hunt for machine IDs or check if a volume is actually attached. This setup lets you ditch that cycle by letting your agent handle the heavy lifting. You can audit app health, provision new machines for traffic spikes, or run diagnostic shell commands on live instances without ever opening a new tab. It's about getting the job done without the friction of manual navigation. You'll find this in the Vinkius catalog alongside other heavy-hitting infrastructure tools. It gives you a direct line to the hypervisor API, so you can interact with your MicroVMs securely and quickly. You can manage your global footprint and handle stateful data without the usual headache of manual configuration.

## Tools

### create_machine
Use create_machine to provision a new highly available Edge Machine. This allows you to scale horizontal capacity without waiting on full deployments.

### delete_machine
Use delete_machine to remove a Fly Machine forever. This stops all compute billing and clears any ephemeral disk state.

### exec_machine
Use exec_machine to run shell or Bash commands inside an active Fly Machine. This is perfect for running internal database migrations or diagnostics.

### get_app
Use get_app to retrieve the operational baseline for a Fly App. It identifies the primary region, Wireguard ranges, and anycast IPs.

### get_machine
Use get_machine to fetch the current execution state of a specific machine. It returns the docker image digest and mapped volume points.

### list_apps
Use list_apps to view all Fly.io App spaces within your organization. This helps you see your entire fleet at a glance.

### list_machines
Use list_machines to see all individual MicroVM endpoints within a specific app. It shows unique IDs and placement regions.

### list_volumes
Use list_volumes to identify all persistent hardware NVMe Volumes attached to an app. This is key for managing stateful data.

### start_machine
Use start_machine to boot a previously stopped or suspended Fly Machine. This is useful for recovering paused batch processors.

### stop_machine
Use stop_machine to gracefully halt a running internal machine. This reduces latency bills during idle cycles.

## Prompt Examples

**Prompt:** 
```
List all machines in my 'web-api' app
```

**Response:** 
```
Retrieving machines... I found 2 machines in 'web-api':

| Machine ID | Region | Status |
| :--- | :--- | :--- |
| 918572b0 | iad | started |
| e28654c1 | gru | stopped |

Would you like me to start the stopped machine?
```

**Prompt:** 
```
Run 'ls -la /app' on machine '918572b0' in app 'web-api'
```

**Response:** 
```
Command execution initiated! I've sent the request to machine 918572b0.

**Result:**
```
total 42
drwxr-xr-x  2 root  root  4096 Oct 24 12:00 .
drwxr-xr-x  2 root  root  4096 Oct 24 12:00 ..
-rw-r--r--  1 root  root  1200 Oct 24 12:00 config.json
-rw-r--r--  1 root  root  5000 Oct 24 12:00 main.py
```
No SSH required, I used the Fly Machine API synchronously.
```

**Prompt:** 
```
Show me the persistent volumes for 'web-api'
```

**Response:** 
```
Retrieving volumes... I found 1 persistent NVMe volume:

* **Name:** data_vol
* **Size:** 10GB
* **Region:** iad
* **Status:** Attached to machine 918572b0

It is currently residing on physical hardware node xyz.
```

## Capabilities

### Provision new edge machines
Add new highly available MicroVMs to your app to scale capacity instantly.

### Run shell commands on active machines
Inject and execute bash commands directly into live instances for migrations or diagnostics.

### Audit live app health
Check the real-time execution status and docker digests of your running apps.

### Manage persistent NVMe volumes
View and manage hardware volumes attached to your apps for stateful data.

### Scale horizontal compute
Dynamically expand your compute footprint across multiple global regions.

### View app spaces and regions
List your organization's apps and see their specific anycast IP assignments.

## Use Cases

### Running migrations without SSH keys
A developer needs to run a one-off database migration on a production node. They ask the agent to use exec_machine to run the script directly.

### Scaling during a traffic spike
An SRE notices a traffic spike and needs to scale horizontally. They tell the agent to use create_machine to add more capacity to the web-api app.

### Troubleshooting a stuck app
A DevOps engineer is troubleshooting a hanging app. They ask the agent to use get_machine to check the docker digest and current execution state.

### Verifying regional distribution
A cloud architect needs to verify regional distribution. They use list_machines to see where every MicroVM is currently placed.

## Benefits

- Scale capacity faster by using create_machine to provision new edge nodes without waiting on full platform deployments.
- Save on costs by using stop_machine to halt idle compute during low-traffic periods.
- Run diagnostics faster using exec_machine to inject commands directly into the hypervisor without needing SSH keys.
- Audit your infrastructure with get_app to see anycast IP assignments and Wireguard ranges in one go.
- Manage stateful data easily with list_volumes to see which NVMe volumes are attached to your apps.

## How It Works

The bottom line is you get a conversational interface for your entire edge computing fleet.

1. Subscribe to the Connector and grab your Fly.io API token from your dashboard.
2. Input the token into your AI client's configuration.
3. Ask your agent to list apps, check machine status, or run commands.

## Frequently Asked Questions

**What can I do with the Fly.io MCP?**
You can manage your entire edge computing fleet through natural conversation. This includes scaling machines, running remote commands, and auditing your app's health and storage.

**Can I use the Fly.io MCP to run database migrations?**
Yes, you can use the agent to run shell or Bash commands on active machines. This makes it easy to trigger migrations without manually logging into every node.

**Does the Fly.io MCP support persistent storage?**
Yes, the Connector allows you to list and manage persistent hardware NVMe volumes. This helps you keep track of stateful data for your PostgreSQL or SQLite databases.

**How do I connect Fly.io to my AI agent?**
Just subscribe to the Connector and provide your Fly.io API token. Once connected, your agent can interact with your machines, apps, and volumes directly.

**Can the Fly.io MCP help me scale my app during high traffic?**
Absolutely. You can ask your agent to provision new edge machines instantly. This allows you to scale your horizontal capacity quickly when traffic spikes occur.

**Is it safer to use the Fly.io MCP than standard SSH?**
Yes, because it interacts directly with the hypervisor API. You can run commands and get diagnostics without the overhead or security surface of managing SSH keys.

**Can I see my anycast IP assignments with Fly.io MCP?**
Yes, the Connector can retrieve the operational baseline of your apps. This includes identifying your anycast IP assignments and internal Wireguard network ranges.

**Can my agent scale up my application by creating more machines in a specific region?**
Yes. Use the 'create_machine' tool. You can specify the region (e.g., 'iad', 'gru') and the Docker image. The agent will command the Fly.io orchestrator to boot up new VM instances instantly to handle increased demand.

**How do I run a database migration or shell command on a live machine via chat?**
Use the 'exec_machine' tool. Provide the machine ID and the command. The agent bypasses SSH entirely by interacting directly with the hypervisor API to run your binary alongside the running container securely.

**Can I check the health and image version of my active machines through the agent?**
Absolutely. The 'get_machine' tool retrieves exhaustive runtime states, including container health, current executing status (started/stopped), and the precise docker image digest actively booted into memory.