Deploy to Fly.io¶
Deploy MCP Anywhere to Fly.io for a production-ready, cloud-hosted instance with automatic SSL certificates and global availability.
Why Fly.io?¶
- Global edge deployment
- Automatic SSL certificates
- Built-in persistent storage
- Simple deployment process
- Free tier available
Prerequisites¶
- Fly.io account (sign up free)
- MCP Anywhere repository cloned locally
- Docker running locally
Installation¶
1. Install Fly CLI¶
2. Authenticate¶
Deployment¶
1. Initialize Your App¶
When prompted:
- Choose an app name (e.g.,
my-mcp-anywhere
) - Select a region close to you
- Don't create PostgreSQL or Redis databases
- Yes to create the app
2. Configure Environment Variables¶
Set required secrets:
# Generate secure keys
SECRET_KEY=$(python -c "import secrets; print(secrets.token_urlsafe(32))")
# Set secrets
fly secrets set SECRET_KEY="$SECRET_KEY"
fly secrets set ANTHROPIC_API_KEY="your-anthropic-api-key-here"
3. Create Persistent Storage¶
MCP Anywhere needs persistent storage for data:
4. Deploy¶
The deployment will:
- Build the Docker image
- Push to Fly's registry
- Deploy to your selected region
- Start the application
5. Verify Deployment¶
Your MCP Anywhere instance is now live at https://your-app-name.fly.dev
Monitoring¶
View Logs¶
Metrics¶
Updating¶
To deploy updates:
Troubleshooting¶
App Won't Start¶
# Check logs for errors
fly logs -n 200
# Common issues:
# - Missing environment variables
# - Docker build failures
# - Port binding issues
Reset Data¶
If you need to reset your instance:
# SSH into instance
fly ssh console
# Run reset command
/app/venv/bin/python -m mcp_anywhere reset --confirm