Skip to main content
Glama
vSphere 7 MCP Server

vSphere 7 MCP Server

by jonnyfiveiq

vSphere 7 MCP Server

MCP server exposing tools to manage vSphere VMs.

Tools

  • list_vms — list all VMs (optionally filter by datacenter, folder, power_state; outputs table or JSON)

  • create_vm — clone a new VM from a template

  • delete_vm — delete a powered-off VM

  • power_on_vm — power on a VM

  • power_off_vm — power off a VM


Related MCP server: VMWare MCP

1) Local shell script (no Docker/Ansible)

./scripts/start_local.sh

The script will:

  • Create a .venv if needed

  • Install requirements

  • Load .env variables (VCENTER creds)

  • Run the MCP server

Edit .env to match your vCenter.


2) Docker

docker build -t vsphere7-mcp-server:latest .
docker compose up

docker-compose.yml reads env vars from .env in this folder.


3) Ansible (installs a systemd service)

cd ansible
ansible-playbook -i inventory.ini site.yml --ask-become-pass
  • Installs to /opt/vsphere7-mcp-server

  • Creates venv and writes /etc/vsphere7-mcp-server.env

  • Manages vsphere7-mcp-server.service

Check:

systemctl status vsphere7-mcp-server
journalctl -u vsphere7-mcp-server -f

4) Claude Desktop — test any running server

Claude can launch the MCP server via stdio. Example entries for your claude_desktop_config.json:

4.a Docker-based

{
  "mcpServers": {
    "vsphere-docker": {
      "command": "docker",
      "args": [
        "run", "--rm", "-i",
        "--env-file", "/Users/johnhardy/Downloads/vsphere7-mcp/.env",
        "vsphere7-mcp-server:latest"
      ],
      "cwd": "/Users/johnhardy/Downloads/vsphere7-mcp"
    }
  }
}

4.b Ansible-installed (direct venv python with env inline)

{
  "mcpServers": {
    "vsphere-ansible": {
      "command": "/opt/vsphere7-mcp-server/.venv/bin/python",
      "args": ["/opt/vsphere7-mcp-server/mcp-vsphere-server.py"],
      "env": {
        "VCENTER_HOST": "192.168.0.195",
        "VCENTER_USER": "administrator@vsphere.local",
        "VCENTER_PASSWORD": "xxxxxxx",
        "VCENTER_VERIFY_SSL": "false"
      }
    }
  }
}

Create /usr/local/bin/vsphere-mcp.sh on the host:

#!/usr/bin/env bash
set -a
source /etc/vsphere7-mcp-server.env
set +a
exec /opt/vsphere7-mcp-server/.venv/bin/python /opt/vsphere7-mcp-server/mcp-vsphere-server.py

Make it executable:

sudo chmod +x /usr/local/bin/vsphere-mcp.sh

Claude config:

{
  "mcpServers": {
    "vsphere-ansible-wrapper": {
      "command": "/usr/local/bin/vsphere-mcp.sh",
      "args": []
    }
  }
}

Quick MCP tool tests (from Claude)

  • List everything:

    list_vms()
  • Only powered-on:

    list_vms(power_state="on")
  • Create from a template:

    create_vm(name="test-01", template="my-template", datacenter="Datacenter", cluster="Cluster1", datastore="datastore1", power_on=false)

License

MIT License (c) 2025

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to manage VMware vSphere virtual infrastructure through comprehensive operations including VM power control, snapshot management, resource monitoring, performance analytics, and bulk operations with built-in safety confirmations for destructive actions.
      -
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to manage VMware vSphere infrastructure through 55 typed tools built on the govc CLI. It supports comprehensive operations including VM lifecycle management, snapshot control, datastore navigation, and networking configuration.
      5
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables managing VMware Workstation Pro VMs via MCP tools, including power operations, snapshots, guest processes, and network configuration through the vmrest, vmrun, and vmcli interfaces.
      4
      -