
Sandbox Env MCP
io.github.hs3434Published by GitHub account hs3434v0.3.1Updated Oct 25, 2026
Persistent Docker/SSH sandbox for AI agents: shell exec, file ops, audit log.
Overview
Gives an AI assistant persistent shell sessions, file operations and Docker or SSH machine management inside a sandbox.
- What you can do
- Run commands in persistent bash or PowerShell shells, read buffered output, send stdin and manage shell sessions across machines. Read, write, patch and search files on any target machine, with atomic writes and syntax checks for JSON, YAML and TOML. Create, start, stop, restart, remove, build, commit, inspect and view logs of Docker containers. Connect to and disconnect from configured SSH hosts, including Windows targets. Query the audit log of past tool calls when it is stored in SQLite.
- When to use it
- Useful when an assistant needs a real, stateful working environment rather than one-shot commands: keeping virtualenvs and directories between calls, working across several containers or remote hosts, or keeping an auditable record of every action.
- Requirements
- Local Python 3.12+ process with the Docker SDK and a running Docker daemon; SSH mode also needs an openssh-client. Configuration lives in a config file under the user's home directory, with optional environment variable overrides. The HTTP variant uses bearer tokens from a token file.
Installation
In SourceWeft
- Open Sandbox Env MCP in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
sandbox-mcp
MCP server that gives AI agents a real working environment: persistent shells, a filesystem, and multi-machine management — backed by Docker containers or remote SSH hosts.
Features
- Persistent shells — stateful bash or PowerShell sessions that survive across tool calls. Set env vars, activate venvs, change directories, and they stay.
- Multi-machine — manage several Docker containers and SSH hosts simultaneously. Each has its own isolated workspace and shell pool.
- Full filesystem access — read, write, patch, and search files on any target machine. All writes are atomic (temp-file + rename).
- Zero-config startup — creates a default Docker container automatically on first run. One command, ready to go.
- Progressive discovery —
envtool exposes capabilities step by step. Agents callenv(action="help")to see what's available. - Docker lifecycle — create, stop, start, restart, remove containers. Build images, inspect configs, commit state, view logs.
- SSH remote access — connect to Linux and Windows machines over SSH. Windows targets get automatic code-page probing.
- Safety net — sensitive-path warnings (
.ssh,.aws,.env*) without blocking access. Pre-write syntax lint for JSON/YAML/TOML. - Audit trail — every tool call is logged with timestamps, parameters, and outcomes. Queryable from within the agent session.
Quick start
On first run a default container (python:3.14-slim, named admin)
starts automatically with a persistent bash shell. No other setup.
Requirements: Python 3.12+, Docker SDK, running Docker daemon.
SSH mode needs openssh-client.
Tools
All tools target the default machine unless an explicit machine
parameter is passed.
audit_query is exposed when the audit log is a SQLite database —
it lets the agent search historical tool calls.
Shell states
Every shell is in one of four states:
Key shell_exec parameters:
wait(defaulttrue): block until the command completes.timeout(default10s): on expiry returnsstatus="waiting"with a hint to switch towait=false+shell_readfor long-running commands.max_output(default50000bytes): caps returned output; excess is shown as the tail (last N bytes).
env actions
env(action="help") lists what's available. env(action="help", topic="<action>") returns full docs for a specific action.
Always available
Docker
SSH
Available when [ssh.targets] is configured.
File operations
Safety warnings are surfaced for sensitive paths (.ssh, .aws,
.env*, /etc/shadow, etc.) — advisory only, agents still have full
access. Writes to .json, .yaml, .yml, .toml are
syntax-checked before writing (fail-closed).
Configuration
Config lives at ~/.sandbox-mcp/config.toml (copy
config/config.example.toml). Every field can be overridden with
SANDBOX_MCP_<SECTION>_<KEY> env vars.
Backends
Docker
Containers get bind mounts for workspace isolation:
work_home/<name>/→/workspace(rw)work_home/<share_subdir>/→/share/(ro, shared across peers)work_home/<share_subdir>/<name>/→/share/<name>/(rw overlay)
When a container's name matches admin_machine, it also gets
work_home/ → /host (rw) — a global view of all workspaces.
Server startup auto-reconciles with the Docker daemon: surviving containers are re-adopted into the registry.
SSH
Connects over SSH with ControlMaster for connection reuse. Windows targets get automatic code-page probing and encoded-command execution.
Deployment
HTTP mode reads bearer tokens from auth_tokens_file (hot-reload on
every request). If the file is empty or missing and
auto_generate_if_empty=true, a random token is printed to stderr at
startup.
Audit
Every tool call is recorded: timestamp, machine, action, status,
duration, and hashed parameters. Defaults to SQLite at
~/.sandbox-mcp/audit.db. Set log_path="" for JSON-line stderr
output instead.
Source: README.md at commit 939e52c
Tools
0Version history
1- v0.3.1LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts