Skip to main content
Glama

vmware-workstation-mcp

CI Python 3.10+ License: MIT MCP Compatible

English | 简体中文

Note: This repository (vmware-workstation-mcp-test) is a public experimental release for testing and community feedback.

A lightweight, zero-daemon Model Context Protocol (MCP) server that lets AI agents (Antigravity, Claude Desktop, Cursor, Windsurf, etc.) control VMware Workstation Pro / Player / Fusion through VMware's native vmrun utility.


Why This Server?

  • Zero Daemon & Minimal Dependency: Talks directly to vmrun over local Stdio JSON-RPC. No vmrest background service, no plaintext .vmrestCfg credentials, and only a single Python dependency (mcp>=1.2.0).

  • Windows CJK / Non-UTF-8 Safe: Automatically decodes inventory.vmls, .vmx, and vmrun output with UTF-8 → GB18030/CP936 fallback, preventing UnicodeDecodeError and mojibake on Chinese/CJK Windows hosts.

  • Fuzzy VM Name Resolution: Pass a short name, display name, folder name, or unique keyword (e.g. "ubuntu-lab") instead of typing full .vmx paths with spaces or Unicode characters.

  • Strict Stdio Isolation: All diagnostic logs go exclusively to sys.stderr, keeping sys.stdout spotless for MCP JSON-RPC framing.

  • Built-in Safety Guardrails: Intentionally omits deleteVM, masks -gp/-vp passwords in logs/errors, uses shell=False subprocess lists, and requires explicit confirm=True for destructive or state-discarding actions.


Related MCP server: VMware Workstation MCP

Architecture

flowchart LR
    CLIENT["MCP Client (Antigravity / Claude / Cursor)"] <-->|"Stdio JSON-RPC"| SERVER["vmware-mcp (FastMCP)"]
    SERVER -->|"Logs only"| STDERR["sys.stderr"]
    SERVER -->|"Read-only UTF-8/GB18030 Parse"| META["inventory.vmls & *.vmx"]
    SERVER -->|"subprocess (shell=False)"| VMRUN["vmrun / vmrun.exe"]
    VMRUN -->|"VIX Control"| VM["VMware Workstation / Fusion"]
    VM -->|"VMware Tools"| GUEST["Guest OS (Linux / Windows)"]

Requirements

  • Python: 3.10 or newer

  • Hypervisor: VMware Workstation Pro / Player (Windows/Linux) or VMware Fusion (macOS) with vmrun installed

  • VMware Tools (optional): Required inside guest VMs only for guest-level tools (get_guest_ip, run_command_in_guest, run_script_in_guest, copy_file_*, list_processes_in_guest)


Installation

Option 1: Install from GitHub

pip install git+https://github.com/0D0-1yp0/vmware-workstation-mcp-test.git

Option 2: Clone and Install Locally (Editable)

git clone https://github.com/0D0-1yp0/vmware-workstation-mcp-test.git
cd vmware-workstation-mcp-test
pip install -e .

Verify the installation:

python -m unittest discover -s tests -v

MCP Client Configuration

Antigravity / Claude Desktop / Cursor (mcp_config.json)

Using the installed console script (vmware-mcp) or module invocation (python -m vmware_mcp):

{
  "mcpServers": {
    "vmware-mcp": {
      "command": "python",
      "args": ["-u", "-m", "vmware_mcp"],
      "env": {
        "PYTHONUTF8": "1",
        "PYTHONIOENCODING": "utf-8"
      }
    }
  }
}

Windows Tip: If vmrun.exe is installed in a non-standard directory or you have multiple Python environments, pass the absolute Python executable path (e.g. C:\\Python312\\python.exe) and optionally set VMWARE_VMRUN_PATH in env.

Environment Variables (All Optional)

Variable

Description

Default

VMWARE_VMRUN_PATH

Explicit path to vmrun / vmrun.exe

Auto-detected via PATH, Windows Registry, or standard install paths

VMWARE_HOST_TYPE

Value passed to vmrun -T (ws, fusion, player)

fusion on macOS, ws on Windows/Linux

VMWARE_VM_DIRS

Extra VM directories to scan (separated by ; on Windows or : on Unix)

Standard VMware VM folders + inventory.vmls


Available Tools (22)

1. Asset Discovery & Status (4)

Tool

Description

list_vms

List all discovered VMs (inventory + folders + running state) with optional .vmx hardware specs

list_running_vms

List currently running VMs via vmrun list

get_vm_info

Get .vmx specs, running status, VMware Tools state, and guest IP for a single VM

get_guest_ip

Query the guest OS IP address (supports wait=True)

2. Power Lifecycle (4)

Tool

Description

Safety Guardrail

start_vm

Start a VM in gui or headless nogui mode

—

stop_vm

Power off a VM (hard=False soft shutdown or hard=True force off)

hard=True requires confirm=True

reset_vm

Reboot a VM (hard=False soft reboot or hard=True hard reset)

hard=True requires confirm=True

power_state_vm

suspend, pause, or unpause a VM

—

3. Snapshot Management (4)

Tool

Description

Safety Guardrail

list_snapshots

