MCP

Execute Code Securely in Isolated Containers

Securely execute code in isolated Docker containers. Supports Linux, macOS, and Windows.

Works with docker

90
Spark score
out of 100
Updated 4 months ago
Version 1.0.0
Models

Add to Favorites

Why it matters

Provide AI applications with a secure and isolated environment for code execution using Docker containers. This asset enables flexible container management, custom environment support, and efficient file operations for seamless code integration.

Outcomes

What it gets done

01

Initialize and manage isolated Docker environments for code execution.

02

Copy project files and write individual files within the sandbox.

03

Execute commands and stream logs in real-time from the isolated environment.

04

Stop and remove sandbox containers after execution.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-code-sandbox-mcp | bash

Capabilities

Tools your agent gets

sandbox_initialize

Initializes a new compute environment for code execution using the specified Docker image

copy_project

Copies a directory to the sandbox file system

write_file

Writes a file to the sandbox file system

sandbox_exec

Executes commands in the isolated environment

copy_file

Copies a single file to the sandbox file system

sandbox_stop

Stops and removes the running sandbox container

Overview

code-sandbox-mcp MCP Server

What it does

Provides an isolated and secure environment for code execution through Docker containers. Installation can be done quickly via script:

curl -fsSL https://raw.githubusercontent.com/Automata-Labs-team/code-sandbox-mcp/main/install.sh | bash

Or manually by downloading the release, placing the binary in your PATH, and making it executable. Configuration for Claude Desktop is also provided:

{
    "mcpServers": {
        "code-sandbox-mcp": {
            "command": "/path/to/code-sandbox-mcp",
            "args": [],
            "env": {}
        }
    }
}

Features include flexible container management, custom environment support using any Docker image, file operations, command execution within the containerized environment, real-time logging, auto-updates, and cross-platform support. Requires installed and running Docker.

How it connects

2024-05-15T18:00:00Z

Source README

A secure isolated environment for code execution in Docker containers, providing AI applications with isolated and secure code execution through containerization.

Installation

Quick Install (Linux/macOS)

curl -fsSL https://raw.githubusercontent.com/Automata-Labs-team/code-sandbox-mcp/main/install.sh | bash

Quick Install (Windows)

irm https://raw.githubusercontent.com/Automata-Labs-team/code-sandbox-mcp/main/install.ps1 | iex

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): chmod +x code-sandbox-mcp

Configuration

Claude Desktop (Linux)

{
    "mcpServers": {
        "code-sandbox-mcp": {
            "command": "/path/to/code-sandbox-mcp",
            "args": [],
            "env": {}
        }
    }
}

Claude Desktop (macOS)

{
    "mcpServers": {
        "code-sandbox-mcp": {
            "command": "/path/to/code-sandbox-mcp",
            "args": [],
            "env": {}
        }
    }
}

Claude Desktop (Windows)

{
    "mcpServers": {
        "code-sandbox-mcp": {
            "command": "C:\\path\\to\\code-sandbox-mcp.exe",
            "args": [],
            "env": {}
        }
    }
}

Available Tools

Tool Description
sandbox_initialize Initializes a new compute environment for code execution using the specified Docker image
copy_project Copies a directory to the sandbox file system
write_file Writes a file to the sandbox file system
sandbox_exec Executes commands in the isolated environment
copy_file Copies a single file to the sandbox file system
sandbox_stop Stops and removes the running sandbox container

Features

  • Flexible container management: Create and manage isolated Docker containers for code execution
  • Custom environment support: Use any Docker image as a runtime environment
  • File operations: Simple 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 checks and automatic binary updates
  • Cross-platform: Supports Linux, macOS, and Windows
  • Container log resource: Dynamic resource providing access to container logs
  • Isolated execution environment using Docker containers
  • Resource constraints through Docker container limits

Notes

Requires installed and running Docker. The installer automatically checks Docker installation and creates necessary configuration files. Container logs are available as a dynamic resource at 'containers://{id}/logs' with MIME type 'text/plain'.

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.