Securely runs Python code in isolated Docker containers for safe execution of user and LLM-provided code.
References GitHub for repository access and project management, including compatibility with mission-control-link.
Supports installation and usage of NumPy for scientific computing within the sandbox environments.
Enables data manipulation and analysis by supporting installation and usage of pandas within sandbox environments.
Uses Pydantic models for data validation and structure, as indicated in the project structure.
Provides an interactive Python code execution environment with tools for running code, installing packages, and managing files.
MCP Sandbox
Feel free to try on mcp sandbox
中文文档 | English
Demo
Python MCP Sandbox is an interactive Python code execution tool that allows users and LLMs to safely execute Python code and install packages in isolated Docker containers.
Viby
Viby works with mcp sandbox
Features
🐳 Docker Isolation: Securely run Python code in isolated Docker containers
📦 Package Management: Easily install and manage Python packages
📊 File Generation: Support for generating files and accessing them via web links
Related MCP server: Python MCP Sandbox
Installation
The default SSE endpoint is http://localhost:8000/sse, and you can interact with it via the MCP Inspector through SSE or any other client that supports SSE connections.
Available Tools
create_sandbox: Creates a new Python Docker sandbox and returns its ID for subsequent code execution and package installation
list_sandboxes: Lists all existing sandboxes (Docker containers) for reuse
execute_python_code: Executes Python code in a specified Docker sandbox
install_package_in_sandbox: Installs Python packages in a specified Docker sandbox
check_package_installation_status: Checks if a package is installed or installation status in a Docker sandbox
execute_terminal_command: Executes a terminal command in the specified Docker sandbox. Parameters:
sandbox_id(string),command(string). Returnsstdout,stderr,exit_code.upload_file_to_sandbox: Uploads a local file to the specified Docker sandbox. Parameters:
sandbox_id(string),local_file_path(string),dest_path(string, optional, default:/app/results).
Project Structure
Example Prompt
MCP Example Config
Below is an example config for claude:
MCP Example Config for Online Demo
Modify the serverUrl as needed for your environment.