List snapshots (flat or show_tree=True hierarchy)

—

create_snapshot

Create a named snapshot

—

revert_to_snapshot

Revert a VM back to a named snapshot

Requires confirm=True

delete_snapshot

Delete a snapshot (optional delete_children=True)

Requires confirm=True

4. Guest OS Operations & Diagnostics (6)

Tool

Description

run_command_in_guest

Execute a binary inside the guest OS (runProgramInGuest)

run_script_in_guest

Run inline script text inside the guest OS (runScriptInGuest)

list_processes_in_guest

List running processes inside the guest OS

copy_file_host_to_guest

Copy a file from host to guest

copy_file_guest_to_host

Copy a file from guest to host

capture_vm_screen

Capture the live VM display to a PNG file on the host (great for multimodal agents)

5. Host Networks & Shared Folders (3)

Tool

Description

list_host_networks

List vmnet* virtual networks and NAT port forwarding rules

manage_port_forwarding

Add/update (set) or remove (delete) NAT port forwarding rules

manage_shared_folder

enable, disable, add, remove, readonly, or writable Host-Guest shared folders

6. Cloning (1)

Tool

Description

clone_vm

Create a linked or full clone (optionally from a named snapshot)


Testing

# Default offline test suite (unit tests + real MCP stdio protocol handshake, no VMware required)
python -m unittest discover -s tests -v

# Optional read-only live tests against a local VMware installation
RUN_LIVE_VMWARE_TESTS=1 python -m unittest discover -s tests -v

Security

See SECURITY.md for guardrail details, credential handling, and vulnerability reporting.

License

Released under the MIT License.

Available Tools

22 tools
capture_vm_screenA

Capture the current display of a running VM to a local PNG file (captureScreen).

Args: vm: VM name, substring, or full .vmx path. output_path: Optional host PNG file path. Defaults to /vmware-mcp-screens/_.png.

Inputs: vm (required), output_path. Returns: object

clone_vmA

Create a linked or full clone of a VM (vmrun clone).

Args: vm: Source VM name, substring, or full .vmx path. dest_vmx_path: Destination .vmx file path for the cloned VM. clone_type: 'linked' (fast, shares base disk) or 'full' (independent copy). snapshot_name: Optional source snapshot name to clone from. clone_name: Optional display name for the new clone.

Inputs: vm (required), dest_vmx_path (required), clone_name, clone_type, +1 more. Returns: object

copy_file_guest_to_hostB

Copy a file from the guest OS to the host (CopyFileFromGuestToHost).

Args: vm: VM name, substring, or full .vmx path. guest_path: Source file path inside the guest OS. host_path: Destination file path on the host (parent dirs created automatically). guest_user: Guest OS username. guest_password: Guest OS password (masked in logs/responses).

Inputs: vm (required), host_path (required), guest_path (required), guest_user, +1 more. Returns: object

copy_file_host_to_guestA

Copy a file from the host to the guest OS (CopyFileFromHostToGuest).

Args: vm: VM name, substring, or full .vmx path. host_path: Existing source file path on the host. guest_path: Destination file path inside the guest OS. guest_user: Guest OS username. guest_password: Guest OS password (masked in logs/responses).

Inputs: vm (required), host_path (required), guest_path (required), guest_user, +1 more. Returns: object

create_snapshotC

Create a named snapshot of a VM.

Args: vm: VM name, substring, or full .vmx path. name: Snapshot name.

Inputs: vm (required), name (required). Returns: object

delete_snapshotA

Delete a named snapshot from a VM.

Args: vm: VM name, substring, or full .vmx path. name: Exact snapshot name to remove. delete_children: Also delete child snapshots when True. confirm: Must be True to confirm permanent snapshot deletion.

Inputs: vm (required), name (required), confirm, delete_children. Returns: object

get_guest_ipA

Query the guest OS IP address of a running VM (requires VMware Tools).

Args: vm: VM display name, folder name, unique substring, or full .vmx path. wait: If True, wait until an IP address becomes available (up to 60s).

Inputs: vm (required), wait. Returns: object

get_vm_infoA

Get detailed info for a VM: .vmx specs, running status, VMware Tools state, and guest IP.

Args: vm: VM display name, folder name, unique substring, or full .vmx path.

Inputs: vm (required). Returns: object

list_host_networksA

List VMware host virtual networks (vmnet*) and their NAT port forwarding rules.

Inputs: no named parameters. Returns: object

list_processes_in_guestB

List running processes inside the guest OS (listProcessesInGuest).

Args: vm: VM name, substring, or full .vmx path. guest_user: Guest OS username. guest_password: Guest OS password (masked in logs/responses).

Inputs: vm (required), guest_user, guest_password. Returns: object

list_running_vmsA

List all currently running VMware VMs via vmrun list.

Inputs: no named parameters. Returns: object

list_snapshotsA

List snapshots for a VM.

Args: vm: VM name, substring, or full .vmx path. show_tree: Return indented snapshot hierarchy when True.

Inputs: vm (required), show_tree. Returns: object

list_vmsB

List all discovered VMware VMs (from inventory, VM folders, and running state).

