Skip to main content
Glama

vmware-sandbox-mcp

Give your AI agent a disposable computer.

An MCP server that lets Claude and other AI agents create a real Linux virtual machine, run anything in it, and throw it away. It runs on your own PC with VMware Workstation.

tests license: MIT python 3.11+ host: Windows Model Context Protocol

Quick start · Tools · Network modes · Security · Setup guide

A real sandbox: the agent logged in, opened the text editor and typed, using only the tools below.

Why

You want an agent to run an install script from a forum, try an unknown package, or click through a desktop program. You do not want it doing that on your own machine.

  • A full virtual machine, not a container. Each sandbox is its own VM with its own kernel, created from a clean snapshot (about 25 seconds on the test machine) and deleted when the agent is done.

  • The agent never sees VMware. It gets 13 plain tools: create a computer, run a command, copy files, look at the screen, click, type, destroy. This is deliberately not a general VMware management server.

  • Your other VMs are off limits. The server can only touch virtual machines it created itself. That is enforced in code and covered by tests, not left to the agent's good behaviour.

  • Internet without your home network. In web mode a sandbox can download from public websites but cannot reach your PC, your router or anything else on your network.

  • Everything is logged. Every command, file copy, click and web request goes into an audit log the agent cannot read or change.

  • Local. No cloud account, no API key, no per-minute billing. It needs VMware Workstation and Python, nothing else.

Related MCP server: @slicervm/mcp

What you can ask for

I found install.sh on a forum. Put it in a sandbox, run it with web access, and tell me what it actually does before I run it for real.

Start a sandbox, install nginx, serve this folder with it and check that the page loads.

Open the text editor in a sandbox, type a short note, save it, and show me a screenshot.

For the first one, the agent:

  1. calls sandbox_create(network="web") and gets a sandbox_id back;

  2. calls sandbox_copy_in to copy install.sh from your transfer folder into the sandbox;

  3. calls sandbox_run to execute it, then again to inspect new files, processes and services;

  4. calls sandbox_copy_out to save a report into your transfer folder;

  5. calls sandbox_destroy. Whatever the script did is gone.

How it works

flowchart LR
    A["AI agent<br>(Claude)"] -- "MCP (stdio)" --> S["vmware-sandbox-mcp"]
    S -- "clone from, never start" --> B[("base VM<br>clean snapshot")]
    S -- "allowlisted vmrun calls" --> C[("sandbox<br>linked clone")]
    C -- "web mode only" --> P["filtering proxy"]
    P --> I(("public<br>internet"))
    S --- T["transfer folder"]
    S --- L["audit log"]

Every sandbox is a linked clone of one powered-off snapshot of a Linux VM that you prepare once. Before a clone boots for the first time, its settings are rewritten: no shared folders, no clipboard, no USB, no CD-ROM, and no network unless the agent asked for one.

Requirements

  • A Windows host with VMware Workstation Pro and its vmrun command-line tool. Developed and tested on Workstation 25H2 (vmrun 1.17.0) on Windows 11. Linux hosts are not supported.

  • Python 3.11 or newer.

  • A Linux virtual machine to use as the base image. Debian 13 is what this was tested with.

Quick start

1. Prepare the base VM (once). Create a Debian VM in VMware Workstation, install open-vm-tools, shut it down completely and take a snapshot named clean. Details: setup guide.

2. Add the server to your MCP client. For Claude Code, put this in .mcp.json:

{
  "mcpServers": {
    "vmware-sandbox": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/rumenjordanov/vmware-sandbox-mcp", "vmware-sandbox-mcp"],
      "env": {
        "VMSANDBOX_BASE_VMX": "E:\\Virtual Machines\\sandbox-base\\Debian 13.x 64-bit.vmx",
        "VMSANDBOX_SNAPSHOT": "clean",
        "VMSANDBOX_CLONES_DIR": "E:\\vmsandbox-clones",
        "VMSANDBOX_TRANSFER_DIR": "E:\\vmsandbox-transfer",
        "VMSANDBOX_GUEST_USER": "${VMSANDBOX_GUEST_USER}",
        "VMSANDBOX_GUEST_PASSWORD": "${VMSANDBOX_GUEST_PASSWORD}"
      }
    }
  }
}

The Claude Desktop version is in the setup guide. The package is not on PyPI yet; uvx and pip install it straight from this repository:

pip install git+https://github.com/rumenjordanov/vmware-sandbox-mcp

3. Check the setup. With the same variables set in a terminal:

vmware-sandbox-mcp doctor

It verifies the settings, creates one test sandbox, runs a command in it and deletes it again. Every problem is printed with what to fix.

4. Ask your agent to create a sandbox and do something in it.

Tools

Tool

What it does

sandbox_create(network)

New sandbox from the clean snapshot. network is "none" (default), "web" or "nat". Returns a sandbox_id.

sandbox_run(sandbox_id, command, timeout_seconds)

Runs a bash command. Returns stdout, stderr, exit code, and whether it timed out.

sandbox_start(sandbox_id, command)

Starts a command that keeps running in the background (a server, a long build). Returns a job_id at once.

sandbox_check(sandbox_id, job_id)

Whether a background command is running, exited or stopped, its exit code, and its output so far.

sandbox_stop(sandbox_id, job_id)

Stops a background command and the programs it started.

sandbox_copy_in(sandbox_id, host_path, guest_path)

Copies a file or a whole folder from the transfer folder into the sandbox.

sandbox_copy_out(sandbox_id, guest_path, host_path)

Copies a file or a whole folder from the sandbox into the transfer folder.

sandbox_screenshot(sandbox_id)

PNG of the sandbox's screen.

sandbox_click(sandbox_id, x, y, button, double)

Clicks at a pixel position of the screenshot.

sandbox_type(sandbox_id, text)

Types text on the sandbox's keyboard.

sandbox_key(sandbox_id, keys)

Presses a key or shortcut, such as Return or ctrl+c.

sandbox_destroy(sandbox_id)

Powers off and deletes the sandbox.

sandbox_list()

Active sandboxes with age and network mode.

The three keyboard and mouse tools are off until you switch them on.

Network modes

Mode

What the sandbox can reach

Host setup

none (default)

Nothing. The sandbox has no network adapter.

none

web

Public websites over HTTP and HTTPS, through a filtering proxy on the host. Not your computer, not your home network, no other protocols.

one-time, needs admin rights: web mode setup

nat

The whole internet, and also your host and your local network.

none

Use web whenever a task needs to download something. Keep nat for code you trust.

Measured from inside a real sandbox on the test machine:

Target

nat

web

Public websites

reachable

reachable, through the proxy

Host's file-sharing ports (135, 139, 445)

open

no answer

Home router

answers

unreachable

Internet without the proxy

reachable

unreachable

Configuration

All configuration is through environment variables. If a required one is missing or wrong, the server still starts so your client can list the tools, but every tool call is refused with the reason, and nothing is created or touched. vmware-sandbox-mcp doctor shows what to fix.

Variable

Required

Default

Meaning

VMSANDBOX_BASE_VMX

yes

Full path of the base VM's .vmx file.

VMSANDBOX_SNAPSHOT

yes

Name of the powered-off snapshot to clone from.

VMSANDBOX_CLONES_DIR

yes

Folder where sandboxes live. Created if missing. Use it for nothing else.

VMSANDBOX_TRANSFER_DIR

yes

The only host folder copy_in / copy_out can read or write. Created if missing.

VMSANDBOX_GUEST_USER

yes

Login name inside the base VM.

VMSANDBOX_GUEST_PASSWORD

yes

Password for that login.

VMSANDBOX_MAX_SANDBOXES

no

3

Maximum sandboxes existing at once.

VMSANDBOX_MAX_AGE_MINUTES

no

120

Sandboxes older than this are destroyed automatically.

VMSANDBOX_BOOT_TIMEOUT_SECONDS

no

180

How long sandbox_create waits for the guest to become ready.

VMSANDBOX_VMRUN_PATH

no

auto-detected

Full path of vmrun if it is not in the standard location.

VMSANDBOX_AUDIT_LOG

no

audit.jsonl in the clones folder

File the audit log is appended to.

