Runs Python code in isolated Docker containers for secure execution, enabling safe installation of packages and execution of arbitrary Python code
Supports installation and usage of NumPy library in the Python environment as mentioned in the example workflow
Supports installation and usage of pandas library for data analysis as mentioned in the example workflow
Provides an interactive Python code execution environment that allows running Python 3.12+ code with support for package installation and file generation
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
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.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
An interactive Python code execution environment that allows users and LLMs to safely execute Python code and install packages in isolated Docker containers.
Related MCP Servers
- -securityFlicense-qualityProvides isolated Docker environments for code execution, enabling users to create and manage containers, execute multi-language code, save and reproduce development environments, ensuring security and isolation.Last updated -6Python
- -securityAlicense-qualityFacilitates isolated code execution within Docker containers, enabling secure multi-language script execution and integration with language models like Claude via the Model Context Protocol.Last updated -PythonMIT License
- -securityFlicense-qualityA secure Docker-based environment that allows AI assistants to safely execute code without direct access to the host system by running all code within isolated containers.Last updated -1Python
- -securityAlicense-qualityAn interactive Python code execution tool that allows users and LLMs to safely execute Python code and install packages in isolated Docker containers.Last updated -13PythonApache 2.0