Labsco
MCP SERVER · OFFICIAL PROJECT

302AI Sandbox MCP Server

by 302ai

Run code or shell commands in a disposable Linux sandbox — one-shot when a single snippet is all you need, or a named sandbox you keep alive, write files into and export results from.

Sandboxed Code ExecutionVerified
Summary
Two shapes of sandbox in one server: throwaway for a single snippet, persistent when the work takes more than one step.

directRunCode is the entire lifecycle in one call, which suits an ad-hoc calculation; anything with intermediate state goes through createSandbox and carries the sandbox_id from then on. Files cross the boundary explicitly in both directions, and a created sandbox pauses itself, with max_alive_time as the ceiling you set on how long it can come back.

What it is

A hosted Linux sandbox service with nine tools: create sandboxes, run code and commands inside them, move files in and out, and destroy them.

What you get
  • directRunCode creating a sandbox, executing the code and destroying the sandbox in one call, optionally exporting what it produced — several files come back as a zip
  • createSandbox returning the sandbox_id every later call carries, taking a name, environment variables, metadata and a max_alive_time
  • runCode and runCommand executing inside a named sandbox with their own environment and timeout, returning text output only
  • writeSandboxFiles importing files from public URLs or base64, creating missing directories and overwriting anything already there
  • downloadSandboxFiles exporting a file or directory to downloadable URLs, in batches, covering common document, image, audio, video, archive, web and source formats when a directory is exported
  • listSandboxFiles checking a path before a download, and listSandboxes showing what is currently alive under your key
  • killSandbox destroying a sandbox by ID
Requirements

A 302.AI key in 302AI_API_KEY — sandboxes are listed against that key, so it is also what scopes them. Anything that produces files needs the export tools as well: the run tools return text and nothing else.

Setup effort

One command plus a key — npx -y @302ai/sandbox-mcp, then supply credentials