Labsco
MCP SERVER

Sandbox MCP Server

by Tsuchijo

Isolated Docker containers a model can create, write code into, and run — then save as an image.

Sandboxed Code Execution
Summary
Code runs somewhere it cannot damage anything, and the environment survives if you want it.

The isolation is the obvious part; the reproducibility is the useful part. Being able to install packages interactively, then commit the result as an image or export a Dockerfile, means an exploratory session ends with something you can hand to someone else instead of a transcript of installs.

What it is

An MCP server that gives a model disposable Docker environments. It can start a container from any image, write files into it, run commands, and — when the environment is worth keeping — commit it or export a Dockerfile that recreates it.

What you get
  • `create_container_environment` — a new container from the image you name
  • `create_file_in_container` — write a file inside it
  • `execute_command_in_container` — run commands in the isolated container
  • `save_container_state` — commit the container, with its installed packages and files, as a persistent Docker image
  • `export_dockerfile` — emit a Dockerfile that rebuilds the environment, with the base image and created files
  • `exit_container` — close a container and clean up
  • Containers can be made persistent so they survive the client closing and stay reachable through `docker exec`
Requirements

Python 3.9 or higher, Docker installed and running, and the `uv` package manager. Clone the repo, create the environment with `uv venv`, install with `uv pip install .`, then register the `uv --directory <path> run sandbox_server.py` command in `claude_desktop_config.json` with `PYTHONPATH` pointing at the same directory. Package version 0.1.0.

Setup effort

One command — uvx sandbox-server