About MCP Lightsail Deployment Server
MCP Lightsail Deployment Server deploys GitHub projects to AWS Lightsail through MCP tools. It is for developers managing cloud deployments and also configures Cloudflare DNS, with live progress updates over SSE.
Key features
- 01Create Lightsail VMs and deploy projects
- 02Clone projects from GitHub
- 03Configure Cloudflare DNS automatically
- 04Redeploy projects and check status
- 05Track live progress over SSE
- 06Encrypt sensitive credentials at rest
Use cases
- 01Deploy a GitHub project to Lightsail
- 02Update an existing project and check deployment status
- 03Monitor deployment progress and investigate errors
MCP support
The MCP server provides tools to create VMs, deploy or redeploy projects, check status, list deployments, and delete VMs. Deployment progress is available in real time over SSE.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCP Lightsail Deployment Server
A Model Context Protocol (MCP) server for deploying projects to AWS Lightsail with automatic DNS configuration via Cloudflare and real-time progress tracking through Server-Sent Events (SSE).
Features
- 🚀 Automated VM Creation: Create AWS Lightsail instances with custom configurations
- 📦 GitHub Integration: Clone and deploy projects directly from GitHub repositories
- 🌐 DNS Management: Automatic Cloudflare DNS record creation and management
- 🔄 Redeployment: Pull latest code and restart services with a single command
- 📡 Real-time Updates: Server-Sent Events (SSE) for live deployment progress tracking
- 🔒 Security: Encrypted storage of sensitive credentials
- 🛠️ Docker Support: Automatic Docker Compose deployment
- 🌍 Caddy Integration: Automatic reverse proxy and SSL certificate management
Architecture
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ MCP Client │ │ MCP Server │ │ AWS Lightsail │
│ (LLM/App) │◄──►│ (This Server) │◄──►│ Instance │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
▼
┌─────────────────┐
│ Cloudflare │
│ DNS Records │
└─────────────────┘
Installation
-
Clone the repository:
git clone <repository-url> cd mcp-lightsail-server -
Install dependencies:
npm install -
Configure environment variables:
cp .env.example .env # Edit .env with your configuration -
Build the project:
npm run build -
Start the server:
npm start
Environment Variables
Create a .env file with the following variables:
# Server Configuration
PORT=3000
ENCRYPTION_KEY=your-32-character-encryption-key-here
# Optional: Default AWS Configuration (for 'og' account type)
OPENGIG_AWS_ACCESS_KEY_ID=your-aws-access-key
OPENGIG_AWS_SECRET_ACCESS_KEY=your-aws-secret-key
OPENGIG_AWS_REGION=us-east-1
OPENGIG_AVAILABILITY_ZONE=us-east-1a
OPENGIG_AWS_SSH_KEY=your-ssh-private-key
OPENGIG_CLOUDFLARE_ZONE_ID=your-cloudflare-zone-id
OPENGIG_CLOUDFLARE_API_TOKEN=your-cloudflare-api-token
MCP Tools
1. create_vm
Creates a new Lightsail VM and deploys a GitHub project.
Parameters:
awsAccessKey(string): AWS Access Key IDawsSecretKey(string): AWS Secret Access KeyawsRegion(string): AWS Region (e.g., us-east-1)availabilityZone(string): AWS Availability Zone (e.g., us-east-1a)awsSshKey(string): AWS SSH Private Key (PEM format)bundleId(string): Lightsail bundle ID (e.g., nano_2_0)blueprintId(string): Lightsail blueprint ID (e.g., ubuntu_20_04)githubRepoUrl(string): GitHub repository URLgithubPat(string): GitHub Personal Access TokencloudflareZoneId(string): Cloudflare Zone IDcloudflareApiToken(string): Cloudflare API TokenprojectName(string): Project name for the deploymentdomain(string, optional): Domain name (defaults to opengig.work)accountType(string): 'og' or 'custom'
Returns:
{
"sessionId": "uuid-session-id",
"message": "VM deployment started. Use the session ID to track progress via SSE."
}
2. redeploy_project
Redeploys an existing project by pulling the latest code.
Parameters:
sessionId(string): Session ID from the original deployment
3. get_vm_status
Gets the current status of a deployed VM.
Parameters:
sessionId(string): Session ID from the deployment
4. get_all_deployments
Lists all active deployments.
5. delete_vm
Deletes a VM and cleans up all associated resources.
Parameters:
sessionId(string): Session ID from the deployment
6. force_delete_vm
Force deletes a VM session (use when normal delete fails).
Parameters:
sessionId(string): Session ID from the deployment
Real-time Progress Tracking
Connect to the SSE endpoint to receive real-time updates:
const eventSource = new EventSource(`http://localhost:3000/sse/${sessionId}`);
eventSource.onmessage = function(event) {
const data = JSON.parse(event.data);
console.log('Event:', data);
switch(data.type) {
case 'progress':
console.log('Progress:', data.data.message);
break;
case 'log':
console.log('Log:', data.data);
break;
case 'error':
console.error('Error:', data.data.error);
break;
case 'complete':
console.log('Complete:', data.data);
break;
}
};
Event Types
progress: Deployment progress updateslog: Command execution logserror: Error messagescomplete: Deployment completionstatus: Current deployment status
API Endpoints
POST /mcp- MCP protocol endpointGET /mcp- MCP SSE notificationsDELETE /mcp- MCP session terminationGET /sse/:sessionId- Real-time deployment progressGET /health- Health check endpoint
Usage Example
// Using the MCP client
const result = await mcpClient.callTool('create_vm', {
awsAccessKey: 'AKIA...',
awsSecretKey: 'secret...',
awsRegion: 'us-east-1',
availabilityZone: 'us-east-1a',
awsSshKey: '-----BEGIN RSA PRIVATE KEY-----\n...',
bundleId: 'nano_2_0',
blueprintId: 'ubuntu_20_04',
githubRepoUrl: 'https://github.com/user/repo',
githubPat: 'ghp_...',
cloudflareZoneId: 'zone-id',
cloudflareApiToken: 'token',
projectName: 'my-app',
accountType: 'custom'
});
// Track progress
const sessionId = result.sessionId;
const eventSource = new EventSource(`http://localhost:3000/sse/${sessionId}`);
Deployment Process
- VM Creation: Creates a Lightsail instance with specified configuration
- Network Setup: Opens all ports for the instance
- SSH Connection: Connects to the instance via SSH
- Environment Setup: Installs Docker, Caddy, and other dependencies
- Repository Clone: Clones the GitHub repository
- Caddy Configuration: Sets up reverse proxy and SSL
- Application Deployment: Runs
docker compose up -d - DNS Configuration: Creates Cloudflare DNS A record
- Completion: Reports success with access URL
Security Considerations
- All sensitive data (AWS keys, SSH keys, GitHub tokens) are encrypted at rest
- Use environment variables for default configurations
- Implement proper access controls for the MCP server
- Regularly rotate API tokens and access keys
Troubleshooting
Common Issues
- SSH Connection Timeout: Ensure the SSH key is correct and the instance is fully initialized
- DNS Creation Failed: Verify Cloudflare API token has DNS edit permissions
- Docker Compose Errors: Check that the repository contains a valid
docker-compose.yml - Port Access Issues: Ensure Lightsail firewall rules allow necessary ports
Logs
Check deployment logs via the get_vm_status tool or SSE events for detailed error information.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
MIT License - see LICENSE file for details. const result = await mcpClient.callTool('create_vm', params); return result; } }, redeploy_project: { description: 'Redeploy an existing project', parameters: { type: 'object', properties: { sessionId: { type: 'string' } }, required: ['sessionId'] }, execute: async (params) => { const result = await mcpClient.callTool('redeploy_project', params); return result; } }, get_vm_status: { description: 'Get VM deployment status', parameters: { type: 'object', properties: { sessionId: { type: 'string' } }, required: ['sessionId'] }, execute: async (params) => { const result = await mcpClient.callTool('get_vm_status', params); return result; } } } });
### 4. Real-time Progress Tracking
```typescript
// After deployment starts, track progress
const sessionId = deploymentResult.sessionId;
// Set up SSE connection for real-time updates
const eventSource = new EventSource(`http://localhost:3000/sse/${sessionId}`);
eventSource.onmessage = (event) => {
const data = JSON.parse(event.data);
// Update your UI with deployment progress
switch(data.type) {
case 'progress':
console.log('Progress:', data.data.message);
break;
case 'complete':
console.log('Deployment complete:', data.data.url);
eventSource.close();
break;
case 'error':
console.error('Deployment error:', data.data.error);
eventSource.close();
break;
}
};
Usage Example
// Direct MCP client usage
const result = await mcpClient.callTool('create_vm', {
awsAccessKey: 'AKIA...',
awsSecretKey: 'secret...',
awsRegion: 'us-east-1',
availabilityZone: 'us-east-1a',
awsSshKey: '-----BEGIN RSA PRIVATE KEY-----\n...',
bundleId: 'nano_2_0',
blueprintId: 'ubuntu_20_04',
githubRepoUrl: 'https://github.com/user/repo',
githubPat: 'ghp_...',
cloudflareZoneId: 'zone-id',
cloudflareApiToken: 'token',
projectName: 'my-app',
accountType: 'custom'
});
// Track progress
const sessionId = result.sessionId;
const eventSource = new EventSource(`http://localhost:3000/sse/${sessionId}`);
Deployment Process
- VM Creation: Creates a Lightsail instance with specified configuration
- Network Setup: Opens all ports for the instance
- SSH Connection: Connects to the instance via SSH
- Environment Setup: Installs Docker, Caddy, and other dependencies
- Repository Clone: Clones the GitHub repository
- Caddy Configuration: Sets up reverse proxy and SSL
- Application Deployment: Runs
docker compose up -d - DNS Configuration: Creates Cloudflare DNS A record
- Completion: Reports success with access URL
Security Considerations
- All sensitive data (AWS keys, SSH keys, GitHub tokens) are encrypted at rest
- Use environment variables for default configurations
- Implement proper access controls for the MCP server
- Regularly rotate API tokens and access keys
Troubleshooting
Common Issues
- SSH Connection Timeout: Ensure the SSH key is correct and the instance is fully initialized
- DNS Creation Failed: Verify Cloudflare API token has DNS edit permissions
- Docker Compose Errors: Check that the repository contains a valid
docker-compose.yml - Port Access Issues: Ensure Lightsail firewall rules allow necessary ports
Logs
Check deployment logs via the get_vm_status tool or SSE events for detailed error information.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
MIT License - see LICENSE file for details.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.