Read-Only vSphere MCP Server
This server provides read-only access to VMware vCenter inventory and configuration data — it cannot create, modify, delete, clone, power, or move anything.
Available Capabilities
List Virtual Machines (
vsphere_list_vms): Retrieve all visible VMs with optional filters by VM IDs, names, folders, datacenters, hosts, clusters, resource pools, and power states (POWERED_ON,POWERED_OFF,SUSPENDED).Get VM Details (
vsphere_get_vm): Fetch detailed information for a single virtual machine by its vSphere VM ID (e.g.,vm-42).Get VM Summary (
vsphere_get_vm_summary): Retrieve aVirtualMachinesummary property via VI/JSON for a specific VM ID.Query Managed Object Properties (
vsphere_query_properties): Read one allowlisted VI/JSON managed-object property by specifying the object type, object ID, and property path.List ESXi Hosts (
vsphere_list_hosts): Retrieve all visible ESXi hosts.List Clusters (
vsphere_list_clusters): Retrieve all visible vCenter clusters.List Datastores (
vsphere_list_datastores): Retrieve all visible datastores.List Datacenters (
vsphere_list_datacenters): Retrieve all visible datacenters.List Networks (
vsphere_list_networks): Retrieve all visible networks.
All tools are read-only, idempotent, and non-destructive, and results are scoped to what the configured vCenter account has permission to see.
Read-only integration with VMware vCenter, allowing to query information about virtual machines, hosts, clusters, datastores, datacenters, and networks.
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., "@Read-Only vSphere MCP Server list all virtual machines in my datacenter"
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.
Read-Only vSphere MCP Server
This project lets Codex read inventory from VMware vCenter. It exposes seven approved MCP tools and cannot create, update, delete, clone, power, or move anything.
Caveman Explanation
You -> Codex -> this MCP server -> vCenter
|
+-> read information onlyCodex asks a question. The MCP server logs in to vCenter, performs an approved
REST request, and returns the answer. The MCP server runs locally through
standard input/output (stdio); it does not open a network port.
Related MCP server: vsphere-mcp
What You Need
You need:
The HTTPS address of your vCenter Server, such as
https://vcenter.company.com.A vCenter username.
That user's password.
The built-in Read-only role assigned at the inventory level you need, with propagation enabled.
Network or VPN access from your computer to vCenter.
Python 3.10 or newer, Git, and Codex.
The address alone is not enough. You need a username and password. You do not need a Broadcom developer API key. After login, vCenter returns a temporary session token automatically.
Send this request to your VMware administrator:
Please provide the HTTPS vCenter Server address and a dedicated service account with the built-in Read-only role. Assign it at the required inventory scope with propagation enabled. Please also provide the company CA certificate in PEM format if vCenter uses an internally signed certificate.
This project supports username/password authentication. If your company forces browser-only SSO or MFA, ask for a non-interactive read-only service account.
Install on macOS or Linux
git clone https://github.com/arjungowdal4601/vcenter_mcp.git
cd vcenter_mcp
python3 --version
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e .
cp .env.example .env
chmod 600 .envThe version command must show Python 3.10 or newer. If python3 is older, use
the newer executable installed on your computer, such as python3.13, for the
virtual-environment command.
Open .env in a local text editor and replace the example values with your
credentials. Do not paste the password into an AI chat.
Install on Windows PowerShell
git clone https://github.com/arjungowdal4601/vcenter_mcp.git
cd vcenter_mcp
py -3 --version
py -3 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -e .
Copy-Item .env.example .envThe version command must show Python 3.10 or newer.
Open .env locally and replace the examples. If PowerShell blocks activation,
you can still use .\.venv\Scripts\python.exe in the remaining commands.
Configure .env
Minimum configuration:
VSPHERE_HOST="https://vcenter.company.com"
VSPHERE_USERNAME="codex-readonly@vsphere.local"
VSPHERE_PASSWORD="your-real-password"
VSPHERE_VERIFY_SSL="true"
VSPHERE_TIMEOUT_SECONDS="30"VSPHERE_HOST is the address used to open vCenter Server. Do not use an ESXi
host address, the Broadcom documentation website, or an address ending in an
API path such as /api or /sdk.
VSPHERE_USERNAME is the read-only vCenter account. Depending on your company,
it may look like user@vsphere.local, DOMAIN\\user, or an email address.
VSPHERE_PASSWORD is that account's password. .env is ignored by Git and
must never be committed.
VSPHERE_VERIFY_SSL should remain true. Turning verification off makes it
possible to send credentials to an impostor server.
If your company uses a private certificate authority, add the absolute path to its PEM bundle:
VSPHERE_CA_BUNDLE="/Users/you/certificates/company-ca.pem"On Windows, use a quoted absolute path:
VSPHERE_CA_BUNDLE="C:\\Certificates\\company-ca.pem"Process environment variables override values in .env.
Connect the Server to Codex
Run the command from the repository directory after filling .env.
macOS or Linux:
codex mcp add vsphere -- "$(pwd)/.venv/bin/python" -m vsphere_mcp --env-file "$(pwd)/.env"Windows PowerShell:
$root = (Get-Location).Path
codex mcp add vsphere -- "$root\.venv\Scripts\python.exe" -m vsphere_mcp --env-file "$root\.env"The Codex registration stores only the Python command and .env path. It does
not store the vCenter username or password.
Check the registration:
codex mcp get vsphereRestart Codex after registering the server. Then ask:
Use the vSphere tools to list my virtual machines.To replace an old registration:
codex mcp remove vsphereThen run the appropriate codex mcp add command again.
Other MCP-compatible coding agents can run the same executable and arguments
as a local stdio server. Their configuration format is agent-specific.
Available Tools
Tool | What it reads | REST endpoint |
| Visible virtual machines |
|
| Details for one VM ID |
|
| ESXi hosts |
|
| Clusters |
|
| Datastores |
|
| Datacenters |
|
| Networks |
|
vsphere_list_vms can filter by VM IDs, names, folders, datacenters, hosts,
clusters, resource pools, and power states. Allowed power states are
POWERED_ON, POWERED_OFF, and SUSPENDED.
Example prompts:
Use vSphere to list all VMs.
Show only powered-on VMs named web-server.
Get details for VM vm-42.
List my ESXi hosts and clusters.
List all datastores and datacenters visible to this account.
List the available vCenter networks.The returned inventory depends on the account's vCenter permissions. An empty list can mean the login worked but the Read-only role was assigned at the wrong inventory scope.
Authentication
The MCP server performs this flow internally:
It sends the username and password to
POST /api/sessionusing HTTPS Basic authentication.vCenter returns a temporary session token.
The server sends that token in the
vmware-api-session-idheader for REST reads.If the token expires and vCenter returns HTTP 401, the server logs in once more and retries the read once.
The password is not an API key. The temporary session token is not something you obtain manually.
Security
Only explicit read tools are registered with MCP.
Every tool is marked read-only, non-destructive, and idempotent.
There is no generic
call_apitool.vCenter addresses must use HTTPS.
Redirects are not followed, preventing credentials from being forwarded to another host.
IDs and filters are validated before requests are sent.
Passwords are excluded from configuration representations and errors.
Real enforcement also comes from the vCenter account's Read-only role.
For stronger protection, create a dedicated service account instead of using a personal administrator account.
Troubleshooting
HTTP 401
vCenter rejected the username, password, or expired session. Confirm the
credentials by signing in to the same VSPHERE_HOST. Browser-only MFA accounts
will not work.
HTTP 403
The login worked, but the account lacks permission. Ask the administrator to assign the Read-only role at the correct inventory scope with propagation.
Certificate verification failed
Ask the administrator for the company CA certificate in PEM format and set
VSPHERE_CA_BUNDLE. Do not solve production certificate errors by disabling
verification.
Connection timeout or name error
Confirm the address, DNS, VPN, firewall, and port 443 access from your computer.
Codex cannot see the tools
Run codex mcp get vsphere, confirm the displayed Python and .env paths still
exist, and restart Codex. Absolute paths break if the repository is moved;
remove and add the registration again after moving it.
Tools return no inventory
The account may have the Read-only role at the wrong scope. vCenter only returns objects visible to that account.
Sharing
Share the GitHub repository, not your .env file. Each user should clone the
project, create their own .env, and register their local copy with Codex.
Never send vCenter passwords through Git, email, chat, screenshots, or tickets.
This version intentionally supports only local stdio. It does not provide a
central HTTP MCP service.
Development
Install development dependencies and run the tests:
python -m pip install -e '.[dev]'
python -m pytestShow the command-line help:
python -m vsphere_mcp --helpThe automated tests use mocked vCenter responses. A real integration test requires a non-production vCenter address and read-only credentials.
Official References
Available Tools
9 toolsvsphere_get_vmARead-onlyIdempotent
Get read-only details for one virtual machine by vSphere VM id, for example vm-42.
Inputs: vm (required). Returns: object
vsphere_get_vm_summaryCRead-onlyIdempotent
Get a VirtualMachine summary property through VI/JSON by VM id, for example vm-42.
Inputs: vm (required), release. Returns: object
vsphere_list_clustersARead-onlyIdempotent
List visible vCenter clusters using the vSphere Automation REST API.
Inputs: no named parameters. Returns: object
vsphere_list_datacentersARead-onlyIdempotent
List visible datacenters using the vSphere Automation REST API.
Inputs: no named parameters. Returns: object
vsphere_list_datastoresARead-onlyIdempotent
List visible datastores using the vSphere Automation REST API.
Inputs: no named parameters. Returns: object
vsphere_list_hostsARead-onlyIdempotent
List visible ESXi hosts using the vSphere Automation REST API.
Inputs: no named parameters. Returns: object
vsphere_list_networksARead-onlyIdempotent
List visible networks using the vSphere Automation REST API.
Inputs: no named parameters. Returns: object
vsphere_list_vmsBRead-onlyIdempotent
List visible virtual machines using the vSphere Automation REST API.
Inputs: vms, hosts, names, folders, +4 more. Returns: object
vsphere_query_propertiesARead-onlyIdempotent
Read one allowlisted VI/JSON managed-object property. Inputs are mo_type, mo_id, property_path, and optional release.
Inputs: mo_id (required), mo_type (required), property_path (required), release. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Tools are mostly distinct with clear purposes. The slight overlap between vsphere_get_vm and vsphere_get_vm_summary could cause confusion, but descriptions differentiate them (full VM details vs. summary property). All other tools target unique resource types.
All tools start with 'vsphere_' and follow a verb_noun pattern. Verbs are consistently 'list' for enumeration and 'get' for single resources, except 'query_properties' which uses 'query' instead of 'get', introducing minor inconsistency.
9 tools cover the core read-only operations for vSphere (listing main resources and retrieving VM details). The count is well-scoped for the server's purpose, not excessive or sparse.
The set covers listing for most resources and VM detail retrieval, but lacks ways to get detailed properties for clusters, datastores, or hosts beyond listing. The generic 'query_properties' tool may partially fill gaps but is limited to allowlisted properties and requires specific input.
Related MCP Connectors
MCP gateway and cloud hosting for MCP servers, agents and apps like RAG, managed from your agent.
MCP federation gateway: route, govern and observe agent tools across clouds and MCP servers.
Host any HTTP API as a standard MCP server; auto-distribute to 12+ mainstream agent platforms.
One OAuth connector for your team's remote MCP servers, with Tool Packs, guardrails and logs.
Related MCP Servers
- AlicenseAqualityBmaintenanceRead-only VMware vCenter/ESXi monitoring. 8 MCP tools for VM inventory, host status, datastore capacity, cluster info, alarms, events, and VM details. Code-level enforced safety — no destructive operations exist in the codebase. Supports vSphere 6.5–8.0. Works with local models via Ollama/LM Studio.33506 PyPI18MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for VMware vSphere/vCenter operations, enabling natural language control of VMs, hosts, and infrastructure.Apache 2.0
- FlicenseNot gradedqualityDmaintenanceAn MCP server that gives AI agents direct access to VMware vSphere infrastructure, enabling VM lifecycle management, snapshots, datastore operations, networking, and more via 55 typed tools built on govc.-
- AlicenseNot gradedqualityCmaintenanceEnables VMware vCenter management via MCP, adding real-time and historical performance monitoring, VM lifecycle operations, snapshots, ISO mounting, and network/host management through natural language.MIT