VMSANDBOX_REMOTE_INPUT

no

off

on enables the keyboard and mouse tools. See keyboard and mouse.

VMSANDBOX_WEB_VNET

no

Dedicated host-only VMware network for web sandboxes, for example VMnet9. Setting it (together with the next one) switches web mode on.

VMSANDBOX_WEB_PROXY_HOST

no

This computer's IP address on that network. The proxy listens only there.

VMSANDBOX_WEB_PROXY_PORT

no

3128

Port the proxy listens on.

VMSANDBOX_WEB_PORTS

no

80,443

Destination ports web sandboxes may connect to.

The clones folder, the transfer folder and the base VM folder must not overlap; the server checks this at startup.

Security

The short version of what is enforced in code and covered by tests:

  • Only its own VMs. Every VMware call goes through one wrapper with a command allowlist and a path check. The base VM can only be read and cloned from, never started, changed or deleted.

  • Only what it marked gets deleted. A folder is removed only if the server created and marked it.

  • Isolated before first boot. Shared folders, clipboard, drag-and-drop, USB, CD-ROM and sound are removed from every clone.

  • No network unless asked for, and web mode refuses private addresses, the host's own addresses and non-web ports.

  • One transfer folder. File copies cannot leave it: path traversal, links and hostile archives are rejected.

  • No host shell. Agent-supplied text is never placed on a command line, on the host or in the sandbox.

  • Limits. Timeouts on every command, a cap on sandboxes, automatic removal of old and orphaned ones.

It also has real limits, and they are written down rather than hidden: a sandbox is exactly as contained as a VMware VM, nat mode can reach your local network, and anything that comes out of a sandbox is untrusted. Read the full security model and its limits before pointing it at code you consider hostile.

To report a vulnerability, see SECURITY.md.

Status

Version 0.1. It works and is tested, and it is young.

  • Tested on one setup: Windows 11, VMware Workstation 25H2, Debian 13 guest.

  • Not on PyPI yet.

  • Keyboard and mouse assume a US keyboard layout, and have no scrolling or dragging yet.

  • Planned: isolating web sandboxes from each other, a site allowlist for web mode, scrolling and dragging, a PyPI release.

Bug reports and pull requests are welcome. If this is useful to you, a star helps other people find it.

Development

uv venv
uv pip install -e ".[dev]"
.venv\Scripts\python -m pytest

The unit tests (more than 450) replace the vmrun process with a fake, so the real wrapper and its path guard are exercised in every test and no VMware installation is needed. They run on GitHub Actions on every push.

End-to-end test against your real base VM, with the environment variables set:

.venv\Scripts\python scripts\e2e.py

License

MIT. See LICENSE.

Available Tools

13 tools
sandbox_checkA

Look at a background command started with sandbox_start: is it still running, and what has it printed?

Returns status ("running", "exited" when it ended by itself, or "stopped" when it was killed), exit_code (only when status is "exited"; 0 means success), and stdout and stderr collected so far. If the output is longer than about 1 MB only the newest part is returned, and stdout_truncated / stderr_truncated say so. Calling this does not affect the command; call it again later to see newer output.

Inputs: job_id (required), sandbox_id (required). Returns: object

sandbox_clickA

Click the mouse at a position on a sandbox's screen.

Use this to operate graphical programs: press buttons, open menus, focus a text field before typing. First take a sandbox_screenshot, find the thing to click, and pass its position: x pixels from the left edge and y pixels from the top edge of that image. Take another screenshot afterwards to see the result; screens need a moment to react.

button: "left" (default), "right" or "middle". double: true for a double-click. Only works if the user has switched keyboard and mouse input on; the error says so otherwise. For anything that can be done with a command, sandbox_run is faster and more reliable.

Inputs: x (required), y (required), sandbox_id (required), button, +1 more. Returns: result

sandbox_copy_inA

Copy a file or a whole folder from the user's computer into a sandbox.

Use this to give the sandbox something to work on (a script, a dataset, a project folder). Only things inside the user's designated transfer folder can be copied; nothing else on the user's computer is reachable.

host_path: the file or folder to copy, relative to the transfer folder (for example "data/input.csv" or "myproject"). Paths that leave the transfer folder are rejected. guest_path: full destination path inside the sandbox. For a file, the path of the file itself (for example "/home/debian/input.csv"); its folder must already exist. For a folder, the path the folder should have (for example "/home/debian/myproject"); it is created if missing, and the folder's contents are placed inside it.

Folders are copied with everything in them. Files arrive without the executable flag (use chmod +x if needed). A folder that contains links is refused. Returns a short confirmation with the number of files and the size.

Inputs: host_path (required), guest_path (required), sandbox_id (required). Returns: result

sandbox_copy_outA

Copy a file or a whole folder from a sandbox to the user's computer.

Use this to save results (a report, a built program, a log, an output folder) before destroying the sandbox, since everything inside a sandbox is lost when it is destroyed. Things can only be written inside the user's designated transfer folder.

guest_path: full path of the file or folder inside the sandbox (for example "/home/debian/out.txt" or "/home/debian/build"). host_path: where to save it, relative to the transfer folder (for example "results/out.txt" or "results/build"). Missing folders are created; existing files with the same names are replaced. Paths that leave the transfer folder are rejected.

When copying a folder, its contents are placed inside host_path. Links and files whose names are not valid on the user's computer are left out; the reply says how many. Returns the full path where it was saved, the number of files and the size.

Inputs: host_path (required), guest_path (required), sandbox_id (required). Returns: result

sandbox_createA

Create a fresh, disposable Linux computer (a "sandbox") and wait until it is ready to use.

Use this before running untrusted code, installing packages, or trying anything you would not want to do on the user's real computer. Every sandbox starts from the same clean state and is completely separate from the user's machine and from other sandboxes.

network: "none" (default) gives the sandbox no network at all. Choose another mode only when the task needs to download something:

  • "web": internet for web downloads only (HTTP and HTTPS), and nothing else: the user's own computer and home network stay unreachable. Prefer this. Standard tools (curl, wget, pip, git over https) work as usual; with sudo use sudo -E, for example sudo -E apt-get -y install <package>. ping and non-web protocols do not work. It may not be set up on this computer; the error will say so.

  • "nat": full internet access. It can also reach the user's own computer and home network, so never use it for code you do not trust.

Takes up to a few minutes. Returns the sandbox_id to pass to the other sandbox tools. Destroy the sandbox with sandbox_destroy when you are finished.

Inputs: network. Returns: result

sandbox_destroyA

Shut down a sandbox and permanently delete it and everything inside it.

Use this as soon as you no longer need a sandbox; only a few can exist at once. Copy out any files you want to keep first, because this cannot be undone. Returns a short confirmation.

Inputs: sandbox_id (required). Returns: result

sandbox_keyA

Press a single key or a keyboard shortcut on a sandbox's keyboard.

