VMware ESXi MCP server

Provides a RESTful API for complete VMware ESXi/vCenter environment management including VM lifecycle operations and real-time performance monitoring through pyVmomi integration
Back to servers
Setup instructions
Provider
Bright8192
Release date
Mar 13, 2025
Language
Python
Stats
29 stars

This MCP server provides a management interface for VMware ESXi and vCenter environments through a simple REST API, enabling virtual machine lifecycle management and performance monitoring with real-time communication capabilities.

Installation

Prerequisites

To run the ESXi MCP Server, you'll need:

  • Python 3.7 or higher
  • Required Python packages

Step 1: Install Dependencies

Install all required packages using pip:

pip install pyvmomi pyyaml uvicorn mcp-core

Step 2: Create Configuration File

Create a config.yaml file with your VMware environment details:

vcenter_host: "your-vcenter-ip"
vcenter_user: "[email protected]"
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

Step 3: Launch the Server

Start the MCP server by running:

python server.py -c config.yaml

Usage

Authentication

All privileged operations require authentication using your API key:

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

Virtual Machine Management

Creating a VM

To create a new virtual machine:

{
    "name": "vm-name",
    "cpu": 2,
    "memory": 4096,
    "datastore": "datastore-name",
    "network": "network-name"
}

Cloning a VM

To clone an existing VM or template:

{
    "template_name": "source-vm",
    "new_name": "new-vm-name"
}

Deleting a VM

To remove a virtual machine:

{
    "name": "vm-name"
}

Power Operations

To perform power operations (on/off):

{
    "name": "vm-name"
}

Performance Monitoring

To retrieve performance statistics for a specific VM:

GET vmstats://{vm_name}

This provides real-time data on CPU, memory, storage, and network usage.

Configuration Options

Configuration Parameters

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

Using Environment Variables

Instead of a configuration file, you can use environment variables:

  • 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

Production Environment

For secure production deployments:

  • Use valid SSL certificates
  • Enable API key authentication
  • Set appropriate log levels
  • Restrict API access scope

Testing Environment

For development and testing:

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

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "esxi-mcp-server" '{"command":"python","args":["server.py","-c","config.yaml"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "esxi-mcp-server": {
            "command": "python",
            "args": [
                "server.py",
                "-c",
                "config.yaml"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "esxi-mcp-server": {
            "command": "python",
            "args": [
                "server.py",
                "-c",
                "config.yaml"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later