302AI Sandbox MCP Server

Official

directRunCode

Execute code in a temporary sandbox, automatically destroying it post-execution. Supports multiple languages, custom environment variables, and optional file download. Ideal for isolated, one-time code runs without persistent sandbox operations.

Instructions

Automatically creates a sandbox, executes code, and immediately destroys the sandbox after execution. Optionally exports sandbox files (compresses multiple files into a zip archive if there are multiple files in the specified path, or exports a single file directly). Recommended for use cases that don't require continuous sandbox operations.

Input Schema

NameRequiredDescriptionDefault
codeYesThe source code to be executed in the sandbox
envsNoEnvironment variables to be set during code execution. Supports passing custom environment variables as key-value pairs
is_downloadNoFlag to indicate whether to download generated files. Must be enabled if the code generates files that need to be retrieved
languageYesThe programming language to execute the code. If not provided or if the value is not in the allowed options, it will be treated as Python code
timeoutNoMaximum execution time in seconds for the sandbox. If code execution exceeds this time, it will be terminated and return a timeout error. Default is 5

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "code": { "description": "The source code to be executed in the sandbox", "type": "string" }, "envs": { "additionalProperties": { "type": "string" }, "description": "Environment variables to be set during code execution. Supports passing custom environment variables as key-value pairs", "type": "object" }, "is_download": { "description": "Flag to indicate whether to download generated files. Must be enabled if the code generates files that need to be retrieved", "type": "boolean" }, "language": { "description": "The programming language to execute the code. If not provided or if the value is not in the allowed options, it will be treated as Python code", "enum": [ "python", "r", "java", "bash", "js" ], "type": "string" }, "timeout": { "description": "Maximum execution time in seconds for the sandbox. If code execution exceeds this time, it will be terminated and return a timeout error. Default is 5", "type": "number" } }, "required": [ "language", "code" ], "type": "object" }

You must be authenticated.

Other Tools from 302AI Sandbox MCP Server

Related Tools

ID: n4r8aw20s4