vcenter-mcp
About
MCP server for VMware vCenter / ESXi VM lifecycle. Built on pyVmomi
Details
- Author
- michaelrice
- Categories
- Cloud Service, Infrastructure
Jump to
Setup
Install vcenter-mcp in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/michaelrice/vcenter-mcp
Follow the installation instructions in the repository README, then restart your MCP client.
AModel Context Protocolserver that exposes VMware vCenter / ESXi VM lifecycle tools toClaude Codeand other MCP clients. Built onpyVmomi.
- List VMs on a vCenter datacenter (grouped by host) or on a standalone ESXi host
- Create a VM (network-boot first; thin or thick provisioning; nested-virt option for ESXi targets)
- Power VMs on and off
- Delete VMs (powers off first if running, then destroys from disk)
Lookups accept either a display name or a moref ID (e.g.vm-42) — the moref path skips the inventory scan and is faster on large environments.
- Python 3.10 or newer
- A vCenter Server or standalone ESXi host you can reach over the network
- A vSphere account with the privileges needed for whatever you plan to do (read-only is enough forlist_vms; create / delete need the corresponding VM and resource-pool privileges)
Install into a project-local virtualenv. Using a venv keepsvcenter-mcpand its dependencies (notablypyVmomi) isolated from your system Python.
python3 -m venv .venv .venv/bin/pip install --upgrade pip .venv/bin/pip install -e .
.venv/bin/pip install -e ".[dev]"
Throughout this README, commands use.venv/bin/.... You can insteadsource .venv/bin/activateonce per shell and drop the prefix — same result.
Run the interactive setup using the venv's Python:
- A target name (e.g.lab-vcenter) — used to refer to this target later
- Host or IP of the vCenter / ESXi
- Username and password
- Target type:vcenteroresxi
- (vCenter only) Datacenter and cluster names
- Datastore name
- One or more network profiles, each a name plus one or more portgroup names
The setup writes a config to~/.config/vcenter-mcp/config.json(mode0600). Re-run it any time to add another target or update an existing one.
{ "default_target": "lab-vcenter", "targets": { "lab-vcenter": { "host": "vcenter.lab.example.com", "user": "admin@vsphere.local", "password": "...", "type": "vcenter", "datacenter": "Lab DC", "cluster": "Lab Cluster", "datastore": "datastore1", "networks": { "standard": ["VM Network"], "secure-boot": ["pg-secure-1", "pg-secure-2"] }, "default_network": "standard" } }, "templates": { "esxi": { "cpu": 4, "ram_mb": 16384, "disk_gb": 100, "disk_provisioning": "thin", "guest_id": "vmkernel7Guest", "vhv": true }, "ubuntu": { "cpu": 2, "ram_mb": 4096, "disk_gb": 40, "disk_provisioning": "thin", "guest_id": "ubuntu64Guest", "vhv": false }, "rhel": { "cpu": 2, "ram_mb": 4096, "disk_gb": 40, "disk_provisioning": "thin", "guest_id": "rhel9_64Guest", "vhv": false } } }
A network profile is a list of portgroups; the first entry becomes the boot NIC. To add your own VM types, add entries totemplates—vm_typestrings passed tocreate_vmare matched against this dict.
Register the MCP server using the venv's Python by absolute path. Claude Code launches the server in a fresh shell that doesnotinherit your activated venv, so the absolute path is required — pointing at a barepythonhere will fail to importvcenter_mcp.
VCENTER_MCP_DIR="$(pwd)" # run this from the repo root, after install claude mcp add --scope user vcenter -- "$VCENTER_MCP_DIR/.venv/bin/python" -m vcenter_mcp
Or just inline the absolute path you want:
claude mcp add --scope user vcenter -- /absolute/path/to/vcenter-mcp/.venv/bin/python -m vcenter_mcp
Read tools (list_vms) are safe to allow without prompting. Add it topermissions.allowin~/.claude/settings.json:
{ "permissions": { "allow": [ "mcp__vcenter__list_vms" ] } }
The destructive tools (create_vm,power_on_vm,power_off_vm,delete_vm) are intentionally not in the default allow-list — Claude will prompt you per call.
List VMs on a target using a single PropertyCollector RPC (no per-VM round trips).
On error, returns a single dict with anerrorkey.
Power on a VM by display name or moref ID (e.g.vm-42).
Hard power off a VM by display name or moref ID (e.g.vm-42).
Permanently delete a VM (powers off first if running, then destroys from disk).
vcenter-mcpmaintains a sharedServiceInstanceperuser@hostcombination for the lifetime of the MCP server process rather than opening and closing a new connection on every tool call.
- Createdon the first tool call for a given target
- Reusedon all subsequent calls with the same credentials
- Reconnectedautomatically if a liveness ping (currentSession) detects the session has expired
- Disconnectedexplicitly when a session is replaced (ping failure) or invalidated (NotAuthenticated/SecurityErrorfault)
Concurrent tool calls are safe — athreading.Lockguards all cache reads and writes.
vcenter-mcpconnects with an unverified SSL context, which is the same default thatgovcand most pyVmomi sample code use because lab vCenters very commonly have self-signed certs. If your target uses a properly-signed certificate and you'd prefer real verification, swap_ssl_context()insrc/vcenter_mcp/client.py.
python3 -m venv .venv .venv/bin/pip install -e ".[dev]" .venv/bin/pytest
Tests run on Python 3.10, 3.11, and 3.12 in CI (see.github/workflows/test.yml).
Get prescriptive CDK advice, explain CDK Nag rules, check suppressions, generate Bedrock Agent schemas, and discover AWS Solutions Constructs patterns.
Core AWS MCP server providing prompt understanding and server management capabilities.
Manage and interact with Microsoft Azure services.
An MCP Server that connects to Gemini Cloud Assist APIs, enabling you to manage and troubleshoot your Google Cloud environment using natural language.
The IBM Instana MCP server enables seamless interaction with the IBM Instana observability platform, allowing you to access real-time observability data directly within your development workflow.
Query and interact with kubernetes environments monitored by Metoro
Exposes cloud provider control and data planes to agents as self-describing, queryable and mutable data sources using SQL, minimising tool surface and token usage.
An MCP server for 1Panel, a modern Linux server operation and maintenance panel.
Automate Akamai resource actions using a conversational AI client. Requires Akamai API credentials.
Enables AI assistants to interact with Azure Kubernetes Service (AKS) clusters.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.

