list_vmsLABSCO SUMMARY
Built for the lab vCenter, with the lab's assumptions.
The design choices all point at the same environment: named targets you switch between, templates for the VM shapes you keep rebuilding, and network profiles where the first portgroup becomes the boot NIC. Two things to know before you point it at production — it connects with an unverified SSL context, the same default govc uses, and the four state-changing tools are deliberately left out of the suggested allow-list so your client prompts on each call.
What it is
An MCP server built on pyVmomi that exposes VMware VM lifecycle operations against either a vCenter Server or a standalone ESXi host. Targets are named and stored in a config file, so a request says which lab or cluster it means rather than carrying credentials in every call. Lookups accept a display name or a moref ID such as vm-42; the moref path skips the inventory scan and is faster on large environments.
What you get
- Every VM on a target listed in one PropertyCollector call, each with power state, guest OS identifier, vCPU count, memory, committed storage, primary IP, NICs with MAC and guest IPs, and virtual disks with capacity and datastore path —
list_vms - A new VM that network-boots first, built from a named template in your config (
esxi,ubuntu,rhel) with per-call overrides for CPU, memory, disk size and thin or thick provisioning —create_vm - A VM powered on, or hard powered off, addressed by display name or moref ID —
power_on_vm,power_off_vm - A VM destroyed from disk, powered off first if it was running —
delete_vm
Requirements
A vSphere account with privileges for what you plan to do — read-only is enough for listing, create and delete need the matching VM and resource-pool privileges. Python 3.10 or newer. The package is vcenter-mcp (version 0.1.0), installed into a project-local virtualenv with pip install -e .; register it with the venv's Python by absolute path, since the client launches the server in a fresh shell that does not inherit an activated venv. An interactive setup command writes host, credentials, datacenter, datastore and network profiles to ~/.config/vcenter-mcp/config.json at mode 0600.
Setup effort
Build from source — git clone https://github.com/michaelrice/vcenter-mcp.git
USE CASES
Taking stock of a cluster without opening vCenter
List the VMs on a datacenter and read power state, sizing and disk usage in one pass, grouped by host.
Standing up a nested ESXi host to test against
Create from the esxi template, which carries the nested-virtualisation option, then power it on and let it PXE boot.
Tearing down yesterday's test VMs
Find the ones you built by name, then delete them — running VMs are powered off first rather than refusing.
Working fast in a large inventory
Pass the moref ID from a previous listing instead of a display name, which skips the inventory scan on power and delete calls.
5 tools
Listed in project docs. Your client may show a different list.
create_vmpower_on_vmpower_off_vmdelete_vmBEFORE YOU INSTALL
What to know first
Tools you get
5 tools named in the project's documentation.
Requires
- Python 3.10 or newer
- A vCenter Server or standalone ESXi host you can reach over the network
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
git clone https://github.com/michaelrice/vcenter-mcp.git
cd vcenter-mcp
python3 -m venv .venv
.venv/bin/pip install --upgrade pip
.venv/bin/pip install -e .
.venv/bin/python -m vcenter_mcp setupMCP Clients
Claude Code
Register the venv's Python by absolute path — Claude Code starts the server in a fresh shell that does not inherit an activated venv. <YOUR_PATH_TO_VCENTER_MCP> is the full path of your clone:
claude mcp add --scope user vcenter -- <YOUR_PATH_TO_VCENTER_MCP>/.venv/bin/python -m vcenter_mcpOptional: to let list_vms run without a prompt, add "mcp__vcenter__list_vms" to permissions.allow in ~/.claude/settings.json. The four state-changing tools are deliberately left out so Claude asks on each call.