What is vCenter MCP Server?
vCenter MCP Server is a lightweight MCP-compliant server that connects directly to your vCenter Server environment. It offers an easy-to-use API through MCP, allowing users or AI agents to perform key virtualization operations such as creating, migrating, or querying virtual machines without dealing with complex native APIs or interfaces.
How to Configure
- Clone the repository:
[email protected]:rooky-top/vcenter-mcp-server.git
- Install dependencies:
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
- Edit configuration:
Fill in your vCenter credentials in the.env
file:
All fields are required.VCENTER_HOST=your-vcenter-host VCENTER_USER=your-username VCENTER_PASSWORD=your-password
- Run the server:
Recommended:
mcp-proxy --sse-host=0.0.0.0 --sse-port=8080 uv run vMotion_server.py
- Configure your MCP client:
Add the following to your MCP client's config:{ "mcpServers": { "vCenter-mcp": { "url": "http://localhost:8080/sse" } } }
How to Use
Once the vCenter MCP Server is running and connected via your MCP client, you can:
- List available tools (endpoints)
- Invoke actions such as creating a VM, migrating VMs, listing VMs, or powering hosts on/off.
- Provide the required input data for each tool in JSON format as specified in the tool documentation. Example usage scenarios include batch VM migrations or automated infrastructure management directly through the MCP client interface or compatible LLM agent.
Key Features
- Stable connectivity with vCenter Server for managing your entire virtualization environment.
- Virtual machine creation: Quickly provision new VMs with customized specs.
- Flexible VM migration: Supports single, multiple, and batch migrations by source VM names or host IPs.
- Detailed VM information queries: Retrieve live info about VMs on any ESXi host.
- Power management: Remotely power on/off physical ESXi hosts via supported IPMI interfaces.
- Standard MCP integration: Easily connects to any MCP-compliant client or AI agent.
Use Cases
- Automating mass virtual machine migrations during hardware upgrades or maintenance windows.
- Rapid VM provisioning workflows for development, testing or CI/CD pipelines.
- AI-driven monitoring and remediation (e.g., proactively moving VMs based on resource utilization).
- Remote power cycling of ESXi hosts in large-scale, lights-out data centers.
- Enabling LLMs to interact with your vSphere infrastructure for scripts or chatops scenarios.
FAQ
Q1: Is vCenter MCP Server secure?
A1: The server runs on-premises and connects to your vCenter with credentials specified in an .env
file. Data exchange remains within your infrastructure unless exposed externally. Always protect your credentials and use network security best practices.
Q2: Can I run vCenter MCP Server with a different vCenter version?
A2: The tool is designed for VMware vCenter environments. Ensure that the APIs used are compatible with your vCenter deployment. Test with your version before deploying to production.
Q3: What are the hardware/software requirements?
A3: The server runs on any system with Python and network access to vCenter. No agent needs to be run on ESXi hosts, but sufficient permissions are required on vCenter.
Q4: Can I extend or add custom tools?
A4: Yes, you can fork the repository and add new Python tools or extend existing ones by registering new functions with the MCP server.
Q5: What operations can be scripted or automated through MCP?
A5: Any action provided as a tool (VM creation, migration, information query, host power management) can be automated with scripts, LLMs, or your own MCP-compliant clients.