All notable changes to vSphere-MCP-Pro will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
-
VsphereApiErrorexception class - Custom exception with rich error context including:- HTTP status code
- vCenter error type extraction (supports both
/apiand/restresponse formats) - Human-readable error messages from vCenter
- Convenience properties:
is_not_found,is_unauthorized,is_forbidden,is_conflict
-
VsphereClientPoolclass - Thread-safe connection pooling:- Maintains one authenticated session per vCenter host
- Automatic session reuse to prevent vCenter session exhaustion
atexithook for graceful cleanup on process terminationget(),remove(),close_all()methodssizeandhostsproperties for observability
-
VsphereClient.logout()method - Properly terminates vCenter sessions via DELETE to session endpoint -
VsphereClient.close()method - Callslogout()then closes the underlyingrequests.Session -
VsphereClient.hostproperty - Clean accessor for the configured hostname -
VsphereClient.is_authenticatedproperty - Check if session token is present -
Response validation - All API methods now validate responses via
_check_response():- Raises
VsphereApiErroron non-2xx responses - Supports
allow_statusesfor operations like DELETE that return 204 - Descriptive error messages include operation context
- Raises
-
Helper methods in
VsphereClient:_safe_json()- Safely parse JSON responses without raising_check_response()- Validate HTTP response and raise on error_extract_value()- Handle/apivs/restresponse format differences
-
Fixed decorator pattern in
server.py- Convertedinjectfrom broken function to proper decorator factory:# Before (broken - caused TypeError) @inject def list_vms(...): ... # After (working) @inject("list_vms") def list_vms(...): ...
-
Destructive operations now properly flagged - Added
destructive=Trueto:delete_vmdelete_vm_snapshotmodify_vm_resources
-
Session management refactored - Replaced per-request client creation with
VsphereClientPool:- Single pool instance created in
build_server() - Pool injected into all tools via
_poolparameter - Significantly reduces vCenter session consumption
- Single pool instance created in
-
Improved error messages - API errors now include full context:
VsphereApiError: Failed to get VM 'vm-999': HTTP 404 on /api/vcenter/vm/vm-999 [NOT_FOUND]: The VM was not found.
-
Dockerfile path error - Changed
COPY src /app/srctoCOPY vsphere_mcp_pro /app/vsphere_mcp_pro -
Session leak - Previous implementation created new session per API call without logout; now properly pooled and cleaned up
-
Silent API failures - Methods previously returned error JSON as if successful; now raise
VsphereApiError
- None
client_for()helper function inserver.py- Replaced byVsphereClientPool.get()
- Sessions are now properly terminated on shutdown via
atexithook - Reduced attack surface by limiting active vCenter sessions
- Initial MCP server implementation for VMware vCenter 8.0+
- VM lifecycle management (power on/off/reset, delete)
- Snapshot operations (list, create, delete)
- Inventory discovery (VMs, hosts, datastores, networks, datacenters)
- Resource modification (CPU, memory)
- Token-based RBAC authorization
- Token bucket rate limiting
- JSONL audit logging
- SSL verification with optional CA bundle
- Allowed-host enforcement
- Support for both
/apiand/restvCenter endpoints