sandbox-win-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@sandbox-win-mcp spin up a clean Windows sandbox, install my app, screenshot the result, then tear it down"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
sandbox-win-mcp
A hardened Windows Sandbox MCP server. Give your AI agent a brand-new Windows PC — then throw it away.
A real, disposable Windows 11 machine: boot it, deploy your app, drive the controls, catch the
crash, keep the evidence, delete the PC. One MCP tool call or sbx run.
This is the hardened edition of shanselman/sandbox-mcp v1.2.0 (MIT), evolved — not rewritten — from the upstream codebase after live testing on Windows 11 Pro build 26300 surfaced concrete gaps (see docs/upstream-audit.md for the full per-file audit and the ten live lessons that drive the roadmap).
What it keeps from upstream
stdio MCP server (Node 20+) with 34 tools + the
sbxCLI sharing the same stateguest agent = PowerShell + native UI Automation (zero runtime installs in the guest)
control channel: TCP (network on) or HKDF-encrypted shared-folder mailbox (offline)
hardened
.wsbdefaults: no clipboard/printer/mic/camera redirection, Protected Clientevidence pipeline: screenshots, HTML/MP4 recordings,
audit.jsonl, reports under a per-runout/directory with a manifest — everything survives guest teardown
What the hardening adds (roadmap)
Milestone | Theme | Highlights |
M0 ✅ | Bootstrap | fork + audit + reproducible smoke tests ( |
M1 ✅ | Reliability | doctor v2 (App-Execution-Alias resolution, pending-reboot state, caught a real one live), janitor for headless |
M2 🟢 | Input engine |
|
M3 ✅ | Power features | CDP passthrough ( |
M4 ✅ | Delivery | CHANGELOG, parity notes vs upstream v1.2.0 (grounded in diff stats), feature catalog with per-feature evidence, portable release artifact built + smoke-tested ( |
Non-goals: multi-guest concurrency (Windows allows one sandbox — we queue politely), malware verdicts (detonate stays heuristic), non-Windows hosts.
Related MCP server: RelayMe
Quick start
Requirements: Windows 11 Pro/Enterprise/Education 24H2+ (build 26100+), Windows Sandbox enabled,
Node.js 20+. Run sbx doctor first — it checks all of this and tells you how to fix what's missing.
npm install
npm test # unit suite (no sandbox needed)
npm run test:handshake # MCP stdio handshake: initialize + tools/list (no sandbox needed)
node src/cli.js doctor # is this PC ready?Live smoke (boots a real sandbox, ~1 min): npm run smoke.
MCP configuration
{
"mcpServers": {
"sandbox-win-mcp": {
"command": "node",
"args": ["C:/path/to/sandbox-win-mcp/src/server.js"]
}
}
}Or the CLI: node src/cli.js help.
Security posture
Guest outputs are untrusted data, always. Everything written to the run
out/folder is guest-writable; treat copied-out files as attacker-controlled.SANDBOX_MCP_ALLOWED_ROOTS(semicolon-separated) restricts which host paths may be copied into a sandbox. Empty means unrestricted — and says so: while it is empty, everysandbox_copy_in/sandbox_deployresult carries an explicit unrestricted-roots warning. Host-side reads of guest output are always confined to the run directory;sandbox_copy_outresults are markeduntrusted: true.One-shot reports (
sandbox_run,sandbox_install_test,sandbox_detonate) write BOTH report.md and a versioned report.json envelope (sandbox-win-mcp/<flow>-report@1).The offline control channel is HKDF-derived, AES-256-CBC + HMAC-SHA256 framed, with replay protection and agent identity pinning (protocol version + SHA-256 of staged agent files).
Detonate reports are heuristics, never a safety verdict.
Upstream attribution
Forked from sandbox-mcp v1.2.0
(commit b5ea2b2), MIT — copyright and license terms in LICENSE. The original architecture,
guest agent and evidence pipeline are preserved deliberately; upstream's docs and compatibility
measurements remain under docs/. This project's changes are tracked in the fork's
history and summarized per release in parity notes (M4).
License
MIT — see LICENSE.
Available Tools
34 toolssandbox_app_errorsApplication errors in sandboxA
Error and critical events from the sandbox Application event log (crashes, .NET unhandled exceptions, side-by-side errors).
Inputs: since.
sandbox_clickClick in sandboxA
Click at a point. By default x/y are pixel coordinates in the most recent sandbox_screenshot image. Prefer sandbox_ui_action when the target control has a name: it is more reliable than pixels.
Inputs: x (required), y (required), button, double, +2 more.
sandbox_copy_inCopy into sandboxA
Copy a host file or folder (e.g. your build output) onto the sandbox local disk. Sources are confined to SANDBOX_MCP_ALLOWED_ROOTS when it is set; when it is empty the copy proceeds but the result carries an unrestricted-roots warning.
Inputs: hostPath (required), sandboxPath.
sandbox_copy_outCopy out of sandboxA
Copy a file or folder from the sandbox back to the host (into the run outDir/files). The result is marked untrusted: the guest writes that share, so treat every copied-out file as attacker-controlled. The destination is confined to the run out directory.
Inputs: sandboxPath (required), name.
sandbox_deployDeploy changed build outputA
Explicit warm-sandbox inner loop: transfer only added/changed files, delete removed files, verify all destination SHA256 hashes. Requires an already running sandbox. Rejects links/reparse points and build output that changes while staging. copy_in still does a full replace.
Inputs: hostPath (required), args, launch, restart, +1 more.
sandbox_depsDiagnose application dependenciesA
Host-only static scan of PE imports, .NET runtime configs, AppxManifest and scripts. Does not boot a sandbox, execute the app or install anything. Unknown/dynamic dependencies still require runtime observation.
Inputs: path (required).
sandbox_desktop_releaseRelease sandbox desktopB
End this workflow desktop turn immediately instead of waiting for its four-second idle grace.
Inputs: no named parameters.
sandbox_detonateRun an untrusted file and report what it doesA
One shot: boot a fresh sandbox (no network adapter by default), turn on Windows process, connection and DNS auditing, run the file the way a double-click would, watch it, then destroy the sandbox. Reports every process it started (with command lines), names it looked up, connections it tried, files/registry/autoruns/services/scheduled tasks it changed, windows and screenshots, plus plain-language findings (heuristics, not a verdict). Fails if a sandbox is already running.
Inputs: file (required), args, full, keep, +3 more.
sandbox_diffDiff two sandbox snapshotsB
What changed between two snapshots: installed programs, services/drivers, autorun/environment values, files and registry keys added/removed/changed. New folders and keys are collapsed to their topmost new parent. Markdown.
Inputs: to (required), from (required), max.
sandbox_dragDrag in sandboxA
Mouse-down at (x1,y1), animated move to (x2,y2), mouse-up — for grid selection, sliders, file lists and splitter moves. By default raw sandbox screen pixels; with coordinates='screenshot', pixels in the most recent sandbox_screenshot (or the one named by captureId); both endpoints are mapped.
Inputs: x1 (required), x2 (required), y1 (required), y2 (required), +3 more.
sandbox_edge_debugGuest Edge with DevTools (CDP) reachable from the hostA
Launch guest Microsoft Edge with --remote-debugging-port on its own profile and relay the DevTools endpoint to the sandbox IP (CDP binds 127.0.0.1 in the guest; a netsh portproxy bridges it). Returns the HTTP base URL plus the browser/protocol versions from /json/version — a host-side browser-use agent can then drive the guest at DOM level via /json/list and the websocket debugger URLs. Needs a sandbox started with network on or firewall.
Inputs: port, startUrl.
sandbox_execRun command in sandboxA
Run a command in the sandbox (elevated admin user session) and wait for it. Returns stdout, stderr and exit code. Use sandbox_launch for GUI apps or anything long-running. The sandbox has Windows PowerShell 5.1 and .NET Framework 4, but no Store apps (no Notepad, Calculator, Terminal) and no winget.
Inputs: command (required), cwd, shell, timeoutSec.
sandbox_guest_rebootReboot the guest in placeA
Restart Windows INSIDE the running sandbox: same sandbox id, same run artifacts, in-guest state persists (since 22H2) - the right move after an installer that demands a reboot. The agent is re-injected and verified against the same epoch (identity pinned); the usually-changed IP is learned automatically. Not available with network=off.
Inputs: timeoutSec, idleMinutes.
sandbox_install_testTest an installer in a fresh sandboxA
One shot: boot a fresh sandbox, snapshot, run the installer silently, snapshot, optionally run a test script, uninstall using what the installer registered in Add/Remove Programs, snapshot again, destroy the sandbox. Reports exactly what the install added (files, registry, services, autoruns, scheduled tasks, processes left running) and what the uninstaller left behind. If an installer hangs (usually a dialog waiting for a click), it is screenshotted and its controls are listed. Fails if a sandbox is already running.
Inputs: installer (required), args, keep, test, +6 more.
sandbox_janitorDetect and clear orphaned sandboxesA
Detect a headless Windows Sandbox (vmmemWindowsSandbox alive without a client process - it holds the one-sandbox slot and ignores sandbox_stop). With fix:true: graceful platform stop for listed ids, client-process teardown, then a CmService restart fallback; if elevation is required it returns the exact elevated command instead of failing silently.
Inputs: fix.
sandbox_launchLaunch app in sandboxB
Start a program (e.g. a GUI app) on the sandbox desktop without waiting for it to exit. Returns its pid.
Inputs: cwd, args, path, aumid, +1 more.
sandbox_processCheck launched processA
Is a process started with sandbox_launch still running? Returns hasExited, exitCode and its main window title.
Inputs: pid (required).
sandbox_process_killKill processes in sandboxA
Terminate guest processes: exactly one of pid (from sandbox_launch) or name (e.g. "msedge", "notepad"). Force-terminates; returns the stopped pid(s).
Inputs: pid, name.
sandbox_provisionExplicitly provision dependencies into a started sandboxA
OPT IN only. Host downloads official Microsoft runtime installers, verifies published hashes when available and Microsoft Authenticode signatures, then copies and silently installs in the already-started guest. Works with guest networking off. This is no longer a clean-machine test.
Inputs: app (required), provision (required).
sandbox_record_startRecord sandbox desktopB
Capture bounded desktop evidence in an independent guest process, including during long exec calls. Frames and metadata stream to the host share; no guest dependencies or network needed.
Inputs: fps, maxFrames, maxDurationSec.
sandbox_record_stopPublish sandbox recordingA
Stop the tracked recorder and publish a self-contained HTML flipbook, plus MP4 when host ffmpeg is available. Keeps raw frames and manifest even on failure. Also publishes partial evidence after a guest crash.
Inputs: no named parameters.
sandbox_runTest an app in a fresh sandboxA
One shot: boot a fresh sandbox, copy the app folder in, run it, screenshot it, check for crashes, optionally run a PowerShell test script inside, copy files out, destroy the sandbox and write report.md. Use this for "does my build work on a clean Windows machine?". Fails if a sandbox is already running.
Inputs: app (required), exe, args, cert, +12 more.
sandbox_screenshotScreenshot sandboxA
Capture the sandbox desktop, or one window by title/pid. Returns a preview image; the full-resolution PNG is saved on the host. sandbox_click coordinates refer to this image by default.
Inputs: pid, name, maxWidth, windowTitle.
sandbox_scrollScroll in sandboxA
Mouse-wheel scroll at a point: positive notches scroll up (left with horizontal=true), negative scroll down/right. One notch is one wheel detent (~3 lines of text). Default raw sandbox screen pixels; coordinates='screenshot' maps pixels in the most recent screenshot (or captureId).
Inputs: x (required), y (required), notches (required), captureId, +2 more.
sandbox_smart_clickSmart click (UIA-first)A
Click a control by selector using the UIA-first strategy ladder: Invoke/Toggle/Select/ExpandCollapse pattern, then the legacy IAccessible default action, then UIA focus + Enter (activates web content that ignores synthesized mouse input), then a focus-verified SendInput click at the element. Reports every attempt, the winning strategy and an effect check (element gone / state changed). Prefer this over pixel sandbox_click; querying the element also wakes Chromium accessibility, which makes web pages drivable.
Inputs: pid, name, index, verify, +4 more.
sandbox_snapshotSnapshot sandbox stateA
Record files (Program Files, ProgramData, user profiles, drivers, scheduled tasks, top of C:\ and System32), all HKLM\SOFTWARE and HKCU\Software keys, services/drivers, autoruns, environment and Add/Remove Programs entries under a name. Known Windows background noise is filtered out. Takes ~15s. Compare two with sandbox_diff.
Inputs: name (required), exclude.
sandbox_startStart Windows SandboxA
Boot a fresh, ephemeral Windows Sandbox (clean Windows install, elevated admin user) and connect the guest agent. Only one sandbox can exist at a time; everything inside is destroyed by sandbox_stop. Takes ~20-40s. Host-side artifacts (screenshots, copied-out files, audit log) stay in runDir after the sandbox is gone.
Inputs: vGpu, window, network, internet, +2 more.
sandbox_statusSandbox statusA
Show the current sandbox (id, boot epoch, verified agent protocol/version/SHA256, network mode, run folder) and whether the guest agent responds.
Inputs: no named parameters.
sandbox_stopStop Windows SandboxA
Stop and destroy the sandbox. Returns the host folder holding artifacts (screenshots, copied-out files).
Inputs: force.
sandbox_typeSend keys in sandboxA
Type text or send key chords to the focused window (or a window found by title/pid, which is focused first). mode is explicit: 'text' types the string exactly as-is; 'keys' is SendKeys syntax ({ENTER}, {TAB}, ^s, %{F4}). Prefer semantic actions (sandbox_smart_click, sandbox_ui_action setvalue) over raw typing.
Inputs: keys (required), mode (required), pid, literal, +1 more.
sandbox_ui_actionAct on a UI controlA
Find a control by name / automationId / controlType (any combination) and act on it through UI Automation: click (Invoke, Toggle, Select or ExpandCollapse as appropriate, else a real mouse click), doubleclick, rightclick, setvalue (type into an edit box), toggle, select, expand, collapse, focus, or read (just return its state). Use sandbox_ui_tree first to see names. If a click opens a modal dialog the result is {pending:true}; that is fine.
Inputs: pid, name, index, value, +4 more.
sandbox_ui_treeUI Automation treeA
Read the accessibility (UI Automation) tree of an app in the sandbox: one line per control with type, "name", #automationId, = value, [x] toggle state and {available actions}. Much cheaper and more precise than a screenshot for finding controls. Without pid/windowTitle it reads every top-level window (can be large).
Inputs: pid, json, depth, maxNodes, +1 more.
sandbox_ui_waitWait for a UI controlA
Wait until a control matching name / automationId / controlType appears (e.g. a result label, a dialog, a finished state). Returns the element, or an error after timeoutSec.
Inputs: pid, name, timeoutSec, controlType, +2 more.
sandbox_windowsList sandbox windowsA
List top-level windows on the sandbox desktop (pid, process, title, screen rect).
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 34 tools
Most tools have clearly distinct purposes: lifecycle, file transfer, process execution, GUI interaction, snapshots, and one-shot workflows are separated well. Some boundaries blur among sandbox_click, sandbox_smart_click, and sandbox_ui_action, and the one-shot tools intentionally duplicate sequences of lower-level tools, but the descriptions provide guidance.
All tools use a consistent sandbox_ prefix and snake_case naming, with no camelCase or style mixing. Minor deviations exist because several names are noun-like (sandbox_status, sandbox_screenshot, sandbox_ui_tree) rather than strict verb_noun patterns.
34 tools is heavy for an MCP server, and although the domain is broad, several clusters could be consolidated, especially the multiple UI clicking/automation variants and the one-shot workflows that overlap with manual tool sequences. The count exceeds the typical 25+ threshold for being too many.
The surface is exceptionally complete for Windows sandbox automation: lifecycle control, dependency scanning, provisioning, file transfer, process execution, GUI/UIA automation, screenshots and recording, snapshots and diffs, install testing, detonation, and recovery tools are all present. Obvious operation gaps are minimal for the stated purpose.
Maintenance
Related MCP Connectors
Cloud Linux VMs for your agent: run code, Docker, files and HTTPS previews in a Sandboxer microVM.
Cloud desktops for AI agents: create a Linux computer, see its screen, click, type and run tasks.
Windows computers for AI agents. Office, desktop apps, browser tasks, testing and file transfer.
Persistent Linux computers for AI agents: desktop, signed-in browser, vault, apps and shell.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables autonomous desktop automation by delegating tasks to vision-based agents operating within cloud-based virtual machine sandboxes. It allows users to manage VMs, execute complex computer tasks, and receive text-based screen summaries across Linux, Windows, and macOS environments.2-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to safely run bounded, sandboxed tasks on remote machines with persistent state and reviewable artifacts.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to safely work on Windows developer workstations through governed, project-scoped filesystem access, durable command execution, bounded search, Windows operations, and resource-aware runtime controls. It also supports optional developer-context backends for code navigation, repository graph exploration, and memory retrieval.1Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables an AI agent to inspect and operate a remote Windows machine over a private tailnet, listing and reading files, transferring and mutating them within a configured sandbox root, capturing screenshots, and — only when explicitly double-opted-in — executing commands and sending keystrokes. It runs self-hosted with no third-party client or vendor cloud in the session path, and reports its live policy rather than asserting its own safety.MIT