shanselman/sandbox-mcp

Fresh, throwaway Windows machines for testing your apps: an MCP server and CLI that automate Windows Sandbox

sandbox-mcp — A disposable Windows PC for your AI agent

What it is: A tool that gives your AI agent (or you, via a command line) a real, brand-new Windows 11 machine to test software on — then throws that machine away. It’s not a virtual desktop or a container pretending to be Windows; it’s a full, isolated Windows instance that boots in about 15 seconds, is clean every time, and is deleted when you close it.

Why it exists: Developers often say “it works on my machine” because their PC has every runtime, library, and setting they ever installed. Customers’ machines don’t. sandbox-mcp uses Windows Sandbox (a built‑in Windows feature) to give you a pristine “customer PC” to test your app on — without needing to download a huge VM image or maintain a separate environment.

What you can do with it

  • Clean‑machine smoke tests: Check if your app even starts without the VC++ runtime, .NET runtime, or WebView2 you forgot to bundle. sbx run tells you, with a screenshot and crash events.
  • Test installers and uninstallers: sbx install-test setup.msi installs on a clean machine, uninstalls, and reports every file, registry key, service, scheduled task, and autorun the installer added — and what the uninstaller forgot to remove.
  • Drive the UI with UI Automation, not pixels: Read the control tree (e.g., Button "Save" #SaveButton {invoke}), set text, click, toggle, select, wait for results. Works for WinForms, WPF, Win32, and WinUI apps, and even File Explorer. Screenshots, mouse, and keyboard are available for everything else.
  • Let an agent close the loop: “Build it, test it on a clean machine, look at the screenshot, fix it, repeat” — without the agent touching your real desktop.
  • Run with no network at all: --network off boots the sandbox with no network adapter. Control still works through a shared folder, so you can watch offline behavior or open something you don’t trust.
  • Detonate untrusted files: sbx detonate invoice.js runs it in a sandbox with no network and reports every process it started, names it looked up, addresses it tried, and any autoruns, scheduled tasks, services, or files it planted. Then the whole machine is deleted.
  • Collect evidence: Every run keeps screenshots, copied‑out files, a markdown report, and an audit log on the host after the sandbox is gone.

How it works

  • Windows Sandbox is a real Windows desktop that comes with Windows Pro/Enterprise/Education. It boots from your installed Windows, is isolated on its own kernel behind the Microsoft hypervisor, and is deleted when closed.
  • sandbox‑mcp adds orchestration: it deploys your app into the sandbox, runs UI Automation, performs clean‑machine checks, and saves durable evidence.
  • It uses a shared folder for communication, so the sandbox can stay network‑off while still receiving commands and returning results.
  • The CLI (sbx) works standalone. An optional MCP adapter exposes the same tools to AI agents that support MCP (e.g., VS Code, GitHub Copilot, Claude Desktop). Both use the same engine.
  • Dependency handling: By default, nothing is installed implicitly. You can explicitly opt in to provision runtimes (e.g., --provision auto or a list like vcredist:x64). Downloads happen on the host, are verified (SHA‑512 hashes or Microsoft Authenticode signatures), and are cached. A provisioned run is clearly marked PROVISIONED (not a clean‑machine test).

Requirements

  • Windows 11 24H2 (build 26100) or later, Pro, Enterprise, or Education edition. (Windows Home and Server cannot run Windows Sandbox.)
  • Virtualization enabled in UEFI/BIOS (Intel VT‑x or AMD‑V).
  • At least 4 GB RAM (8 GB recommended), 2 CPU cores, and 1 GB free disk.
  • If running inside a VM, nested virtualization must be enabled on the host.
  • The portable ZIP bundles Node.js, so no separate Node.js installation is needed.

Getting started

  1. Download the Windows x64 portable ZIP from the latest release and extract it. Verify the .sha256 file first.
  2. Enable Windows Sandbox (if not already on): run Enable-WindowsOptionalFeature -Online -FeatureName Containers-DisposableClientVM -All in an admin PowerShell, then restart. After restart, open Windows Sandbox from the Start menu once to update it and install the wsb command‑line tool.
  3. Run the readiness check: sbx doctor — it tells you what’s missing and how to fix it.
  4. Try a built‑in app: sbx run C:\Windows\System32\charmap.exe --open — this boots a fresh sandbox, runs Character Map, and opens a report with screenshots.

Key facts from the README

  • The measured GUI samples take roughly 40–50 seconds end to end.
  • The tool is free (uses your existing Windows license) and runs offline/local.
  • It supports one sandbox at a time (no parallel instances).
  • It is not a promise that every Windows app or hardware‑dependent workload works — see the compatibility evidence for what was actually tested.
  • The project is open‑source; you can install from source with git clone and npm ci.

For full details, see the project website and the README.


This explanation is based solely on the README provided.

Related

  • Project
  • Project
  • Project
  • Project