This MCP server provides a management interface for VMware ESXi and vCenter environments through a simple REST API, enabling virtual machine lifecycle management and performance monitoring with real-time communication capabilities.
To run the ESXi MCP Server, you'll need:
Install all required packages using pip:
pip install pyvmomi pyyaml uvicorn mcp-core
Create a config.yaml
file with your VMware environment details:
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
Start the MCP server by running:
python server.py -c config.yaml
All privileged operations require authentication using your API key:
POST /sse/messages
Authorization: Bearer your-api-key
To create a new virtual machine:
{
"name": "vm-name",
"cpu": 2,
"memory": 4096,
"datastore": "datastore-name",
"network": "network-name"
}
To clone an existing VM or template:
{
"template_name": "source-vm",
"new_name": "new-vm-name"
}
To remove a virtual machine:
{
"name": "vm-name"
}
To perform power operations (on/off):
{
"name": "vm-name"
}
To retrieve performance statistics for a specific VM:
GET vmstats://{vm_name}
This provides real-time data on CPU, memory, storage, and network usage.
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 |
Instead of a configuration file, you can use environment variables:
For secure production deployments:
For development and testing:
insecure: true
to skip SSL verificationDEBUG
)To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "esxi-mcp-server" '{"command":"python","args":["server.py","-c","config.yaml"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"esxi-mcp-server": {
"command": "python",
"args": [
"server.py",
"-c",
"config.yaml"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"esxi-mcp-server": {
"command": "python",
"args": [
"server.py",
"-c",
"config.yaml"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect