ESXi MCP Server
Provides tools for administering VMware ESXi or vCenter through pyVmomi, enabling virtual machine operations such as listing VMs, powering on/off, creating, cloning, deleting, and retrieving performance statistics.
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., "@ESXi MCP Serverlist all virtual machines on the ESXi host"
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.
ESXi MCP Server
An MCP server for administering VMware ESXi or vCenter through pyVmomi. It includes native SSE transport and a gateway that adapts it to Streamable HTTP, enabling integration with current MCP clients such as APX.
Status: connectivity, MCP initialization, and tool discovery have been verified. Real administrative operations against ESXi (
tools/call) still require an explicitly authorized test on a non-critical VM.
Architecture
MCP client (APX)
└─ POST /mcp :8009 Streamable HTTP
└─ Supergateway
└─ GET /sse :8080 and POST /sse/messages SSE
└─ ESXi MCP Server (Python/Uvicorn/pyVmomi)
└─ VMware SOAP HTTPS :443
└─ ESXi or vCenterComponent | Endpoint / purpose |
Streamable HTTP client |
|
Legacy SSE |
|
SSE messages |
|
Hypervisor |
|
Related MCP server: vmware-esxi-mcp
Implemented fixes and improvements
Added Supergateway to Docker Compose to translate native SSE into Streamable HTTP at
/mcp(port8009). This fixes theNot Foundresponse from clients that sendPOST /mcp.Fixed the SSE flow:
connect_sse()now manages the ASGI response without a manualhttp.response.start. The endpoint correctly returns the event containing the message URL and a per-connectionsession_id.Replaced the nonexistent
handle_post()call withhandle_post_message(scope, receive, send), which is compatible with the installed MCP SDK.Registered the MCP
tools/listandtools/callhandlers withadd_request_handler, replacing decorators unsupported by the installed version.Fixed permissions for the
./logsbind mount so the non-privileged container user can write logs.Added a health check, resource limits, a dedicated bridge network, and
no-new-privilegesto both Compose services.Real configuration, secrets, logs, and backups are excluded from Git. Use
config.yaml.sampleas the starting point.
Available MCP tools
The tools/list discovery response contains the following eight tools:
Tool | Purpose |
| MCP authentication when an API key is configured |
| List virtual machines |
| Power on a VM |
| Force power off a VM |
| Create a VM |
| Clone a VM |
| Permanently delete a VM |
| Retrieve performance statistics |
Registering a tool and seeing it in tools/list does not prove that execution against ESXi has been validated. In particular, powerOff is a forced shutdown.
Requirements
Docker Engine and Docker Compose v2 (recommended), or Python 3.7+ for local execution.
HTTPS network access to ESXi/vCenter.
A VMware account with the minimum required privileges.
Python dependencies: pyvmomi, pyyaml, uvicorn, and mcp.
Deployment with Docker Compose
Create a local configuration from the sample:
cp config.yaml.sample config.yaml
mkdir -p logsEdit
config.yamland/or set the required environment variables. Do not add credentials to the repository:
vcenter_host: "<esxi-or-vcenter>"
vcenter_user: "<username>"
vcenter_password: "<password>"
datacenter: "" # Optional; empty for standalone ESXi
cluster: "" # Optional; empty for standalone ESXi
datastore: "<datastore>"
network: "VM Network"
insecure: false # Set true only if you understand the risk
api_key: "<optional-api-key>"
log_file: "./logs/vmware_mcp.log"
log_level: "INFO"Set the log directory ownership to the container UID/GID, then start the services:
MCP_UID=$(docker compose run --rm --no-deps --entrypoint id esxi-mcp-server -u)
MCP_GID=$(docker compose run --rm --no-deps --entrypoint id esxi-mcp-server -g)
sudo chown -R "${MCP_UID}:${MCP_GID}" ./logs
sudo chmod -R u+rwX ./logs
docker compose up -d --buildConfigure the MCP client with the Streamable HTTP URL:
http://<docker-host>:8009/mcpThe direct SSE endpoint (http://<docker-host>:8008/sse) remains available for clients that still use the legacy SSE transport.
Validation and troubleshooting
After changing server.py:
python3 -m py_compile server.py
docker compose up -d --build --force-recreate esxi-mcp-server
docker compose restart esxi-mcp-gatewayOperational commands:
docker compose ps
docker compose logs --tail=100 esxi-mcp-server
docker compose logs --tail=100 esxi-mcp-gatewayThe following checks were completed during the fixes:
GET /ssereturns theendpointevent with/sse/messages?session_id=....Supergateway translates initialization traffic from
/mcpto SSE.initializeandtools/listreturn successful JSON-RPC responses.tools/listdiscovers the eight tools listed above.
Security and operations
Do not commit
config.yaml,.envfiles, logs, tokens, or passwords.Prefer valid TLS (
insecure: false), API key authentication, network segmentation, and a firewall that exposes the service only to authorized clients.Pin MCP SDK and Supergateway versions before production use.
Apply least privilege in ESXi/vCenter. VMware remains responsible for authentication, authorization, and effective hypervisor privileges.
Before enabling operational administration, inspect gateway logs during an authorized
tools/calland test with a non-critical VM.
License
MIT License.
Credits
VMware pyVmomi
MCP Protocol
Supergateway
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP for Celesto cloud computers: create, exec, ports, start/stop/delete.
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Query, browse, and automate OmegaAI workspaces from any MCP client. Streamable HTTP with OAuth 2.0.
An authenticated remote MCP server for user-owned devices and one-shot capability invocation.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceA VMware ESXi/vCenter management server based on MCP (Machine Control Protocol), providing simple REST API interfaces for virtual machine management.64MIT
- AlicenseNot gradedqualityCmaintenanceEnables management of VMware ESXi hosts and virtual machines through standardized MCP interfaces, supporting host operations, VM lifecycle, resource monitoring, and security management.18MIT
- FlicenseAqualityDmaintenanceConnects MCP-compatible coding agents to VMware vCenter to query information about virtual machines, hosts, clusters, datastores, datacenters, and networks.9-
- FlicenseNot gradedqualityDmaintenanceEnables managing VMware Workstation Pro VMs via MCP tools, including power operations, snapshots, guest processes, and network configuration through the vmrest, vmrun, and vmcli interfaces.-