Skip to content

MCP Server

The VirtualProg MCP Server lets AI assistants such as Claude, Cursor and GitHub Copilot manage your virtual machines. Ask in plain language — "start the Ubuntu VM and tell me its IP address" or "take a snapshot of Windows 11 before the update" — and the assistant does it through VirtualProg.

The server uses the open Model Context Protocol (MCP) and is part of the vpvm command-line tool. It works with VirtualProg on this Mac or on a remote Mac.

The MCP server is available on macOS, Windows and Linux. On Windows and Linux, it runs alongside your AI assistant and connects to a remote Mac running VirtualProg. It does not run virtual machines on Windows or Linux.


What It Can Do

Everything the command line can do is available to the assistant:

Area Examples
Virtual machines List VMs, check status, IP addresses, stats and logs; start, shut down, pause, suspend and restart
Screen Take a screenshot so the assistant can see what is on the VM's display
Create and organise Create VMs from boot images, clone, rename, linked clones, favorites, tag colors and groups
Configuration CPU, memory, display, sound, camera, startup, High Availability, security, schedule and more
Devices Disks, network adapters, port forwarding, CD/DVD drives, serial ports, USB devices and webhooks
Snapshots and checkpoints Create, rename and organise; restore and delete when allowed
Templates Create templates, and create VMs from templates
Images and networks Browse and download boot images; create and change host networks
Administration Access tokens and Mac server settings, when allowed

What the assistant may do is set by the access mode you choose. By default it can inspect VMs and change their power state, but cannot change or delete anything.


Requirements

  • The vpvm command-line tool for your platform: macOS, Windows or Linux. Extract it to a permanent folder; see Installation.
  • The CLI Server enabled in Settings → CLI → Enable CLI Server on the Mac. macOS local clients can start VirtualProg automatically. Remote clients require VirtualProg already running, External Access enabled, and a reachable host, port and access token.
  • An AI assistant that supports MCP servers.

Access Modes

Option The assistant can
--mode read Inspect VMs, settings, snapshots, templates, images and networks; take screenshots
--mode operate Everything in read, plus start, stop, pause, resume, suspend and restart VMs and switch devices of running VMs (default)
--mode full Everything in operate, plus create and change VMs, settings, snapshots, templates, images and networks
--allow-destructive Delete VMs, snapshots, checkpoints, templates, images, networks and disks, and restore snapshots or checkpoints (needs --mode full)
--allow-admin Manage access tokens and Mac server settings
--allow-secrets Use passwords and keys: unlock VMs, set VM, provisioning and SSH passwords
--allow-vm <name> Only use the named VMs

Tip: Start with the default mode. Add --mode full or --allow-destructive only for the assistants and VMs that need them.


Options

Add options after mcp in the assistant's configuration, for example vpvm mcp --mode full --allow-vm WinTest.

Access

Option Description
--mode <mode> What the assistant may do: read, operate or full. Default: operate. See Access Modes.
--allow-destructive Also allow deleting and restoring. Needs --mode full.
--allow-admin Also allow managing access tokens and Mac server settings.
--allow-secrets Also allow passwords and keys: unlocking VMs and setting VM, provisioning and SSH passwords or SSH keys.
--allow-vm <name> Only allow the named VM. Repeat the option or separate names with commas for several VMs, for example --allow-vm "Ubuntu,WinTest". The VM list shows only these VMs, new VMs must use one of these names, and renaming a group (which changes every VM in it) is disabled.

Activity log

Option Description
--audit-log <path> Add one line per action to this file: time, tool, action, VM, snapshot or template names, result and duration. Other values, such as passwords, are never written. The file is created readable only by you. The same lines also go to the assistant's MCP log.

Connection

On macOS, without these options the server connects to VirtualProg on the same Mac using its settings. Windows and Linux require a remote host and token through these options, environment variables or a profile.

Option Environment variable Description
--server <host> VPVM_SERVER Host name or IP address of a remote Mac
--port <port> VPVM_PORT CLI Server port, if not the default
--token <token> VPVM_TOKEN Master token or access token for the remote Mac
--secure VPVM_SECURE=1 Connect over HTTPS (recommended)
--trust-certificate VPVM_TRUST_CERT=1 macOS only: accept any HTTPS certificate, including self-signed ones
--profile <name> Use a saved connection profile from ~/.vpvmrc; see Command Line

Set the token with VPVM_TOKEN in the assistant's configuration rather than --token, so it does not appear in the command's arguments.