Args: include_specs: Include parsed .vmx specs (guest OS, vCPUs, memory MB, NICs).

Inputs: include_specs. Returns: object

manage_port_forwardingB

Add/update or delete a NAT port forwarding rule on a VMware host network (e.g. vmnet8).

Args: network: Host network name (e.g. 'vmnet8'). action: 'set' to add/update, 'delete' to remove. protocol: 'tcp' or 'udp'. host_port: Host TCP/UDP port number (1-65535). guest_ip: Guest IP address (required when action='set'). guest_port: Guest port number 1-65535 (required when action='set'). description: Optional rule description (only for action='set').

Inputs: action (required), network (required), protocol (required), host_port (required), +3 more. Returns: object

manage_shared_folderB

Manage VMware Host-Guest shared folders for a VM.

Args: vm: VM name, substring, or full .vmx path. action: 'enable', 'disable', 'add', 'remove', 'readonly', or 'writable'. share_name: Shared folder name (required for add/remove/readonly/writable). host_path: Host directory path (required for add/readonly/writable).

Inputs: vm (required), action (required), host_path, share_name. Returns: object

power_state_vmB

Suspend, pause, or unpause a VM.

Args: vm: VM name, substring, or full .vmx path. action: One of 'suspend', 'pause', or 'unpause'.

Inputs: vm (required), action (required). Returns: object

reset_vmA

Reset (reboot) a running VM.

Args: vm: VM name, substring, or full .vmx path. hard: False for graceful guest reboot; True for immediate hard reset. confirm: Must be True when hard=True (safety guardrail).

Inputs: vm (required), hard, confirm. Returns: object

revert_to_snapshotA

Revert a VM back to a named snapshot (discards unsaved current state).

Args: vm: VM name, substring, or full .vmx path. name: Exact snapshot name to revert to. confirm: Must be True to confirm discarding current VM state.

Inputs: vm (required), name (required), confirm. Returns: object

run_command_in_guestA

Run an executable inside the guest OS via VMware Tools (runProgramInGuest).

Args: vm: VM name, substring, or full .vmx path. program_path: Absolute path to the executable inside the guest OS. args: Optional list of program arguments. guest_user: Guest OS username. guest_password: Guest OS password (masked in logs/responses). no_wait: Return immediately without waiting for the program to exit. interactive: Launch in the interactive desktop session. timeout: Subprocess timeout in seconds.

Inputs: vm (required), program_path (required), args, no_wait, +4 more. Returns: object

run_script_in_guestA

Execute inline script text inside the guest OS (runScriptInGuest).

Note: vmrun itself does not stream guest stdout back to the host; redirect output to a file inside the guest and retrieve it with copy_file_guest_to_host if you need full stdout capture.

Args: vm: VM name, substring, or full .vmx path. interpreter: Interpreter absolute path in guest (e.g. '/bin/bash' or 'C:\Windows\System32\cmd.exe'). script_text: Script body to execute. guest_user: Guest OS username. guest_password: Guest OS password (masked in logs/responses). no_wait: Return immediately without waiting for completion. timeout: Subprocess timeout in seconds.

Inputs: vm (required), interpreter (required), script_text (required), no_wait, +3 more. Returns: object

start_vmA

Start a VM in GUI or headless (nogui) mode.

Args: vm: VM name, substring, or full .vmx path. gui: True to open the VMware window; False for background headless mode.

Inputs: vm (required), gui. Returns: object

stop_vmA

Stop (power off) a running VM.

Args: vm: VM name, substring, or full .vmx path. hard: False for graceful soft shutdown; True for immediate hard power-off. confirm: Must be True when hard=True (safety guardrail against data loss).

Inputs: vm (required), hard, confirm. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 22 tools

    Disambiguation4/5

    Most tools target a distinct resource+action (snapshots, guest file copy, guest command execution, networking). The only mild overlaps are list_vms vs list_running_vms and reset_vm vs stop_vm/start_vm, but descriptions clearly differentiate them (all discovered vs running only; reboot vs power cycle).

    Naming Consistency4/5

    Strong verb_noun convention throughout (list_snapshots, create_snapshot, copy_file_host_to_guest, run_command_in_guest). The lone deviation is power_state_vm, which uses a noun phrase instead of a verb, but the rest are highly predictable.

    Tool Count4/5

    22 tools is on the heavier side but the domain is genuinely broad: VM lifecycle, snapshots, guest operations, file transfer, networking, shared folders, and cloning. Each tool earns its place, though a few could theoretically be collapsed (e.g. power_state_vm into stop/start).

    Completeness3/5

    Lifecycle, snapshots, guest ops, networking, and cloning are covered well. However, there is no delete_vm or unregister tool and no create-from-scratch tool (only clone_vm), leaving dead ends for VM removal and fresh VM creation.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      MCP server for controlling VMware Fusion/Workstation virtual machines via vmrun CLI, providing 32 tools for VM lifecycle, guest execution, and file operations without requiring a REST API daemon.
      32
      65 npm
      7
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that gives an LLM full control over a VMware-hosted Windows VM: lifecycle, snapshots, remote execution, file transfer, and kernel debugging.
      MIT