home / mcp / 302ai sandbox mcp server

302AI Sandbox MCP Server

302 Sandbox MCP

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "302ai-302_sandbox_mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@302ai/sandbox-mcp"
      ],
      "env": {
        "302AI_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

You can run the 302AI Sandbox MCP Server to safely execute code in isolated sandboxes from your MCP client. It exposes a programmable interface you can connect to from desktop clients or your own tooling, enabling quick creation, management, and execution inside sandboxes without risking your main environment.

How to use

To use this MCP server, configure your MCP client to load the 302AI Sandbox MCP server. You will connect through the stdio-based configuration, which runs locally via a command like npx with the sandbox MCP package. This setup lets you create sandboxes, run code or commands, query sandbox status, import and export files, and destroy sandboxes as needed.

How to install

Prerequisites: you need Node.js and npm installed on your system.

Install dependencies and build the server.

Build and run in development with auto-rebuild.

npm install
```
```bash
npm run build
```
```bash
npm run watch

Additional notes

Configuration examples below show how to connect from common MCP clients. The API key must be provided to authorize access.

Debugging MCP connections can be challenging since communication happens over stdio. Use the MCP Inspector to access debugging tools from your browser.

npm run inspector

Available tools

Create Sandbox

Create a new isolated sandbox environment to run code safely.

Run-Code

Execute code snippets inside a sandbox without affecting the host system.

Run Command Line

Run arbitrary shell commands inside the sandbox.

Query Sandbox List

Retrieve the list of current sandboxes and their statuses.

Destroy Sandbox

Destroy a sandbox and release its resources.

Query File Information

Inspect metadata about files at a specified path within a sandbox.

Import File Data

Import files into a sandbox for execution or analysis.

Export Sandbox Files

Export files from a sandbox for external use.

One-click Code Execution

Execute code with a single action from the MCP client.