302 Sandbox
Run a Meshagent room with the MCP server and interact with its tools:
Environment Variables
302AI_API_KEY
: Your API key for MCP 302 Sandbox. (Required)
Steps
-
Install Meshagent (with all features):
-
Sign Up and Authenticate
Follow instructions to create an account and login: Meshagent CLI Getting Started -
Start MCP Server as a Meshagent Room Agent
- This command launches the MCP server inside a Meshagent room. The room will close automatically if it goes inactive.
-
Join the Room as a Chatbot That Can Use the Toolkit
- The chatbot joins the Meshagent room and can use all the available tools from the MCP 302 Sandbox toolkit.
- You can load multiple toolkits for different capabilities in the same room.
- A link to the room will be displayed after running this command. Use it to interact with the agent and its tools.
Tools Available
Tools provided by the MCP 302 Sandbox Server:
Tool | Short Description |
---|---|
createSandbox | Create a Linux sandbox that can execute code, run commands, upload and download files, and has complete Linux functionality. |
directRunCode | Automatically creates a sandbox, executes code, and immediately destroys the sandbox after execution. |
downloadSandboxFiles | Export files from a sandbox directory or file path to downloadable URLs. |
killSandbox | Destroy a sandbox by its ID. |
listSandboxFiles | List files and directories at specified paths within a sandbox. |
listSandboxes | Query the list of sandboxes associated with the current API key. |
runCode | Run code on a specific sandbox. |
runCommand | Run a command line command on a specific Linux sandbox. |
writeSandboxFiles | Import files from public URLs or base64 data into a sandbox. |
Tools Details
createSandbox
Create a Linux sandbox that can execute code, run commands, upload and download files, and has complete Linux functionality. After creation, a sandbox_id
is returned for further operations. The sandbox will pause automatically to save on costs.
Parameters:
max_alive_time
(integer
): Maximum sandbox lifetime in seconds (recommended: 300)envs
(object
, optional): Environment variablesmetadata
(object
, optional): Sandbox metadatasandbox_name
(string
, optional): Custom sandbox name
directRunCode
Creates a sandbox, runs a code snippet, and destroys the sandbox after execution. Optionally downloads generated files.
Parameters:
code
(string
): Source code to executelanguage
(string
): Programming language (defaults to Python if omitted)envs
(object
, optional): Environment variablesis_download
(boolean
, optional): Enable to download generated filestimeout
(number
, optional): Maximum execution time (default: 5 seconds)
downloadSandboxFiles
Export files or folders from a sandbox to downloadable URLs. Batch export supported; only common file formats are included on directory export.
Parameters:
path
(string
): Path(s) to exportsandbox_id
(string
): Target sandbox ID
killSandbox
Destroys a sandbox by ID.
Parameters:
sandbox_id
(string
): Sandbox ID
listSandboxFiles
List files and folders at specific paths inside a sandbox.
Parameters:
path
(string
)sandbox_id
(string
): Target sandbox ID
listSandboxes
Query all sandboxes for the current API key.
Parameters:
sandbox_id
(string
, optional): Filter by IDsandbox_name
(string
, optional): Filter by custom name
runCode
Run code in a selected sandbox; returns text output.
Parameters:
code
(string
)sandbox_id
(string
)envs
(object
, optional): Environment variableslanguage
(string
, optional): Programming languagetimeout
(integer
, optional): Execution timeout (seconds)
runCommand
Run a shell command in a sandbox; returns text output.
Parameters:
cmd
(string
)sandbox_id
(string
)envs
(object
, optional): Environment variablestimeout
(integer
, optional): Execution timeout (recommended: ≥120s for installs)
writeSandboxFiles
Upload files (via public URLs or base64) into a sandbox.
Parameters:
file_list
(array
): Files to uploadsandbox_id
(string
): Target sandbox
Meshagent Resources
- Main Website: https://www.meshagent.com/
- Getting Started Guide: https://docs.meshagent.com/room_api/get_started
- Room API Overview: https://docs.meshagent.com/room_api/overview
- MCP Tool Docker Image: https://hub.docker.com/r/meshagent/mcp-302_sandbox
Ready to leverage cloud-based sandboxes with your Meshagent room? Start integrating the MCP Server tools in your distributed, multi-agent workflows today!