Code Sandbox MCP
A secure sandbox for executing code in Docker containers, providing a safe environment for AI applications.
Code Sandbox MCP 🐳
A secure 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.
🌟 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
🚀 Installation
Prerequisites
- Docker installed and running
Quick Install
Linux, MacOS
curl -fsSL https://raw.githubusercontent.com/Automata-Labs-team/code-sandbox-mcp/main/install.sh | bash
Windows
# Run in PowerShell
irm https://raw.githubusercontent.com/Automata-Labs-team/code-sandbox-mcp/main/install.ps1 | iex
The installer will:
- Check for Docker installation
- Download the appropriate binary for your system
- Create necessary configuration files
Manual Installation
- Download the latest release for your platform from the releases page
- Place the binary in a directory in your PATH
- Make it executable (Unix-like systems only):
chmod +x code-sandbox-mcp
🛠️ Available Tools
sandbox_initialize
Initialize a new compute environment for code execution. Creates a container based on the specified Docker image.
Parameters:
image(string, optional): Docker image to use as the base environment- Default: 'python:3.12-slim-bookworm'
Returns:
container_idthat can be used with other tools to interact with this environment
copy_project
Copy a directory to the sandboxed filesystem.
Parameters:
container_id(string, required): ID of the container returned from the initialize calllocal_src_dir(string, required): Path to a directory in the local file systemdest_dir(string, optional): Path to save the src directory in the sandbox environment
write_file
Write a file to the sandboxed filesystem.
Parameters:
container_id(string, required): ID of the container returned from the initialize callfile_name(string, required): Name of the file to createfile_contents(string, required): Contents to write to the filedest_dir(string, optional): Directory to create the file in (Default: ${WORKDIR})
sandbox_exec
Execute commands in the sandboxed environment.
Parameters:
container_id(string, required): ID of the container returned from the initialize callcommands(array, required): List of command(s) to run in the sandboxed environment- Example: ["apt-get update", "pip install numpy", "python script.py"]
copy_file
Copy a single file to the sandboxed filesystem.
Parameters:
container_id(string, required): ID of the container returned from the initialize calllocal_src_file(string, required): Path to a file in the local file systemdest_path(string, optional): Path to save the file in the sandbox environment
sandbox_stop
Stop and remove a running container sandbox.
Parameters:
container_id(string, required): ID of the container to stop and remove
Description: Gracefully stops the specified container with a 10-second timeout and removes it along with its volumes.
Container Logs Resource
A dynamic resource that provides access to container logs.
Resource Path: containers://{id}/logs
MIME Type: text/plain
Description: Returns all container logs from the specified container as a single text resource.
🔐 Security Features
- Isolated execution environment using Docker containers
- Resource limitations through Docker container constraints
- Separate stdout and stderr streams
🔧 Configuration
Claude Desktop
The installer automatically creates the configuration file. If you need to manually configure it:
Linux
// ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"code-sandbox-mcp": {
"command": "/path/to/code-sandbox-mcp",
"args": [],
"env": {}
}
}
}
macOS
// ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"code-sandbox-mcp": {
"command": "/path/to/code-sandbox-mcp",
"args": [],
"env": {}
}
}
}
Windows
// %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"code-sandbox-mcp": {
"command": "C:\\path\\to\\code-sandbox-mcp.exe",
"args": [],
"env": {}
}
}
}
Other AI Applications
For other AI applications that support MCP servers, configure them to use the code-sandbox-mcp binary as their code execution backend.
🛠️ Development
If you want to build the project locally or contribute to its development, see DEVELOPMENT.md.
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
相關伺服器
Scout Monitoring MCP
贊助Put performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
贊助Access financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
MCP LLaMA
An MCP server with weather tools and LLaMA integration.
Python Weather Server
A FastAPI-based server that provides weather information from the National Weather Service API, secured with OAuth 2.1.
Sugar
Autonomous AI development system for Claude Code with task queue management and workflow automation.
Web3 Playground & Sandbox - Learn, Develop, Test MCP Servers + Toolkit SDK
Free Solidity compiler & Web3 IDE with interactive tutorials. Learn blockchain development, deploy smart contracts to 8+ chains (Ethereum, Polygon, Base, Arbitrum, Solana). Templates for tokens, NFTs, DeFi, DAOs. Monaco Editor, AI assistance, WCAG accessible. Remix alternative. Gas optimization, MetaMask integration, open source. Beginner-friendly. MCP toolkit.
Remote MCP Server (Authless)
An authentication-free, remote MCP server deployable on Cloudflare Workers or locally via npm.
Memorix
Cross-agent memory bridge with knowledge graph, workspace sync, and auto-memory hooks. Supports Windsurf, Cursor, Claude Code, Codex, and VS Code Copilot.
Frank Bria MCP Server
A remote MCP server deployable on Cloudflare Workers without authentication.
Tableau MCP
A suite of tools for developers to build AI applications that integrate with Tableau.
Kali AI Pentest MCP Tools
An AI penetration testing tool that uses natural language to operate various security tools like nmap, sqlmap, and metasploit.
vHAL MCP Server
Search Android Vehicle Hardware Abstraction Layer (vHAL) documentation and source code from a local repository clone.