VergeOS MCP Server
A Model Context Protocol (MCP) server for interacting with VergeOS virtualization platform. This enables AI assistants like Claude, Windsurf/Cascade, and other MCP-compatible clients to manage VMs, networks, tenants, and monitor your VergeOS cluster through natural language.
Architecture Overview
This project provides two deployment options:
When to Use Each Option
Option | Use Case |
Local (stdio) | AI client runs on the same machine that can reach VergeOS |
Remote (HTTP) | AI client is remote (e.g., laptop) and VergeOS is on a private network |
Features
MCP Tools
VM Power Control
Tool | Description |
| List all virtual machines (filter by running/name) |
| Get detailed VM information by ID |
| Get VM running status and power state |
| Power on a VM |
| Gracefully power off with optional wait and auto-force |
| Force power off (hard shutdown) |
| Reset/reboot a VM |
VM Configuration
Tool | Description |
| Change CPU cores and/or RAM (handles running VMs) |
| Add a new disk drive to a VM |
| Expand an existing disk (increase only) |
| Get VM network interfaces |
| Get VM disk drives with sizes |
Network Management
Tool | Description |
| List all virtual networks |
| Get network details |
| Power on/off, reset, apply rules |
Tenant Management
Tool | Description |
| List all tenants |
| Get tenant details |
| Power on/off, reset tenants |
Cluster & Node Management
Tool | Description |
| List cluster nodes |
| Get node statistics |
| Get cluster health status |
| Get storage tier statistics |
Storage & Monitoring
Tool | Description |
| List storage volumes |
| Get system logs (filter by level/object type) |
| Get active alarms |
Smart Features
Graceful shutdown with wait:
power_off_vmcan wait for VM to shut down and auto-force if timeout expiresRunning VM handling:
modify_vmdetects running VMs and can auto-shutdown to apply CPU/RAM changesLog filtering: Filter logs by level (
error,warning,audit) or object type (vm,node,vnet)
MCP Resources
vergeos://cluster/status- Cluster status overviewvergeos://vms/list- All virtual machinesvergeos://networks/list- All virtual networksvergeos://alarms/active- Active system alarms
Option 1: Local Installation (stdio)
Use this if your AI client runs on a machine that can directly reach your VergeOS instance.
Installation
Configuration
Create a .env file:
Or use an API token (recommended):
Claude Desktop Configuration
Add to ~/.config/claude/claude_desktop_config.json:
Windsurf Configuration
Add to ~/.codeium/windsurf/mcp_config.json:
Option 2: Remote Installation (Kubernetes + Local Proxy)
Use this if your AI client (e.g., Windsurf on your laptop) cannot directly reach VergeOS, but you have a Kubernetes cluster that can.
Architecture
Step 1: Deploy to Kubernetes
This creates:
Namespace:
vergeos-mcpDeployment running the HTTP MCP server
Service exposing port 3002
IngressRoute for external access (Traefik)
Step 2: Configure DNS
Add a DNS record pointing to your Traefik ingress:
Step 3: Test the Server
Step 4: Install Local Proxy (on your laptop)
Since Windsurf only supports stdio-based MCP servers, you need a local proxy:
Step 5: Configure Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
Restart Windsurf to load the new MCP server.
REST API Reference
The HTTP server also exposes a REST API for direct access:
Endpoint | Method | Description |
| GET | Health check |
| GET | List available MCP tools |
| POST | Execute an MCP tool |
| GET | List all VMs |
| GET | Get VM details |
| POST | VM action (poweron/poweroff/reset) |
| GET | List networks |
| GET | List tenants |
| GET | List nodes |
| GET | Cluster status |
| GET | Active alarms |
| GET | System logs |
MCP Protocol Endpoints
Endpoint | Method | Description |
| GET | Server-Sent Events connection |
| POST | MCP JSON-RPC messages |
Example Interactions
Once connected, you can ask your AI assistant:
"List all VMs in VergeOS"
"Power off the VM named 'test-vm'"
"Show me the cluster status"
"What alarms are active?"
"List all virtual networks"
"Get details for VM ID 34"
"How many nodes are in the cluster?"
"Show me the last 20 log entries"
VergeOS API Notes
Authentication
VergeOS uses cookie-based authentication:
POST to
/api/sys/tokenswith Basic AuthResponse contains token in
$keyfieldUse token as cookie:
Cookie: token=<value>
API Quirks
VMs with
is_snapshot: trueare templates, not running VMs/machine_nics?machine=<ID>may return NICs from other machines; always filter by machine IDUse
fields=mostfor detailed responses, but be aware of large payloads
Security Considerations
SSL verification is disabled for self-signed certificates (common in homelabs)
Store credentials in environment variables or Kubernetes secrets
Use API tokens instead of username/password when possible
The HTTP server should be behind TLS (handled by Traefik/Ingress)
Consider network policies to restrict access to the MCP server
Troubleshooting
Connection Issues
Token Expiration
Tokens may expire. The server automatically fetches new tokens using username/password if configured.
Kubernetes Logs
Local Proxy Issues
File Structure
License
MIT