A VMware ESXi/vCenter management server based on MCP (Model Control Protocol), providing simple REST API interfaces for virtual machine management.
A VMware ESXi/vCenter management server based on MCP (Model Control Protocol), providing simple REST API interfaces for virtual machine management.
pip install pyvmomi pyyaml uvicorn mcp-core
config.yaml
:vcenter_host: "your-vcenter-ip"
vcenter_user: "[email protected]"
vcenter_password: "your-password"
datacenter: "your-datacenter" # Optional
cluster: "your-cluster" # Optional
datastore: "your-datastore" # Optional
network: "VM Network" # Optional
insecure: true # Skip SSL certificate verification
api_key: "your-api-key" # API access key
log_file: "./logs/vmware_mcp.log" # Log file path
log_level: "INFO" # Log level
python server.py -c config.yaml
All privileged operations require authentication first:
POST /sse/messages
Authorization: Bearer your-api-key
{
"name": "vm-name",
"cpu": 2,
"memory": 4096,
"datastore": "datastore-name",
"network": "network-name"
}
{
"template_name": "source-vm",
"new_name": "new-vm-name"
}
{
"name": "vm-name"
}
{
"name": "vm-name"
}
Get VM performance data:
GET vmstats://{vm_name}
Parameter | Description | Required | Default |
---|---|---|---|
vcenter_host | vCenter/ESXi server address | Yes | - |
vcenter_user | Login username | Yes | - |
vcenter_password | Login password | Yes | - |
datacenter | Datacenter name | No | Auto-select first |
cluster | Cluster name | No | Auto-select first |
datastore | Storage name | No | Auto-select largest available |
network | Network name | No | VM Network |
insecure | Skip SSL verification | No | false |
api_key | API access key | No | - |
log_file | Log file path | No | Console output |
log_level | Log level | No | INFO |
All configuration items support environment variable settings, following these naming rules:
Production Environment:
Testing Environment:
MIT License
Issues and Pull Requests are welcome!
Bright8192