CloudStack MCP Server
The CloudStack MCP Server is a high-performance integration tool for comprehensive management of Apache CloudStack infrastructure via the MCP protocol. With this server, you can:
Virtual Machine Management: Deploy, start, stop, reboot, destroy, scale, migrate VMs, reset passwords, and change service offerings
Infrastructure Discovery: List zones, templates, networks, hosts, clusters, storage pools, system VMs, and service offerings
Storage Management: Create, attach, detach, resize volumes, and manage snapshots
Networking: Manage networks, public IPs, firewall rules, load balancers, NAT, and configure network settings
Monitoring & Analytics: Retrieve VM metrics, system events, alerts, capacity information, and track asynchronous jobs
Account & User Management: Administer accounts, users, domains, and view usage records
Security & Compliance: Manage SSH key pairs, security groups, and create security rules
Provides comprehensive tools for managing CloudStack infrastructure, including VM lifecycle management (deploy, start, stop, reboot, destroy), storage management, networking operations, infrastructure discovery, and system administration capabilities.
Enables configuration of the server through environment variables stored in .env files, supporting essential CloudStack API credentials and connection settings.
Runs as a Node.js application, requiring Node.js 18+ for deployment and operation of the CloudStack MCP server.
Built with TypeScript for type safety, providing comprehensive interfaces for CloudStack API integration with proper error handling.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CloudStack MCP Server list all running virtual machines in zone 1"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CloudStack MCP Server
A high-performance MCP (Model Context Protocol) server for Apache CloudStack API integration. This server provides comprehensive tools for managing CloudStack infrastructure through the MCP protocol, enabling seamless integration with AI assistants and automation tools.
Features
🔧 Complete VM Lifecycle Management: Deploy, start, stop, reboot, and destroy virtual machines
🏗️ Infrastructure Discovery: List zones, templates, and service offerings
🔐 Secure Authentication: HMAC-SHA1 signed requests with CloudStack API credentials
⚡ High Performance: Efficient TypeScript implementation with proper error handling
🛡️ Type Safety: Full TypeScript support with comprehensive interfaces
📊 Rich Information: Detailed VM metadata including CPU, memory, network, and status
🖥️ Command Line Interface: Direct CLI access for interactive CloudStack management
🤖 MCP Integration: Seamless integration with AI assistants via MCP protocol
Related MCP server: Crawl4AI MCP Server
Quick Start
Installation
Clone and install dependencies:
git clone <repository-url> cd cloudstack-mcp-server npm installConfigure environment variables: Create a
.envfile in the project root:CLOUDSTACK_API_URL=https://your-cloudstack-server/client/api CLOUDSTACK_API_KEY=your-api-key CLOUDSTACK_SECRET_KEY=your-secret-key CLOUDSTACK_TIMEOUT=30000Build the project:
npm run buildRun the server:
# Development mode (MCP server) npm run dev # Production mode (MCP server) npm start # CLI mode npm run cli -- --help
MCP Client Integration
Add to your MCP client configuration (e.g., Claude Desktop):
{
"mcpServers": {
"cloudstack": {
"command": "node",
"args": ["/path/to/cloudstack-mcp-server/build/index.js"],
"env": {
"CLOUDSTACK_API_URL": "https://your-cloudstack-server/client/api",
"CLOUDSTACK_API_KEY": "your-api-key",
"CLOUDSTACK_SECRET_KEY": "your-secret-key"
}
}
}
}Command Line Interface
For direct command-line access, use the built-in CLI:
# Install globally (optional)
npm link
# Use the CLI
cloudstack-cli list-vms --state Running
cloudstack-cli deploy-vm --service-offering-id 1 --template-id 2 --zone-id 3
cloudstack-cli get-vm --id 12345-67890-abcdef
# See all available commands
cloudstack-cli --helpFor detailed CLI documentation, see CLI.md.
Available Tools (45 Tools)
🖥️ Virtual Machine Management (7 Tools)
Tool | Description | Parameters |
| List VMs with optional filtering |
|
| Get detailed VM information |
|
| Start a stopped virtual machine |
|
| Stop a running virtual machine |
|
| Reboot a virtual machine |
|
| Destroy a VM with proper workflow (handles all states) |
|
| Deploy a new VM (auto-selects network for Advanced zones) |
|
⚙️ VM Advanced Operations (4 Tools)
Tool | Description | Parameters |
| Scale (resize) a virtual machine |
|
| Migrate VM to another host |
|
| Reset password for a virtual machine |
|
| Change service offering for a VM |
|
💾 Storage Management (7 Tools)
Tool | Description | Parameters |
| List storage volumes |
|
| Create a new storage volume |
|
| Attach a volume to a virtual machine |
|
| Detach a volume from a virtual machine |
|
| Resize a storage volume |
|
| Create a snapshot of a volume |
|
| List volume snapshots |
|
🌐 Networking (7 Tools)
Tool | Description | Parameters |
| List networks |
|
| Create a new network |
|
| List public IP addresses |
|
| Acquire a new public IP address |
|
| Enable static NAT for an IP address |
|
| Create a firewall rule |
|
| List load balancer rules |
|
📊 Monitoring & Analytics (5 Tools)
Tool | Description | Parameters |
| Get virtual machine performance metrics |
|
| List CloudStack events |
|
| List system alerts |
|
| List system capacity information |
|
| List asynchronous jobs |
|
👥 Account & User Management (4 Tools)
Tool | Description | Parameters |
| List CloudStack accounts |
|
| List users |
|
| List CloudStack domains |
|
| List resource usage records |
|
🏗️ Infrastructure Discovery (2 Tools)
Tool | Description | Parameters |
| List all available zones |
|
| List available VM templates |
|
🔧 System Administration (5 Tools)
Tool | Description | Parameters |
| List physical hosts |
|
| List host clusters |
|
| List storage pools |
|
| List system virtual machines |
|
| List service offerings |
|
🔐 Security & Compliance (4 Tools)
Tool | Description | Parameters |
| List SSH key pairs |
|
| Create a new SSH key pair |
|
| List security groups |
|
| Create a security group ingress rule |
|
Example Usage
List Virtual Machines
{
"tool": "list_virtual_machines",
"arguments": {
"state": "Running",
"zoneid": "1746ef10-8fa6-40c1-9c82-c3956bf75db8"
}
}Deploy New Virtual Machine
{
"tool": "deploy_virtual_machine",
"arguments": {
"serviceofferingid": "c6f99499-7f59-4138-9427-a09db13af2bc",
"templateid": "7d4a7bb5-2409-4c8f-8537-6bbdc8a4e5c1",
"zoneid": "1746ef10-8fa6-40c1-9c82-c3956bf75db8",
"name": "my-new-vm",
"displayname": "My New VM"
}
}Project Structure
├── src/
│ ├── index.ts # MCP server entry point
│ ├── server.ts # Main MCP server implementation
│ ├── cli.ts # Command-line interface
│ └── cloudstack-client.ts # CloudStack API client
├── build/ # Compiled JavaScript output
├── CLI.md # CLI documentation
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
└── .env # Environment variables (not in repo)Architecture Overview
src/index.ts: MCP server entry point that loads environment variables and starts the serversrc/server.ts: Comprehensive MCP server implementation with 45+ tool handlers, error management, and CloudStack integrationsrc/cli.ts: Command-line interface for direct CloudStack management via JSON-RPC communication with the MCP serversrc/cloudstack-client.ts: Robust CloudStack API client with HMAC-SHA1 authentication, type-safe interfaces, and comprehensive error handling
Configuration
Required Environment Variables
Variable | Description | Example |
| CloudStack API endpoint |
|
| CloudStack API key |
|
| CloudStack secret key |
|
Optional Environment Variables
Variable | Description | Default |
| Request timeout (milliseconds) |
|
Development
Build Commands
# Build TypeScript to JavaScript
npm run build
# Run MCP server in development mode with hot reload
npm run dev
# Run CLI in development mode
npm run dev:cli -- list-vms --help
# Run compiled MCP server
npm start
# Run compiled CLI
npm run cli -- list-vms --help
# Type checking only
npx tsc --noEmitCode Quality
TypeScript: Full type safety with strict mode enabled
Error Handling: Comprehensive error handling with MCP error types
Async/Await: Modern async patterns throughout
Modular Design: Clean separation of concerns
Security
HMAC-SHA1 Signing: All API requests are cryptographically signed
No Credential Storage: Credentials read from environment variables only
Request Validation: Input validation on all tool parameters
Error Sanitization: Sensitive information filtered from error messages
Compatibility
CloudStack: Compatible with CloudStack 4.11+
Node.js: Requires Node.js 18+
MCP Protocol: Implements MCP SDK 0.5.0+
TypeScript: Built with TypeScript 5.0+
License
MIT - See LICENSE file for details
Available Tools
45 toolsassociate_ip_addressC
Acquire a new public IP address
Inputs: networkid, vpcid, zoneid.
attach_volumeC
Attach volume to virtual machine
Inputs: id (required), virtualmachineid (required), deviceid.
change_service_offering_virtual_machineC
Change service offering for virtual machine
Inputs: id (required), serviceofferingid (required).
create_firewall_ruleC
Create a firewall rule
Inputs: ipaddressid (required), protocol (required), cidrlist, endport, +1 more.
create_networkC
Create a new network
Inputs: displaytext (required), name (required), networkofferingid (required), zoneid (required), +2 more.
create_security_group_ruleC
Create a security group ingress rule
Inputs: protocol (required), securitygroupid (required), cidrlist, endport, +2 more.
create_snapshotC
Create a snapshot of a volume
Inputs: volumeid (required), name.
create_ssh_key_pairC
Create a new SSH key pair
Inputs: name (required), publickey.
create_volumeC
Create a new volume
Inputs: diskofferingid (required), name (required), zoneid (required), size.
deploy_virtual_machineC
Deploy a new virtual machine
Inputs: serviceofferingid (required), templateid (required), zoneid (required), displayname, +5 more.
destroy_virtual_machineA
Destroy a virtual machine using proper workflow: stop → destroy → expunge. Handles VMs in any state including Error. (DESTRUCTIVE - cannot be undone)
Inputs: id (required), expunge.
detach_volumeC
Detach volume from virtual machine
Inputs: id (required).
enable_static_natC
Enable static NAT for an IP to a VM
Inputs: ipaddressid (required), virtualmachineid (required), vmguestip.
get_virtual_machineB
Get details of a specific virtual machine
Inputs: id (required).
list_accountsC
List accounts
Inputs: accounttype, domainid, state.
list_alertsC
List system alerts
Inputs: type.
list_async_jobsC
List asynchronous jobs
Inputs: jobstatus, keyword.
list_capacityC
List system capacity information
Inputs: type, zoneid.
list_clustersC
List clusters
Inputs: hypervisor, zoneid.
list_domainsC
List domains
Inputs: level, name.
list_eventsC
List system events
Inputs: enddate, level, startdate, type.
list_hostsD
List hosts
Inputs: hypervisor, state, type, zoneid.
list_load_balancer_rulesC
List load balancer rules
Inputs: publicipid, zoneid.
list_networksC
List networks
Inputs: isdefault, type, zoneid.
list_public_ip_addressesC
List public IP addresses
Inputs: allocatedonly, isstaticnat, zoneid.
list_security_groupsC
List security groups
Inputs: securitygroupname, virtualmachineid.
list_service_offeringsC
List service offerings (compute plans)
Inputs: domainid, issystem.
list_snapshotsC
List volume snapshots
Inputs: intervaltype, volumeid.
list_ssh_key_pairsC
List SSH key pairs
Inputs: fingerprint, name.
list_storage_poolsC
List storage pools
Inputs: clusterid, zoneid.
list_system_vmsC
List system VMs (console proxy, secondary storage)
Inputs: state, systemvmtype, zoneid.
list_templatesC
List templates
Inputs: templatefilter (required), hypervisor, zoneid.
list_usage_recordsC
List usage records for billing
Inputs: enddate (required), startdate (required), type.
list_usersC
List users
Inputs: account, domainid, state.
list_virtual_machine_metricsC
List virtual machine performance metrics
Inputs: id, zoneid.
list_virtual_machinesC
List virtual machines in CloudStack
Inputs: keyword, state, zoneid.
list_volumesC
List storage volumes
Inputs: type, virtualmachineid, zoneid.
list_zonesC
List availability zones
Inputs: available.
migrate_virtual_machineC
Migrate virtual machine to another host
Inputs: virtualmachineid (required), hostid.
reboot_virtual_machineC
Reboot a virtual machine
Inputs: id (required).
reset_password_virtual_machineC
Reset password for virtual machine
Inputs: id (required).
resize_volumeC
Resize a volume
Inputs: id (required), size (required), shrinkok.
scale_virtual_machineC
Scale virtual machine (change service offering)
Inputs: id (required), serviceofferingid (required).
start_virtual_machineC
Start a virtual machine
Inputs: id (required).
stop_virtual_machineC
Stop a virtual machine
Inputs: id (required), forced.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 45 tools
Most tools map cleanly to distinct resources and actions, but scale_virtual_machine and change_service_offering_virtual_machine overlap heavily, describing the same operation in two ways. This is the main source of confusion.
The naming convention is predominantly verb_noun in snake_case, with many list_* operations. However, there are informal deviations like associate_ip_address, enable_static_nat, and the duplicate pair scale_virtual_machine vs change_service_offering_virtual_machine.
At 45 tools, the surface is very large and includes many list-only operations that could be consolidated or omitted. The breadth feels more like a full API dump than a curated MCP interface.
The surface covers many read operations but has notable gaps: no delete for volumes, snapshots, SSH key pairs, firewall rules, or networks, and no update methods for most resources. This leaves lifecycle workflows incomplete.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Hosted MCP server connecting AI assistants to 9,000+ apps and 40,000+ actions via Zapier.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceA Model Context Protocol server that enables AI assistants to interact with Coolify instances through natural language, allowing management of servers, applications, databases, and deployments.2,360 npm623MIT
- AlicenseNot gradedqualityDmaintenanceHigh-performance server enabling AI assistants to access web scraping, crawling, and deep research capabilities through Model Context Protocol.30MIT
- AlicenseNot gradedqualityDmaintenanceA high-performance Model Context Protocol (MCP) server designed for large language models, enabling real-time communication between AI models and applications with support for session management and intelligent tool registration.2MIT
- AlicenseNot gradedqualityDmaintenanceA powerful Model Context Protocol server that enables AI assistants to manage Coolify infrastructure through natural language, supporting application deployment, database management, resource monitoring, and DevOps automation.19MIT