Cover image
Try Now
2025-03-23

Un serveur MCP pour créer un environnement de sandbox de code sécurisé pour exécuter du code dans des conteneurs Docker. Ce serveur MCP fournit des applications AI avec un environnement sûr et isolé pour l'exécution du code tout en maintenant la sécurité via la conteneurisation.

3 years

Works with Finder

2

Github Watches

15

Github Forks

111

Github Stars

Code Sandbox MCP 🐳

smithery badge

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

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:

  1. Check for Docker installation
  2. Download the appropriate binary for your system
  3. Create necessary configuration files

Manual Installation

  1. Download the latest release for your platform from the releases page
  2. Place the binary in a directory in your PATH
  3. 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_id that 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 call
  • local_src_dir (string, required): Path to a directory in the local file system
  • dest_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 call
  • file_name (string, required): Name of the file to create
  • file_contents (string, required): Contents to write to the file
  • dest_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 call
  • commands (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 call
  • local_src_file (string, required): Path to a file in the local file system
  • dest_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.

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • apappascs
  • Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.

  • ShrimpingIt
  • Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX

  • pontusab
  • La communauté du curseur et de la planche à voile, recherchez des règles et des MCP

  • av
  • Exécutez sans effort LLM Backends, API, Frontends et Services avec une seule commande.

  • jae-jae
  • MCP Server pour récupérer le contenu de la page Web à l'aide du navigateur sans tête du dramwright.

  • ravitemer
  • Un puissant plugin Neovim pour gérer les serveurs MCP (Protocole de contexte modèle)

  • patruff
  • Pont entre les serveurs Olllama et MCP, permettant aux LLM locaux d'utiliser des outils de protocole de contexte de modèle

  • Mintplex-Labs
  • L'application tout-en-un desktop et Docker AI avec chiffon intégré, agents AI, constructeur d'agent sans code, compatibilité MCP, etc.

  • 1Panel-dev
  • 🔥 1Panel fournit une interface Web intuitive et un serveur MCP pour gérer des sites Web, des fichiers, des conteneurs, des bases de données et des LLM sur un serveur Linux.

  • appcypher
  • Serveurs MCP géniaux - une liste organisée de serveurs de protocole de contexte de modèle

    Reviews

    1 (1)
    Avatar
    user_djYbapTa
    2025-04-17

    I've been using code-sandbox-mcp by Automata-Labs-team and it has significantly improved my development workflow. The tool is efficient, user-friendly, and supports a range of programming languages seamlessly. If you're a developer looking to streamline your coding process, I highly recommend checking out their GitHub page.