For HTTPS on Windows and Linux, the server certificate must be trusted by the client's TLS backend; --trust-certificate is not supported. See Trusting a Self-Signed Certificate for export, fingerprint verification and installation steps on Windows, Linux and macOS. Use VPVM_SECURE=0 only for an HTTP server on a trusted network; HTTP sends the token unencrypted. See Remote Access for PowerShell and Linux shell examples using environment variables or command parameters.

Setup and checks

Option Description
--print-config <client> Print a ready-to-use configuration for claude-desktop, claude-code or cursor, including the other options given, then exit. The token is never included.
--list-tools Print the tools and actions the server offers with the other options given, then exit. Useful to check what an assistant will be able to do.

Connecting an AI Assistant

vpvm prints a ready-to-use configuration for the common assistants, with its own path filled in:

vpvm mcp --print-config claude-desktop
vpvm mcp --print-config claude-code
vpvm mcp --print-config cursor

Add any options to the command and they are included, for example vpvm mcp --print-config claude-desktop --mode full --allow-vm "Ubuntu 24.04".

In the examples below, replace /path/to/vpvm with the path of your vpvm file. After connecting, restart the assistant or reload its MCP servers.

Claude Desktop

Open Settings → Developer → Edit Config in Claude Desktop, and add the server to claude_desktop_config.json:

{
  "mcpServers": {
    "virtualprog": {
      "command": "/path/to/vpvm",
      "args": ["mcp"]
    }
  }
}

Claude Code

Run in Terminal:

claude mcp add virtualprog -- /path/to/vpvm mcp

Cursor

Add the server to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project):

{
  "mcpServers": {
    "virtualprog": {
      "command": "/path/to/vpvm",
      "args": ["mcp"]
    }
  }
}

Visual Studio Code (GitHub Copilot)

Add the server to .vscode/mcp.json in your workspace, then use Copilot Chat in Agent mode:

{
  "servers": {
    "virtualprog": {
      "type": "stdio",
      "command": "/path/to/vpvm",
      "args": ["mcp"]
    }
  }
}

Other Assistants

Any assistant that supports local (stdio) MCP servers can connect. Use /path/to/vpvm as the command and mcp followed by any options as its arguments.


Connecting to a Remote Mac

Remote connections work from macOS, Windows and Linux, and are required on Windows and Linux. On the Mac, enable the CLI Server and External Access in Settings → CLI, and create an Access Token for the assistant. Then add the connection options to the arguments:

{
  "mcpServers": {
    "virtualprog-studio": {
      "command": "/path/to/vpvm",
      "args": ["mcp", "--server", "studio.local", "--secure", "--mode", "full"],
      "env": { "VPVM_TOKEN": "<access token>" }
    }
  }
}

See Connection for all connection options. The access token's VMs and access level apply in addition to the MCP access mode.

Windows and Linux: Claude and GitHub Copilot

  1. Extract the CLI to a permanent location, such as C:\Tools\vpvm\vpvm.exe on Windows or /home/you/.local/bin/vpvm on Linux. On Linux, run chmod +x /home/you/.local/bin/vpvm.
  2. Check the connection before configuring your assistant. From the Windows CLI folder:
.\vpvm.exe list --server 192.168.1.10 --port 49152 --token "<access-token>" --secure

On Linux:

/home/you/.local/bin/vpvm list --server 192.168.1.10 --port 49152 --token "<access-token>" --secure

You can instead set VPVM_SERVER, VPVM_PORT, VPVM_TOKEN and VPVM_SECURE as shown in the CLI guide. Assistants inherit shell variables only when started from that shell; use the configuration's env object for an explicit connection. 3. Add the configuration below for your assistant, replacing the executable path, Mac IP and token. Merge with existing entries rather than replacing your entire configuration.

For VirtualProg's generated HTTPS certificate, first configure trust on the computer running the assistant. Keep VPVM_SECURE=1 in the examples below; no certificate-bypass flag is needed.

Claude Desktop on Windows

Open Settings → Developer → Edit Config and add this to claude_desktop_config.json (normally %APPDATA%\Claude\claude_desktop_config.json):

{
  "mcpServers": {
    "virtualprog": {
      "command": "C:\\Tools\\vpvm\\vpvm.exe",
      "args": ["mcp", "--mode", "operate"],
      "env": {
        "VPVM_SERVER": "192.168.1.10",
        "VPVM_PORT": "49152",
        "VPVM_TOKEN": "<access-token>",
        "VPVM_SECURE": "1"
      }
    }
  }
}