keys: a key name, or modifiers and a key joined with "+". Examples: "Return", "Escape", "Tab", "ctrl+c", "ctrl+alt+t", "alt+F4", "shift+Tab", "super" (opens the desktop's application search). Modifiers: ctrl, alt, shift, super. Key names: Return, Escape, Tab, Backspace, Delete, Space, Up, Down, Left, Right, Home, End, PageUp, PageDown, Insert, F1 to F12, or any single character.

Inputs: keys (required), sandbox_id (required). Returns: result

sandbox_listA

List the sandboxes that currently exist.

Use this to find a sandbox_id you lost track of, or to check whether old sandboxes should be destroyed. Returns one entry per sandbox with its sandbox_id, network mode ("none" or "nat"), status, and age in seconds. Returns an empty list if there are none.

Inputs: no named parameters. Returns: result

sandbox_runA

Run a shell command inside a sandbox and return what it printed.

Use this to execute code, install packages, inspect files, or do anything else on the sandbox computer. The command is run by bash, so pipes, redirects, && and multi-line scripts all work. Each call starts in the home directory with a fresh shell: files persist between calls, but cd and environment variables do not. The command gets no keyboard input, so use non-interactive flags (for example apt-get -y).

timeout_seconds: how long the command may run (1 to 3600, default 60). When the limit is reached the command is killed and timed_out is true.

Returns stdout, stderr, exit_code (0 means success) and timed_out. Very long output is cut at 1 MB; stdout_truncated / stderr_truncated say when that happened.

Inputs: command (required), sandbox_id (required), timeout_seconds. Returns: object

sandbox_screenshotA

Take a picture of what is currently on a sandbox's screen.

Use this to see things that have no text output: a graphical program, a boot or error screen, or to check what the sandbox is displaying when a command seems stuck. For the output of commands, sandbox_run is faster and more precise.

Returns a PNG image of the sandbox's display at this moment. Positions in this image, counted in pixels from its top-left corner, are what sandbox_click expects.

Inputs: sandbox_id (required).

sandbox_startA

Start a command in a sandbox that keeps running in the background, and return at once.

Use this for things that do not finish on their own or take very long: a web server, a database, a watcher, a long build or download. sandbox_run would wait for them and time out. After starting, use sandbox_run for other commands in the same sandbox (for example to talk to the server you started), sandbox_check to see its output and whether it is still running, and sandbox_stop to end it.

The command is run by bash, starting in the home directory, with no keyboard input. A sandbox can have at most 8 background commands running at once. Background commands end when the sandbox is destroyed.

Returns a job_id to pass to sandbox_check and sandbox_stop.

Inputs: command (required), sandbox_id (required). Returns: result

sandbox_stopA

Stop a background command started with sandbox_start, together with any programs it started.

Use this when you no longer need the command, or to free one of the 8 background slots. Its output stays available through sandbox_check afterwards. Returns a short confirmation, which also says if the command had already ended.

Inputs: job_id (required), sandbox_id (required). Returns: result

sandbox_typeA

Type text on a sandbox's keyboard, as if a person typed it.

The text goes to whatever has keyboard focus on the sandbox's screen, so click the right field first (sandbox_click) and check with sandbox_screenshot. A line break in the text presses Enter, a tab presses Tab. Only plain English keyboard characters can be typed (letters, digits, common symbols), at most 10,000 at a time. For shortcuts and special keys use sandbox_key.

Inputs: text (required), sandbox_id (required). Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 13 tools

    Disambiguation5/5

    Each tool maps to a distinct action in the sandbox lifecycle: foreground execution (sandbox_run) vs background jobs (sandbox_start/sandbox_check/sandbox_stop) are explicitly contrasted in the descriptions, and the GUI trio (screenshot/click/type/key) has clear boundaries. File transfer directions (copy_in vs copy_out) and lifecycle ops (create/list/destroy) are unambiguous.

    Naming Consistency5/5

    Every tool is snake_case with the same 'sandbox_' prefix followed by a clear verb or verb_noun (create, destroy, list, run, start, stop, check, copy_in, copy_out, click, type, key). No mixed conventions or stray casing.

    Tool Count5/5

    13 tools sit squarely in the well-scoped 3-15 range. Each tool covers a necessary facet (lifecycle, command execution, background job handling, file transfer, GUI control) without redundancy.

    Completeness4/5

    Core lifecycle, execution, background job management, bidirectional file transfer, and GUI interaction are all covered, so agents can complete typical workflows. Minor gaps exist—no scroll/drag clipboard actions, no way to change a sandbox's network mode after creation, and file introspection relies on shell commands—but these are workable around.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for building and driving VMware Workstation VMs from an AI agent, enabling unattended OS installs, guest command execution, file transfer, screenshots, and fleet management.
      75 npm
      4
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Gives an AI agent its own fleet of disposable Linux microVMs on hardware you control, with tools to spawn, execute commands in, fork from identical disk states, list, and destroy them. Enables safe parallel exploration and cleanup all within an isolated VM boundary.
      1
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables an LLM agent to control a Windows guest in VMware Workstation, including power and snapshot management, kernel debugging via KDNET or serial, real-time terminal access, file transfer, and console screenshots, with synchronized state across tools.
      33
      2
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to operate disposable Linux computers via MCP, providing tools for shell, file read/write, directory listing, and port exposure. It also supports browser automation and integration with any MCP-compatible client.
      Apache 2.0