Labsco
MCP SERVER

Vcenter MCP

by michaelrice

VM lifecycle on vCenter or a standalone ESXi host — list what exists, create from a named template, power on and off, destroy.

Cloud Resources & Infrastructure as Code
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` (0.1.0 in pyproject), 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

One command plus a key — uvx vcenter-mcp, then supply credentials