An MCP server for Windows Sandbox

Give your AI agent a brand-new Windows PC. Then throw it away.

Your agent can write the app, but it can’t tell you if it runs on a PC that isn’t yours. With sandbox-mcp it can boot a clean Windows 11, run your build, click around and see what happened. Then the machine is deleted.

Your AI agent

Try HelloSandbox on a clean PC. Type my name, click Greet and show me what happens.

  1. sandbox_start{ "network": "off" }

    Clean Windows 11 ready

  2. sandbox_copy_in{ "hostPath": "D:\\HelloSandbox" }

    Build copied in

  3. sandbox_launch{ "path": "C:\\apps\\HelloSandbox\\HelloSandbox.exe" }

    Running as pid 4812

  4. sandbox_ui_tree{ "pid": 4812 }
    Edit #NameBox = "" {setvalue}
    Button "Greet" #GreetButton {invoke}
  5. sandbox_ui_action{ "automationId": "NameBox", "action": "setvalue", "value": "Scott" }
  6. sandbox_ui_action{ "automationId": "GreetButton" }
  7. sandbox_screenshot{ "pid": 4812 }
  8. sandbox_stop{ }

    Sandbox deleted, screenshots kept

It works on a clean PC. I typed Scott, clicked Greet and it said “Hello, Scott!”. The sandbox is gone.

Windows SandboxNetwork off

App running on the sandbox desktop

An illustration, sped up, using the included HelloSandbox sample. The tools are real. The desktop is drawn.
Read the full demo transcript
  1. sandbox_start: clean Windows 11 ready, network off.
  2. sandbox_copy_in: HelloSandbox build copied in.
  3. sandbox_launch: HelloSandbox is running.
  4. sandbox_ui_tree: found the NameBox and Greet button.
  5. sandbox_ui_action: entered Scott, then clicked Greet.
  6. sandbox_screenshot: shows “Hello, Scott!”.
  7. sandbox_stop: sandbox deleted; screenshots kept.

The tools are real. The desktop shown above is drawn.

What it does

Find out what happens on a PC that isn’t yours.

Your machine has every runtime and SDK you ever installed. Your users’ machines don’t.

Test your build sandbox_run

Starting isn’t proof. The included test sets a name, clicks Greet, waits for the exact label and compares a saved file. A missing runtime stays a failure.

> sbx run .\samples\HelloSandbox\bin --test .\samples\HelloSandbox\test.ps1

PASS  HelloSandbox.exe on a fresh Windows Sandbox
  test     test.ps1 passed

> sbx run .\NativeProof.exe --network off
FAIL  NativeProof.exe on a fresh Windows Sandbox (29.8s)
  why      exited with code -1073741515; Missing dependency: VC++ redistributable.
See the actual UI assertions from test.ps1
$app = @{ ProcessId = $env:SBX_APP_PID }
Invoke-SbxUi @app -AutomationId NameBox -Action setvalue -Value 'Sandbox Tester' | Out-Null
Invoke-SbxUi @app -Name Greet | Out-Null
$label = (Wait-SbxUi @app -AutomationId Output -Name 'Hello, Sandbox Tester!' -TimeoutSec 5).name
$file = Join-Path $env:SBX_APP_DIR 'greeting.txt'
if ((Get-Content $file) -ne $label) { throw 'greeting.txt does not match the label' }
'PASS'

The MCP server

Add it to your agent, and your agent can use a Windows PC.

It works with GitHub Copilot, Claude, Cursor, VS Code and anything else that speaks MCP. The agent finds the 27 tools on its own, and screenshots come back inline so it can see what it did.

Your PC

Your agent
MCP adapter
You, or a script
sbx CLI
The engine
Run folderScreenshots and logs you keep

Windows Sandbox

Guest agent
Your app

The CLI

Rather use a terminal? Use sbx.

You don’t have to use MCP. The server is an optional MCP adapter, and sbx uses the same engine, so all of this works from a shell, a script or an agent that can run commands.

# One shot
sbx run .\MyApp.exe --network off
sbx install-test setup.msi
sbx detonate invoice.js

# Keep one around while you work
sbx start --network off
sbx deploy .\bin C:\apps\MyApp --launch MyApp.exe --restart
sbx ui click --name Save
sbx shot
sbx stop

sbx here is sandbox-mcp’s Windows Sandbox CLI. Docker also has its own sbx command for Docker Sandboxes.

Get it

Set it up.

You need Windows 11 24H2 or later on Pro, Enterprise or Education. Turn on Windows Sandbox in an admin PowerShell, restart, then open it from the Start menu once.

Enable-WindowsOptionalFeature -Online -FeatureName Containers-DisposableClientVM -All

Let your agent set it up.

It checks your PC and verifies the download, and it asks before admin changes or a restart. No Node.js install needed.

Setup guide

Give this to your agent

Set up the sandbox-mcp CLI by following:
https://raw.githubusercontent.com/shanselman/sandbox-mcp/main/docs/agent-setup.md
Install the latest verified release. The CLI must work without MCP; configure the optional MCP adapter only if my agent needs it. Ask before admin changes or a restart.

Windows Sandbox

You probably already own it, and it’s probably switched off.

Windows Sandbox comes with Windows Pro, Enterprise and Education. It’s a whole Windows desktop on its own kernel that boots clean in about 15 seconds and is thrown away when it closes. Set network to off and it doesn’t even get a network adapter.

Your PC

Run folderThe sandbox can’t see the rest of your disk
  • →agentread-only
  • →inread-only, files you copy in
  • ←outwritable, so don’t trust what comes back
  • ↔controlencrypted, tied to one boot
  • ×Clipboard, printer, mic, cameraoff

Windows Sandbox

Its own kernelIsolated by the Microsoft hypervisor

This is strong isolation but not a guarantee, so use a dedicated machine for real malware analysis. Security notes.

Compatibility results

App types and packaging tested in Windows Sandbox.

App typePackagingResultBoot / total
WinForms.NET Framework 4.8 EXEPASS15.6 / 41.9 s
WinForms.NET 10 self-contained EXEPASS16.6 / 45.0 s
WPF.NET 10 self-contained EXEPASS16.7 / 45.6 s
Native Win32x64 EXE, static CRTPASS16.1 / 41.6 s
Native Win32Dev-signed MSIXPASS18.0 / 48.2 s
WinUI 3Self-contained EXEPASS14.4 / 42.7 s
WinUI 3Dev-signed MSIXPASS12.7 / 45.4 s

These are specific builds, not a promise that every Windows app runs in Sandbox. Read the full compatibility notes.

Limits

What it won’t do.

  • One sandbox at a time. That’s a Windows Sandbox rule. For many machines, persistence or Linux, use a VM.
  • Needs a logged-in Windows x64 PC. Hosted CI runners can’t boot one.
  • Not every Windows app. Anything that needs special hardware may not run.
  • It won’t install prerequisites unless you ask. A missing one is usually the bug you’re looking for.