Claude Code on Windows or Linux

Register a server for your user account with the appropriate command:

# Windows PowerShell
claude mcp add --scope user virtualprog -- "C:\Tools\vpvm\vpvm.exe" mcp --server 192.168.1.10 --port 49152 --secure --mode operate
# Linux
claude mcp add --scope user virtualprog -- /home/you/.local/bin/vpvm mcp --server 192.168.1.10 --port 49152 --secure --mode operate

Set VPVM_TOKEN in the terminal before starting Claude Code, using the secure prompt in the CLI guide. Alternatively, add the env object from the Claude Desktop example to the server entry in ~/.claude.json (%USERPROFILE%\.claude.json on Windows). On Linux, use the absolute Linux executable path for command. Run claude mcp list to check the MCP connection.

GitHub Copilot CLI on Windows or Linux

Edit %USERPROFILE%\.copilot\mcp-config.json on Windows or ~/.copilot/mcp-config.json on Linux. Create the folder and file if needed:

{
  "mcpServers": {
    "virtualprog": {
      "type": "local",
      "command": "C:\\Tools\\vpvm\\vpvm.exe",
      "args": ["mcp", "--mode", "operate"],
      "env": {
        "VPVM_SERVER": "192.168.1.10",
        "VPVM_PORT": "49152",
        "VPVM_TOKEN": "<access-token>",
        "VPVM_SECURE": "1"
      }
    }
  }
}

On Linux, change command to /home/you/.local/bin/vpvm. If you configured COPILOT_HOME, use its mcp-config.json instead. Restart Copilot or run /mcp reload, then /mcp list.

GitHub Copilot in VS Code on Windows or Linux

Add this to your workspace's .vscode/mcp.json:

{
  "servers": {
    "virtualprog": {
      "type": "stdio",
      "command": "/home/you/.local/bin/vpvm",
      "args": ["mcp", "--mode", "operate"],
      "env": {
        "VPVM_SERVER": "192.168.1.10",
        "VPVM_PORT": "49152",
        "VPVM_TOKEN": "<access-token>",
        "VPVM_SECURE": "1"
      }
    }
  }
}

On Windows, change command to C:\\Tools\\vpvm\\vpvm.exe. Start the server from VS Code's MCP controls and use Copilot Chat in Agent mode. Note that VS Code uses servers, while Copilot CLI uses mcpServers; they are different configuration files.

The assistant starts vpvm mcp automatically over stdio; no separate listening port is needed on the client. After connecting, ask "List my VirtualProg virtual machines." The default operate mode permits power and live-device actions; use --mode read for inspection only. Keep configuration files containing tokens private and out of version control.


Security

  • Approve actions. Assistants ask before running a tool unless you allow it. Delete and restore operations are grouped in one tool that is marked destructive, so they are easy to keep on approval.
  • Grant the least access. Use the default mode, limit VMs with --allow-vm, and, for remote Macs, use an Operator access token limited to the VMs the assistant needs.
  • Keep passwords out of chats. Passwords and keys are disabled unless you add --allow-secrets. Password hashes and encrypted values are never shown to the assistant.
  • Review activity. Add --audit-log ~/vpvm-mcp.log to record each action with its VM and result. See Activity log.

Example Requests

  • "Which VMs are running, and how much memory are they using?"
  • "Start Ubuntu 24.04 and give me its IP address."
  • "Take a screenshot of the Windows 11 VM and tell me what is on the screen."
  • "Create a checkpoint of macOS Sequoia called before-update."
  • "Give the dev VM 8 CPU cores and 16 GB of memory." (needs --mode full)
  • "Download the latest Ubuntu image and create a Linux VM with 4 cores and 64 GB of disk." (needs --mode full)

Troubleshooting

Problem Solution
The assistant does not list VirtualProg tools Check the path to vpvm and restart the assistant. Run vpvm mcp --list-tools in Terminal to confirm the server works.
"The CLI server is disabled" Enable Settings → CLI → Enable CLI Server in VirtualProg.
"Cannot reach VirtualProg" on a remote Mac Check that the Mac is awake, VirtualProg is running, External Access is enabled, and the host and port are correct.
HTTPS certificate error Follow Trusting a Self-Signed Certificate on the assistant's computer. Check that the host matches the certificate and that it has not expired.
"The token was rejected" or "does not allow this action" Check VPVM_TOKEN, and the token's VMs and access level in Tools → Access Tokens.
An action is not available Start the server with the option the message names, such as --mode full or --allow-destructive.