create_container_environmentLABSCO 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 namecreate_file_in_container— write a file inside itexecute_command_in_container— run commands in the isolated containersave_container_state— commit the container, with its installed packages and files, as a persistent Docker imageexport_dockerfile— emit a Dockerfile that rebuilds the environment, with the base image and created filesexit_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 <YOUR_PATH_TO_SANDBOX_MCP> run sandbox_server.py command in claude_desktop_config.json with PYTHONPATH pointing at the same directory. Package version 0.1.0.
Setup effort
Build from source — git clone https://github.com/Tsuchijo/sandbox-mcp.git
USE CASES
Running code you would not run on your laptop
Spin up a container, write the program into it, execute it, and throw the container away.
Working in a language you have not installed
Start from that language's image and compile and run inside the container instead of setting up a toolchain.
Keeping an environment you built up interactively
Install the packages you needed, then commit the container as a named image to reuse later.
Handing the setup to someone else
Export a Dockerfile that rebuilds the same environment rather than writing install instructions.
6 tools
Listed in project docs. Your client may show a different list.
create_file_in_containerexecute_command_in_containersave_container_stateexport_dockerfileexit_containerBEFORE YOU INSTALL
What to know first
Tools you get
6 tools named in the project's documentation.
Requires
- Python 3.9 or higher
- Docker installed and running
- uv
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
git clone https://github.com/Tsuchijo/sandbox-mcp.git
cd sandbox-mcp
uv venv
uv pip install .MCP Clients
Claude Desktop
{
"mcpServers": {
"sandbox": {
"command": "uv",
"args": [
"--directory",
"<YOUR_PATH_TO_SANDBOX_MCP>",
"run",
"sandbox_server.py"
],
"env": {
"PYTHONPATH": "<YOUR_PATH_TO_SANDBOX_MCP>"
}
}
}
}<YOUR_PATH_TO_SANDBOX_MCP> is the full path of the folder the git clone created. Docker must be running before Claude Desktop starts the server.