Windows Sandbox MCP
Enables automation of Electron applications by launching with the renderer accessibility flag enabled and using a guest debug port for DOM snapshots, fill, and click actions.
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., "@Windows Sandbox MCP Start a sandbox, run ver, type Hello in Notepad, screenshot it, then stop"
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.
Let Codex, OpenCode, and other local MCP clients work inside Windows Sandbox: run test commands, interact with desktop applications, automate compatible browser pages, and bring screenshots and files back to the agent.
Run Windows commands with stdout, stderr, exit codes, and timeouts.
Use the desktop with native control inspection, mouse input, Unicode text, and shortcuts.
Work with browser forms through optional guest-local DOM snapshots and actions.
Verify what happened with fresh observations, PNG screenshots, and hashed artifacts.
Tested on Windows 10 Pro 22H2 x64. Windows 11 support is being evaluated; it is not yet certified. Compatibility details →
See it working
An actual MCP run, using a synthetic offline page. The client discovers a
field, fills it with MCP-DOM-OK, reads the value back, clicks Apply, and
verifies the changed button state before retrieving the screenshot. No account
or external web service is involved. Capture details.
Reproduce this demo after installation, with no other Sandbox open:
.venv\Scripts\python.exe scripts\check-mcp-live.pyThe runner also checks guest commands, binary transfer, native UIA3 inspection, CDP opt-in enforcement, and native MCP image/resource retrieval. It closes its Sandbox when finished. The page is included in examples/browser-demo.html.
Related MCP server: agentpc
Quick start
You need Windows 10 Pro 22H2 x64, an interactive desktop, Windows Sandbox and virtualization enabled, Git, Python 3.11+, and uv. Run the server as a normal user. Close any manually opened Sandbox first.
git clone https://github.com/xxmisaoxx/windows-sandbox-mcp.git
cd windows-sandbox-mcp
uv sync --frozen
.venv\Scripts\python.exe -m winsandbox_mcp --doctorThis installs from source using the committed dependency lock. The doctor command reports host prerequisites; installation alone does not start a Sandbox. Next, connect your agent below. Full setup and troubleshooting →
Connect your agent
OpenCode
From the repository directory:
.venv\Scripts\python.exe scripts\install-opencode.py
opencode mcp listThe helper adds windows_sandbox, preserves other OpenCode settings, and backs
up an existing config before changing it. Restart an existing OpenCode session
to load the tools. Manual configuration.
Codex
Generate a configuration with the absolute paths of your checkout:
.venv\Scripts\python.exe scripts\client-configs.py
Get-Content .runtime\client-configs\codex-config.tomlCopy the generated [mcp_servers.windows_sandbox] entry into your
~/.codex/config.toml, preserving your existing settings. Reload Codex and check
the server in /mcp. Configuration details.
Your first task
Ask your agent:
Use the windows_sandbox MCP to start a Sandbox, run a command that prints the Windows version, open Notepad, and type “Hello from my agent”. Read the text back to verify it, retrieve and show me a screenshot, then stop the Sandbox. Keep application execution and desktop interaction inside the guest.
The MCP server stays local and speaks stdio. Your agent's usual permissions and model access still apply. You do not need a separate API key for this server.
18 tools, one desktop workflow
Observe → act → observe again. A successful input call means input was submitted; a fresh inspection or screenshot verifies the application result.
Workflow | Tools |
Create and recover a desktop |
|
Run commands and launch apps |
|
Inspect and operate native apps |
|
Work with compatible web pages |
|
Transfer files |
|
Capture and retrieve evidence |
|
Native inspection supports UIA3, managed UIA2, MSAA with optional IA2-role queries, and Win32 controls. Inspection runs in a killable guest worker so a stuck provider can time out without hanging the main agent.
For Chromium/Electron, sandbox_launch(accessibility=true) enables the renderer
accessibility flag on a fresh launch. Opt into a guest debug port to use
sandbox_browser for DOM snapshots, fill, and click. This backend covers ordinary
main-frame DOM; Firefox, closed shadow roots, canvas, and cross-origin frames
need another path. GUI examples and limits →
Tested beyond the happy path
Verification | Recorded result |
Automated tests on Windows 10 | 89 passed, 1 skipped for unavailable symlink privilege |
Live Windows Sandbox integration | 13 steps passed, including crash recovery and restart |
Real MCP stdio client | Commands, native GUI inspection, DOM actions, file transfer, PNG images, and binary resources passed |
Client connections | Codex discovered all 18 tools; OpenCode connected |
Hung accessibility provider | Worker terminated; the guest agent remained usable |
These are recorded runs on the documented Windows 10 machine, not a guarantee for every Windows build or application. GitHub Actions runs unit/protocol, lint, helper compilation, and packaging checks; it does not start a real Sandbox. Reproduce the checks and inspect the measurements →
Isolation you can inspect
The host uses the official Python MCP SDK. The guest uses built-in Windows PowerShell 5.1, .NET Framework, Win32, and UI Automation. GUI observation and input happen inside the guest. There is no host desktop automation fallback.
Default | Behavior |
Networking and redirection | Networking, vGPU, clipboard, printer, audio input, and video input disabled |
Host folder exposure | Only generated read-only inbox and dedicated writable outbox mapped |
Communication | Bounded JSON mailbox; no host bridge listener or guest-to-host execution dispatcher |
Guest runtime | No host Python mapping or runtime guest package downloads |
Artifacts | Host-owned copies with SHA-256 metadata; files limited to 4 MiB per transfer |
Early development. One Sandbox per interactive Windows session. The writable outbox has no enforced disk quota and can fill its host volume; use quota-limited disposable storage for hostile workloads. Opting into networking permits normal host/LAN access. Stopping the guest discards its disk, while host artifacts and retained requests remain. Some longer test sessions showed increased latency. Read the security model, audit, and architecture before running untrusted workloads.
Help shape the next version
The next priorities are Windows 11 lifecycle support, portable GUI fixtures, and better performance in long sessions. Reproducible reports and focused fixes are welcome. Contributing · Report a bug · Request a feature
If a disposable Windows desktop would help your agent, star the repo to follow its progress. Try the demo and tell us what you want to automate next.
Released under the MIT license.
Available Tools
18 toolssandbox_artifactBRead-only
Return PNG as native MCP image or file as base64, with SHA-256 integrity metadata.
Inputs: artifact_id (required).
sandbox_browserCDestructive
Opt-in guest CDP: snapshot DOM targets, click or fill a fresh reference. Requires launch with cdp_port.
Inputs: port (required), text, action, reference, +1 more.
sandbox_clickBDestructive
Click guest physical desktop coordinates from fresh inspection; verify state afterward.
Inputs: x (required), y (required), hwnd, button.
sandbox_collect_evidenceBRead-only
Save screenshot, window list, UI inspection, hashes and host-only observation record.
Inputs: no named parameters.
sandbox_doctorARead-only
Report host prerequisites; does not start Sandbox.
Inputs: no named parameters.
sandbox_downloadBRead-only
Copy a guest C:\work file to a host-owned opaque artifact, at most 4 MiB.
Inputs: path (required).
sandbox_execBDestructive
Run guest PowerShell; bounded stdout/stderr, exit code and timeout status. Children die on completion.
Inputs: command (required), timeout.
sandbox_inspectCRead-only
Inspect via auto/uia3/uia2/ia2/win32 in a killable guest worker. Views: control/raw/content.
Inputs: hwnd, view, backend, timeout, +1 more.
sandbox_keysCDestructive
Send guest shortcut such as CTRL+A, CTRL+S, ALT+F4, ENTER or TAB; verify afterward.
Inputs: chord (required), hwnd.
sandbox_launchCDestructive
Launch guest GUI with quoted arguments. Accessibility adds Chromium flag; CDP port opt-in is guest loopback.
Inputs: cdp_port, arguments, executable, accessibility.
sandbox_restartBDestructive
Destroy current guest and create fresh session. Guest disk is not recovered.
Inputs: memory_mb, networking, startup_timeout.
sandbox_screenshotARead-only
Capture guest virtual desktop as PNG artifact; retrieve image with sandbox_artifact.
Inputs: no named parameters.
sandbox_startCDestructive
Create owned Sandbox. Networking opt-in also exposes guest to the host/LAN.
Inputs: memory_mb, networking, startup_timeout.
sandbox_statusARead-only
Return session state and retained artifact metadata.
Inputs: no named parameters.
sandbox_stopADestructive
Terminate owned Sandbox even after bridge failure; retain evidence on host.
Inputs: no named parameters.
sandbox_textBDestructive
Type Unicode via guest SendInput, at most 16384 UTF-16 characters; no host clipboard.
Inputs: text (required), hwnd.
sandbox_uploadADestructive
Upload at most 4 MiB to guest C:\work. Input is bytes, never a host path.
Inputs: path (required), data_base64 (required).
sandbox_windowsARead-only
Discover visible guest windows and stable-for-current-state hwnd values.
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 18 tools
Most tools have clearly distinct roles, but some pairs (sandbox_screenshot vs sandbox_artifact, sandbox_windows vs sandbox_inspect, sandbox_collect_evidence vs individual capture tools) require careful reading of descriptions to avoid confusion.
All tools use a consistent sandbox_ prefix and snake_case, but suffixes mix verbs and nouns (e.g., sandbox_windows, sandbox_artifact) rather than following a strict verb_noun pattern throughout.
18 tools is slightly above the typical 3-15 range, but the set covers lifecycle, execution, file transfer, GUI automation, and evidence collection without obvious redundancy.
The surface covers core sandbox lifecycle, command execution, file upload/download, screenshot capture, UI inspection, GUI interaction, and evidence collection. Minor gaps like direct guest file management, clipboard access, or snapshot/restore can be worked around via sandbox_exec.
Related MCP Connectors
Windows computers for AI agents. Office, desktop apps, browser tasks, testing and file transfer.
Cloud desktops for AI agents: create a Linux computer, see its screen, click, type and run tasks.
Real desktops for AI agents, on machines you choose: screenshot, type, click, hire more agents.
Persistent Linux computers for AI agents: desktop, signed-in browser, vault, apps and shell.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to safely perform file operations, run terminal sessions, manage processes, search content, and inspect Git repositories on a local Windows machine under configurable permission and audit controls.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to create, drive, checkpoint, reset and delete resettable Windows and Ubuntu desktop VMs on Apple Silicon Macs, giving them real desktops to click, type and screenshot in plus shell commands, file transfer and port forwarding. All processing is local, so agents can work in isolated guests without leaving the Mac.4MIT
- 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
- AlicenseAqualityBmaintenanceEnables AI agents to operate Windows through persistent PowerShell sessions, dual-channel desktop perception, element-level UIA, CDP browser control, verified actions, and failure self-healing.331MIT