Integrations
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
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.
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
local-only server
The server can only run on the client's local machine because it depends on local resources.
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
- AsecurityAlicenseAqualityAllows LLMs to execute Python code in a specified Conda environment, enabling access to necessary libraries and dependencies for efficient code execution.Last updated -129JavaScriptMIT License
- -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
- AsecurityAlicenseAqualityA server that provides a persistent Python REPL environment through the MCP protocol, allowing execution of Python code, variable management, and package installation.Last updated -33PythonMIT License