Labsco
Tsuchijo logo

Sandbox MCP Server

โ˜… 17

from Tsuchijo

Provides isolated Docker environments for secure code execution.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

Sandbox MCP Server

An MCP server that provides isolated Docker environments for code execution. This server allows you to:

  • Create containers with any Docker image
  • Write and execute code in multiple programming languages
  • Install packages and set up development environments
  • Run commands in isolated containers

Integration with Claude Desktop

  1. Open Claude Desktop's configuration file:
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  1. Add the sandbox server configuration:
{
    "mcpServers": {
        "sandbox": {
            "command": "uv",
            "args": [
                "--directory",
                "/absolute/path/to/sandbox_server",
                "run",
                "sandbox_server.py"
            ],
            "env": {
                "PYTHONPATH": "/absolute/path/to/sandbox_server"
            }
        }
    }
}

Replace /absolute/path/to/sandbox_server with the actual path to your project directory.

  1. Restart Claude Desktop

Security Notes

  • All code executes in isolated Docker containers
  • Containers are automatically removed after use
  • File systems are isolated between containers
  • Host system access is restricted

Project Structure

sandbox_server/
โ”œโ”€โ”€ sandbox_server.py     # Main server implementation
โ”œโ”€โ”€ pyproject.toml        # Project configuration
โ””โ”€โ”€ README.md            # This file

Available Tools

The server provides three main tools:

  1. create_container_environment: Creates a new Docker container with specified image
  2. create_file_in_container: Creates a file in a container
  3. execute_command_in_container: Runs commands in a container
  4. save_container_state: Saves the container state to a persistent container
  5. export_dockerfile: exports a docker file to create a persistant environment
  6. exit_container: closes a container to cleanup environment when finished