fly-mcp

by brannn

347 downloads
Not rated
GitHub

About

MCP server for managing your Fly.io infrastructure

Details

Author
brannn
Downloads
347
Categories
Other, Infrastructure

- Fly.io API integration via MCP tools
- Security features: rate limiting, CORS, audit logging
- Real-time application status and scaling
- Configuration via YAML, env vars, or CLI flags
- Structured logging with audit trails
- List and manage Fly.io apps

Set environment variables FLY_MCP_FLY_API_TOKEN and FLY_MCP_FLY_ORGANIZATION, then build and run the server with make build and make run (or make dev for hot reload). For production, deploy on Fly.io using fly mcp launch with required secrets. The server exposes an HTTP endpoint on port 8080; tools are invoked via JSON-RPC requests to that endpoint.

fly-mcp

An open-source MCP (Model Context Protocol) server for Fly.io infrastructure management, enabling AI-driven DevOps workflows through natural language interactions.

πŸš€ Quick Start

Prerequisites

- Go 1.21 or later
- Fly.io account and API token
- Git

Local Development Setup

1. Clone the repository

   git clone https://github.com/brannn/fly-mcp.git
cd fly-mcp

2. Set up environment variables

   export FLY_MCP_FLY_API_TOKEN="your_fly_api_token_here"
export FLY_MCP_FLY_ORGANIZATION="your_fly_org_here"

3. Build and run

   make build
make run

Or for development with hot reload:

   make dev

Production Deployment on Fly.io

Deploy using Fly.io's MCP infrastructure:

fly mcp launch \
  "github.com/brannn/fly-mcp" \
  --claude --cursor --zed \
  --server fly-infrastructure \
  --secret FLY_API_TOKEN=fo1_your_token \
  --secret FLY_ORG=your-org-name

πŸ—οΈ Architecture

Project Structure

fly-mcp/
β”œβ”€β”€ cmd/fly-mcp/              # Main application entry point
β”œβ”€β”€ pkg/
β”‚   β”œβ”€β”€ mcp/                  # MCP protocol implementation
β”‚   β”œβ”€β”€ fly/                  # Fly.io API client (coming soon)
β”‚   β”œβ”€β”€ auth/                 # Authentication (coming soon)
β”‚   β”œβ”€β”€ tools/                # MCP tool implementations (coming soon)
β”‚   └── config/               # Configuration management
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ server/               # HTTP server implementation
β”‚   β”œβ”€β”€ security/             # Security utilities (coming soon)
β”‚   └── logger/               # Structured logging
β”œβ”€β”€ config.local.yaml         # Local development configuration
β”œβ”€β”€ config.production.yaml    # Production configuration
└── Makefile                  # Build automation

Configuration

The application supports flexible configuration through:

- YAML files: config.local.yaml for development, config.production.yaml for production
- Environment variables: All config values can be overridden with FLY_MCP_ prefixed env vars
- Command line flags: --config and --log-level flags

Environment Variables

| Variable | Description | Required |
|----------|-------------|----------|
| FLY_MCP_FLY_API_TOKEN | Fly.io API token | Yes |
| FLY_MCP_FLY_ORGANIZATION | Fly.io organization name | Yes |
| FLY_MCP_ENVIRONMENT | Environment (local/production) | No |
| FLY_MCP_LOGGING_LEVEL | Log level (debug/info/warn/error) | No |

πŸ› οΈ Development

Available Make Targets

make build          # Build the binary
make build-all      # Build for all platforms
make test           # Run tests
make test-coverage  # Run tests with coverage
make lint           # Run linters
make fmt            # Format code
make clean          # Clean build artifacts
make dev            # Run in development mode
make validate-config # Validate configuration
make docker-build   # Build Docker image
make help           # Show all available targets

Running Tests

```bash

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.