Code Sandbox MCP 🐳
@Automata-Labs-team
An MCP server to create secure code sandbox environment for executing code within Docker containers. This MCP server provides AI applications with a safe and isolated environment for running code while maintaining security through containerization.
Overview
What is Code Sandbox MCP 🐳?
Code Sandbox MCP 🐳 is a secure sandbox environment for executing code within Docker containers. It provides AI applications with a safe, isolated runtime for running code, leveraging containerization to maintain security.
How to use Code Sandbox MCP 🐳?
Install via the quick install script (Linux/macOS: curl -fsSL https://raw.githubusercontent.com/Automata-Labs-team/code-sandbox-mcp/main/install.sh | bash; Windows: irm ... | iex), or download the binary manually. Then configure your MCP‑compatible AI application (e.g., Claude Desktop) to point to the code-sandbox-mcp executable. Use tools like sandbox_initialize, sandbox_exec, copy_project, write_file, copy_file, and sandbox_stop to manage containers and execute code.
Key features of Code Sandbox MCP 🐳
- Flexible container creation and management
- Custom Docker image support as execution environment
- File and directory transfer between host and containers
- Shell command execution within containerized environments
- Real‑time streaming of container logs and output
- Built‑in update checking and automatic binary updates
- Multi‑platform support for Linux, macOS, and Windows
Use cases of Code Sandbox MCP 🐳
- Providing AI coding assistants with a safe environment to run generated code
- Executing user‑submitted code in a sandboxed, temporary container
- Running shell commands without risking the host system
- Testing software builds and scripts in isolated Docker containers
FAQ from Code Sandbox MCP 🐳
What prerequisites are needed to run Code Sandbox MCP 🐳?
Docker must be installed and running on your system. The server works on Linux, macOS, and Windows.
How do I install Code Sandbox MCP 🐳?
Use the quick‑install script for your platform, or download the latest release binary from the GitHub releases page and place it in your PATH.
How do I configure Code Sandbox MCP 🐳 with Claude Desktop?
The installer automatically creates the configuration file. For manual setup, add an entry in your Claude Desktop config file (e.g., ~/.config/Claude/claude_desktop_config.json on Linux) with the path to the code-sandbox-mcp binary.
What tools are available in Code Sandbox MCP 🐳?
The server provides tools to initialize a container (sandbox_initialize), copy files/directories (copy_project, copy_file, write_file), execute commands (sandbox_exec), stop and remove a container (sandbox_stop), and a resource to retrieve container logs (containers://{id}/logs).
How does Code Sandbox MCP 🐳 ensure security?
It uses Docker containers for isolated execution, applies resource limitations through Docker constraints, and separates stdout and stderr streams.