Win-wrap MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
English | Arabic version · Usage Manual · MCP & Multi-Language Hooks · Technical Architecture · Security Policy
Win-wrap (wwrap) v0.1.1
Run Windows executables, Python scripts, and AI agent tools with bounded user-mode permissions — zero external dependencies, no Docker, no VM, and no Administrator rights.
Inspired by Linux bubblewrap (bwrap), Win-wrap confines child processes on Windows 10 and Windows 11 (x64) using only Python's standard library (>= 3.10) and built-in Windows kernel controls (AppContainer, scoped NTFS permissions, and Job Objects).
Contents
Related MCP server: Smart Assistant MCP
Choose Your Mode
Goal | Integration Mode | Entry Point | End-User Needs Python? |
Confine | 1. Standalone CLI |
| Yes (host running CLI) |
Run plugins, evaluators, or graders from Python code | 2. Python Library |
| Yes (host app env) |
Give AI agents bounded Python/process execution | 3. Built-in MCP Server |
| Yes (or via |
Bundle Windows confinement into C#, Rust, Go, C++, or Node.js apps | 4. Standalone | Download from GitHub Releases (or build once) | No — zero Python needed |
How Win-wrap Fits on Windows
Pure Python Stdlib, Zero Dependencies: Runs directly on Windows
ctypes(kernel32,advapi32,userenv) with zero third-party packages, no Docker daemon, no Hyper-V/WSL2 VM, and no separate runtime service.Windows 10 & 11 (
x64) Without Administrator Setup: Works out of the box under standard non-admin user accounts (no UAC elevation required), automatically mirroring read-only Python runtimes whenC:\Python*lacks non-admin ACL edit rights.Built-in AI Agent MCP Server (
--mcp): Ships a ready-to-use stdio JSON-RPC 2.0 server with default-deny directory rules and operator-enforced memory/time/process ceilings.Standalone Zero-Python
wwrap.exe: Freezes cleanly into a portable--onedir(~17.2 MiB,53files,~140 mswarm latency from a Python-less.NET 10host) or Nuitka--standaloneexecutable bundle for C#, Rust, Go, C++, Node.js, and Electron host apps.
Install
Python CLI & Library (
Python 3.10–3.15on Windows 10/11 x64):
pip install .Portable Mode (Zero Install): Set
$env:PYTHONPATH = "lib"and runpython -m win_wrap ...directly without global installation.Zero-Python Standalone Binary (
wwrap.exe): Download the prebuiltwwrap.exebundle from GitHub Releases (or freeze lib/win_sandbox.py once on a build machine withpyinstaller --onedir --clean --name wwrap lib/win_sandbox.pyor Nuitka--standalonefor fast startup —--onediravoids--onefile's per-run%TEMP%extraction overhead; see USAGE.md).
Quick Start
1. Terminal CLI (wwrap)
# Read C:\work\input (read-only), write ONLY to C:\work\scratch, 512 MB RAM, 10s limit
wwrap --ro-bind C:\work\input --bind C:\work\scratch --cwd C:\work\scratch --mem 512 --timeout 10 -- python C:\work\input\script.py
# Disposable one-shot container (--isolate-session) deleted immediately after exit
win-wrap --isolate-session --bind C:\work\out --cwd C:\work\out --mem 256 --timeout 5 -- cmd.exe /c "echo done > out.txt"2. Python Library (import win_wrap)
from win_wrap import run_python_windows, run_process_windows
# Run Python code via stdin (source stays in memory)
stdout, stderr, rc = run_python_windows(
"import os; print('isolated pid:', os.getpid())",
timeout=15,
memory_limit_mb=512,
max_processes=2,
)
# Run any Windows executable in a disposable one-shot AppContainer
stdout, stderr, rc = run_process_windows(
["cmd.exe", "/c", "ver"],
timeout=10,
memory_limit_mb=256,
max_processes=1,
isolate_session=True,
)When wrapping a Python virtual environment (venv\Scripts\python.exe), set max_processes >= 2 (--max-procs 2) because the Windows venv launcher spawns the base interpreter as a child process (max_processes=1 returns exit code 101).
3. Built-in AI Agent MCP Server (--mcp)
wwrap --mcp --ro-bind C:\work\input --bind C:\work\scratch --cwd C:\work\scratch --mem 512 --timeout 30 --max-procs 2Exposes run_sandboxed_python, run_sandboxed_process, and get_sandbox_policy over stdio JSON-RPC 2.0 while enforcing operator directory allowlists and resource ceilings (pass --isolate-session for strict per-call ACL isolation; when running frozen wwrap.exe --mcp, pass --python <path> to enable run_sandboxed_python). See INTEGRATION_HOOKS_WIN.md for copy-paste Claude Desktop, Cursor, VS Code, Windsurf, and Antigravity configurations plus C#/Rust/Go/C++/Node.js examples for wwrap.exe.
Use Cases
AI Agents & MCP Hosts (
wwrap --mcp): confine LLM-generated scripts and commands with operator-enforced folder rules and hard memory/time caps (25.72 calls/son Win11;11.05–16.31 calls/son Win10). For repeated runs, keep a persistent--mcpor Python host process alive instead of spawning a fresh CLI process per call.Bundling Inside Non-Python Apps (
wwrap.exe): ship a standalone--onediror Nuitka bundle with C#, Rust, Go, C++, Node.js, or Electron desktop apps without requiring Python on customer machines.Python Plugins & Automated Graders (
import win_wrap): isolate evaluator scripts and data processors inline (~10–13 mswarm shared overhead on Win11; pre-warmedisolate_sessionpool for fast disposable runs).Terminal, Automation & CI (
wwrap/win-wrap): wrap compilers, formatters, archives, or CLI utilities cleanly under standard user accounts.Isolated Inspection of Unfamiliar Scripts: inspect or run unfamiliar scripts with bounded user-mode filesystem permissions, no network access (AppContainer), and strict resource/time caps (see SECURITY.md for threat-model boundaries).
How Isolation Works
Unlike Linux bubblewrap (which uses POSIX namespaces), Win-wrap maps practical workflow isolation directly onto standard Windows kernel mechanisms:
No Network by Default: Launches inside a zero-capability Windows AppContainer, causing the kernel and Windows Filtering Platform (WFP) to block outbound, LAN, and loopback sockets.
Bounded Filesystem & Registry: Denies
%USERPROFILE%, drive roots, system paths, UNC paths, and symlinks; grants read (--ro-bind) or write (--bind) only on explicitly requested folders, with automatic user-owned runtime mirroring when host Python installs underC:\lack non-admin ACL edit rights. Registry writes stay isolated to the container's virtual hive.Resource & Tree Limits: Binds suspended processes to a Job Object before resuming execution, capping committed RAM (
--mem), concurrent processes (--max-procs), and wall-clock/CPU time (--timeout) with deterministic tree termination on exit or timeout.UI & Handle Isolation: Restricts inherited handles to only the 3 stdio pipes and blocks desktop/clipboard/window message access (interactive GUI tools and profile/UI/WMI-dependent PowerShell commands are unsupported and may fail under
0xFF, especially on Windows 10, even when simple non-interactive commands likepowershell.exe -NoProfilesucceed on newer Windows 11 builds; standard console binaries work reliably).
For full Win32 struct layouts, ACL bitmasks (0xFF, 0x001200A9, 0x001301FF), SID mechanics, py_mirror details, and full 8-environment Windows 11 (3.13.15) + Windows 10 (3.10.11–3.15.2) multi-binary benchmarks, see WIN_SANDBOX.md and SECURITY.md.
Testing on Windows 10 and 11
The test suite runner ispython tests/test_win_sandbox.py (or python -B tests/test_win_sandbox.py), not unittest discover, and requires Windows 10 or Windows 11 (x64). When invoked on Linux or macOS, both tests/test_win_sandbox.py and run_win_sandbox_check.py detect sys.platform != "win32", print a SKIP notice, and exit cleanly with code 0.
# Standalone self-test suite (196 checks: ABI/mocked kernel + live OS confinement & MCP)
python -B tests/test_win_sandbox.py
# Full diagnostic report + test runner (writes redacted per-version report)
python -B run_win_sandbox_check.py
# Real-world 17-scenario field & benchmark suite
python -B run_win_sandbox_field_test.pyOr double-click RUN_ME.bat (pass --no-pause in CI or scripts) to auto-discover all installed Python 3.10–3.15 runtimes on Windows (even off PATH) and run both verification suites sequentially. Verified PASS=196 FAIL=0 SKIP=0 + PASS=17 FAIL=0 SKIP=0 on Windows 11 (Python 3.13.15, 14.0s field) and across 7 Windows 10 non-admin Python installs (3.10.11, 3.11.9, 3.12.10 ×2, 3.14.10, 3.15.2 ×2; 33–35s check, 17.5–19.3s field). Provided "AS IS" under the MIT License.
Roadmap
Planned post-0.1.x capabilities:
Opt-in Interactive / GUI / PowerShell Mode: Explicit flags to relax
JOB_OBJECT_UILIMIT_ALL(0xFF) or attach a ConPTY (--pty) when wrapping interactive console tools, PowerShell scripts, or controlled GUI workflows.Stricter Isolation Profiles: Support for Less Privileged AppContainer (
--lpac) profiles to further reduce defaultALL APPLICATION PACKAGESread visibility on Windows 10/11.Fine-Grained Capability & Network Controls: Explicit opt-in capability profiles and richer MCP inspection/policy hooks while keeping zero-capability default-deny behavior unchanged.
Documentation Map
Guide (English) | Arabic | Contents |
Overview, quick start, install options, and testing entry points | ||
Step-by-step usage manual, | ||
MCP client JSON configs & C#/Rust/Go/C++/Node.js integration snippets | ||
Deep Win32 architecture, hex ACL masks, | ||
Supported versions, threat model, boundaries, private vulnerability reporting | ||
Contributor rules, fail-closed checks, PR workflow | ||
Release history and verified compatibility notes ( |
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Secure Linux sandboxes for AI agents, as MCP tools.
Run AI agent tasks in isolated sandboxes with a cost cap, saved workflows and scoped connections.
Run commands, code and file operations for AI agents in Cloud Hypervisor microVM sandboxes.
1Beta code sandbox for agents. Run Python or JavaScript with no network and a 30 s timeout.
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 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 AI agents to run cybersecurity reconnaissance and analysis tools through controlled containerized sandboxes, with input validation, policy allowlists, timeouts, structured JSON output, and immutable audit logging.MIT
- AlicenseAqualityBmaintenanceEnables running AI coding agents and MCP servers inside an OS-level least-privilege sandbox that hides credentials and blocks network access by default, with tool firewalling, rug-pull protection, audit logging, and boundary verification.82AGPL 3.0