python
Execute Python code in an isolated Linux VM sandbox. Control timeout and sandbox selection for secure script execution.
Instructions
Execute Python code in the sandbox (python3 is pre-installed in the default mcp-dev image).
Args: code: Python code to execute. timeout: Max seconds to wait (default 30). sandbox: Named sandbox to use (default "default")
Returns: Script output with stdout, stderr, exit code, and execution time.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| timeout | No | ||
| sandbox | No | default |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |