boxwell-mcp
Allows creating and managing Docker-backed sandbox containers, including command execution, file read/write/listing, background processes, port access, and sandbox destruction.
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.
Boxwell
OpenRouter for sandboxes. One API — and one MCP server — in front of many code-execution sandbox providers, with capability-aware routing, automatic fallback, usage events and built-in benchmarks.
import { Boxwell, DockerProvider, E2BProvider } from "boxwell";
const bw = new Boxwell({ providers: [new E2BProvider(), new DockerProvider()] });
const box = await bw.create({ timeoutSec: 600 }); // E2B, or Docker if E2B is down
await box.writeFile("/work/main.py", "print(sum(range(10)))");
const r = await box.exec("python3 main.py", { cwd: "/work" });
console.log(r.stdout, r.exitCode, box.provider); // "45\n" 0 "e2b"
await box.destroy();Status: 0.1.0, early. The core, the Docker adapter and the MCP server are tested end-to-end. The E2B and Daytona adapters are built against their SDK types and tested with fakes, but not yet verified against the live APIs — see Providers.
Why
AI agents need somewhere safe to run the code they write. Every sandbox vendor has its own SDK, limits, pricing and outages. Boxwell gives you one interface, lets you switch or mix providers with one line, and keeps your agent running when a provider fails.
Without Boxwell | With Boxwell |
One SDK per vendor | One API (TypeScript SDK or MCP) |
Locked in to one vendor | Change provider by name, or let the router choose |
Provider down → agent down | Automatic fallback on retryable errors |
Guessing which is fastest/cheapest |
|
Related MCP server: Sandbox MCP
Install
npm install boxwell
# cloud providers are optional peer dependencies — install the ones you use:
npm install e2b # for E2BProvider
npm install @daytonaio/sdk # for DaytonaProviderRequires Node.js ≥ 22. The Docker provider needs a running Docker daemon.
Providers
Provider | Class | Isolation | Persist | Ports | Status |
Docker (local) |
| Container (shared kernel) | – | ✅ | ✅ Tested end-to-end |
| Firecracker microVM | ✅ | ✅ | ⚠️ Unverified against live API | |
| Provider-managed sandbox | ✅ | ✅ | ⚠️ Unverified against live API | |
Mock (in-memory) |
| – | – | optional | ✅ For tests & demos |
Credentials are read from E2B_API_KEY and DAYTONA_API_KEY (or passed to the constructor).
Adding a provider = one class implementing the SandboxProvider interface (src/types.ts).
Security note: Docker containers share the host kernel. Boxwell applies strict defaults (no network, all capabilities dropped,
no-new-privileges, PID limit), but don't use the Docker provider for hostile code in production — use a microVM provider.
Routing
const bw = new Boxwell({
providers: [e2b, daytona, docker],
strategy: "cheapest", // "priority" (default) | "fastest" | "cheapest" | "round-robin"
fallback: true, // default
cooldownMs: 30_000, // skip a failing provider for a while (still used as last resort)
onEvent: (e) => console.log(e) // create / create_failed / exec / destroy (+ lifetime & estimated cost)
});
await bw.create({ requires: { persist: true } }); // only providers with that capability
await bw.create({ ports: [3000] }); // implies requires.ports
await bw.create({ provider: "docker" }); // force oneFallback happens only at create time and only on retryable errors — outages, rate limits, timeouts, network and auth errors. Invalid requests (bad image, bad arguments) fail immediately because they would fail everywhere. A running sandbox is never moved silently: it has state.
If nothing works you get a
RoutingErrorlisting every attempt.bw.getStats(),bw.health(),bw.list(),bw.connect(provider, id),bw.destroyAll().
Sandbox API
const box = await bw.create({ image: "python:3.12-alpine", ports: [8000], internet: true, env: { DEBUG: "1" } });
await box.exec("pip --version", { cwd: "/", env: {}, timeoutSec: 30, onStdout: (c) => process.stdout.write(c) });
await box.writeFile("/site/index.html", "<h1>hi</h1>"); // string or Uint8Array; parent dirs created
await box.readText("/site/index.html");
await box.listFiles("/site"); // [{ name, path, type, size }]
const p = await box.startProcess("python3 -m http.server 8000", { cwd: "/site" });
await box.waitForPort(8000);
const { url, headers } = await box.getPortUrl(8000); // reachable from your machine
await box.processLogs(p.id); await box.listProcesses(); await box.killProcess(p.id);
await box.destroy();Defaults are secure: no network unless internet: true, and every sandbox you give timeoutSec destroys itself even if your process crashes.
Background processes, file listing and port waiting are implemented once on top of exec, so they behave identically on every provider.
MCP server
boxwell-mcp exposes the router as 13 MCP tools (sandbox_create, sandbox_exec, sandbox_write_file, sandbox_read_file,
sandbox_list_files, sandbox_start_process, sandbox_list_processes, sandbox_process_logs, sandbox_kill_process,
sandbox_get_port_url, sandbox_list, sandbox_destroy, providers_status), with read-only / destructive annotations.
# Claude Code
claude mcp add boxwell -- npx -y -p boxwell boxwell-mcp{
"mcpServers": {
"boxwell": {
"command": "npx",
"args": ["-y", "-p", "boxwell", "boxwell-mcp"],
"env": { "BOXWELL_PROVIDERS": "docker", "E2B_API_KEY": "…" }
}
}
}Env var | Default |
|
|
|
|
|
|
|
|
| off — sandboxes created in a session are destroyed when the client disconnects |
| off — logs routing events to stderr |
Benchmarks
npx -p boxwell boxwell-bench --providers docker,e2b --iterations 10Measures create, first/warm exec, file round-trip, destroy and time to first output (p50/p90), success rate and estimated cost, and writes JSON + Markdown reports. Feed the results back into routing:
import { runBenchmark, latencyHints } from "boxwell";
const report = await runBenchmark([e2b, docker]);
const bw = new Boxwell({ providers: [e2b, docker], strategy: "fastest", latencyHints: latencyHints(report) });Example (Docker, one Linux machine, 10 runs, ms p50 / p90): time to first output 239 / 275, create 163 / 186, warm exec 60 / 82.
Development
npm install
npm run typecheck
npm test # Docker tests auto-skip without Docker; live cloud tests run when keys are in .env
cp .env.example .env # add E2B_API_KEY / DAYTONA_API_KEY for live tests
npm run demo # walkthrough: simulated outage → fallback → run code
npm run mcp # MCP server from source
npm run bench -- --providers dockerRoadmap
Live verification of E2B and Daytona; pause / resume (
persist)A third provider (Modal or Vercel Sandbox)
Public provider leaderboard from scheduled benchmarks
Hosted gateway (one API key, unified billing) — only after real usage
License
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
Run AI agent tasks in isolated sandboxes with a cost cap, saved workflows and scoped connections.
Linux sandboxes for AI agents: run commands and Python or JS, files, ports, pause. E2B-compatible.
Run commands, code and file operations for AI agents in Cloud Hypervisor microVM sandboxes.
Multiplayer task board and agent sandboxes: live previews, isolated databases and verification.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceProvides AI coding agents with a secure, sandboxed environment for executing coding tasks including file operations, command execution, and testing. Features session management, policy enforcement, and Docker-based sandboxing for safe code execution and development workflows.MIT
- AlicenseAqualityBmaintenanceEnables AI coding agents to safely execute commands, run tests, and modify project files inside disposable, policy-enforced Docker sandboxes that are isolated from the host machine and its credentials.15MIT
- AlicenseAqualityBmaintenanceEnables AI coding agents to safely run commands, install dependencies, test, and modify code inside disposable, policy-enforced Docker sandboxes isolated from the host, returning results and diffs.15MIT
- AlicenseAqualityBmaintenanceProvides secure, disposable, resource-bounded container sandboxes that let AI agents create and inspect files, run shell commands with timeouts, and perform Git operations without exposing the host environment.11MIT