code-sandbox-mcp

code-sandbox-mcp

An MCP server to create secure code sandbox environment for executing code within Docker containers.

287
Stars
33
Forks
20
Releases

Overview

Code Sandbox MCP is a secure, Docker-based sandbox for AI apps to safely execute arbitrary code in isolated containers. It provides flexible container management using any Docker image as the execution environment, along with file transfer between host and sandbox and the ability to run shell commands inside the container. Real-time logging streams stdout and stderr, enabling live monitoring of activities. The MCP includes auto-updates for the binary and update checks, and it is multi-platform (Linux, macOS, Windows). It exposes a set of tooling commands such as sandbox_initialize (default image python:3.12-slim-bookworm), copy_project, write_file, copy_file, sandbox_exec, and sandbox_stop to manage the lifecycle of sandboxes. A Container Logs Resource at containers://{id}/logs provides access to logs as text. Security is emphasized by isolated execution environments and resource constraints. The project offers installer-based and manual installation methods, and config integration with Claude Desktop, allowing other AI apps to use code-sandbox-mcp as the execution backend.

Details

Owner
Automata-Labs-team
Language
Go
License
MIT License
Updated
2025-12-07

Features

Flexible Container Management

Create and manage isolated Docker containers for code execution.

Custom Environment Support

Use any Docker image as your execution environment.

File Operations

Easy file and directory transfer between host and containers.

Command Execution

Run any shell commands within the containerized environment.

Real-time Logging

Stream container logs and command output in real-time.

Auto-Updates

Built-in update checking and automatic binary updates.

Multi-Platform

Supports Linux, macOS, and Windows.

Container Logs Resource

Access container logs via a dynamic resource path containers://{id}/logs (text/plain).

Tags

dockersandboxcontainerizationcode executionsecurityloggingfile transfermulti-platformLinuxmacOSWindows