ESXi MCP Server

ESXi MCP Server

Mirror of

MCP-Mirror

Virtualization
Visit Server

README

ESXi MCP Server

A VMware ESXi/vCenter management server based on MCP (Model Control Protocol), providing simple REST API interfaces for virtual machine management.

Features

  • Support for ESXi and vCenter Server connections
  • Real-time communication based on SSE (Server-Sent Events)
  • RESTful API interface with JSON-RPC support
  • API key authentication
  • Complete virtual machine lifecycle management
  • Real-time performance monitoring
  • SSL/TLS secure connection support
  • Flexible configuration options (YAML/JSON/Environment Variables)

Core Functions

  • Virtual Machine Management
    • Create VM
    • Clone VM
    • Delete VM
    • Power On/Off operations
    • List all VMs
  • Performance Monitoring
    • CPU usage
    • Memory usage
    • Storage usage
    • Network traffic statistics

Requirements

  • Python 3.7+
  • pyVmomi
  • PyYAML
  • uvicorn
  • mcp-core (Machine Control Protocol core library)

Quick Start

  1. Install dependencies:
pip install pyvmomi pyyaml uvicorn mcp-core
  1. Create configuration file config.yaml:
vcenter_host: "your-vcenter-ip"
vcenter_user: "administrator@vsphere.local"
vcenter_password: "your-password"
datacenter: "your-datacenter"        # Optional
cluster: "your-cluster"              # Optional
datastore: "your-datastore"          # Optional
network: "VM Network"                # Optional
insecure: true                       # Skip SSL certificate verification
api_key: "your-api-key"             # API access key
log_file: "./logs/vmware_mcp.log"   # Log file path
log_level: "INFO"                    # Log level
  1. Run the server:
python server.py -c config.yaml

API Interface

Authentication

All privileged operations require authentication first:

POST /sse/messages
Authorization: Bearer your-api-key

Main Tool Interfaces

  1. Create VM
{
    "name": "vm-name",
    "cpu": 2,
    "memory": 4096,
    "datastore": "datastore-name",
    "network": "network-name"
}
  1. Clone VM
{
    "template_name": "source-vm",
    "new_name": "new-vm-name"
}
  1. Delete VM
{
    "name": "vm-name"
}
  1. Power Operations
{
    "name": "vm-name"
}

Resource Monitoring Interface

Get VM performance data:

GET vmstats://{vm_name}

Configuration

Parameter Description Required Default
vcenter_host vCenter/ESXi server address Yes -
vcenter_user Login username Yes -
vcenter_password Login password Yes -
datacenter Datacenter name No Auto-select first
cluster Cluster name No Auto-select first
datastore Storage name No Auto-select largest available
network Network name No VM Network
insecure Skip SSL verification No false
api_key API access key No -
log_file Log file path No Console output
log_level Log level No INFO

Environment Variables

All configuration items support environment variable settings, following these naming rules:

  • VCENTER_HOST
  • VCENTER_USER
  • VCENTER_PASSWORD
  • VCENTER_DATACENTER
  • VCENTER_CLUSTER
  • VCENTER_DATASTORE
  • VCENTER_NETWORK
  • VCENTER_INSECURE
  • MCP_API_KEY
  • MCP_LOG_FILE
  • MCP_LOG_LEVEL

Security Recommendations

  1. Production Environment:

    • Use valid SSL certificates
    • Enable API key authentication
    • Set appropriate log levels
    • Restrict API access scope
  2. Testing Environment:

    • Set insecure: true to skip SSL verification
    • Use more detailed log level (DEBUG)

License

MIT License

Contributing

Issues and Pull Requests are welcome!

Changelog

v0.0.1

  • Initial release
  • Basic VM management functionality
  • SSE communication support
  • API key authentication
  • Performance monitoring

Author

Bright8192

Acknowledgments

  • VMware pyvmomi team
  • MCP Protocol development team

Recommended Servers

Brev

Brev

Run, build, train, and deploy ML models on the cloud.

Official
Local
Python
metoro-mcp-server

metoro-mcp-server

Query and interact with kubernetes environments monitored by Metoro. Look at APM, metrics, traces, profiling information with LLMs.

Official
Local
Go
MCP2Lambda

MCP2Lambda

Enables AI models to interact with AWS Lambda functions via the MCP protocol, allowing access to private resources, real-time data, and custom computation in a secure environment.

Official
Python
mcp-k8s-go

mcp-k8s-go

This project is intended as a both MCP server connecting to Kubernetes and a library to build more servers for any custom resources in Kubernetes.

Local
Go
Sandbox MCP Server

Sandbox MCP Server

Provides isolated Docker environments for code execution, enabling users to create and manage containers, execute multi-language code, save and reproduce development environments, ensuring security and isolation.

Local
Python
MCP Development Server

MCP Development Server

A Model Context Protocol server that enables Claude to manage software development projects with complete context awareness and code execution through Docker environments.

Local
Python
Room MCP

Room MCP

A command-line tool that enables the use of MCP with the Room protocol, allowing agents to create and interact in peer-to-peer virtual rooms for goal-oriented collaboration.

Local
JavaScript
MCP 3D Printer Server

MCP 3D Printer Server

Enables interaction with 3D printer management systems through an MCP server, supporting STL file manipulation, slicing, and control of printers like OctoPrint, Klipper, Duet, and more.

Local
TypeScript
MCP Server Template

MCP Server Template

A template for creating Model Context Protocol (MCP) servers in TypeScript, offering features like container-based dependency injection, a service-based architecture, and integration with the LLM CLI for architectural design feedback through natural language.

Local
TypeScript
Code Sandbox MCP

Code Sandbox MCP

An MCP server to create secure code sandbox environment for executing code within Docker containers.

Local
Go