home / mcp / 302ai sandbox mcp server
302 Sandbox MCP
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.
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.
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 watchConfiguration 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 inspectorCreate a new isolated sandbox environment to run code safely.
Execute code snippets inside a sandbox without affecting the host system.
Run arbitrary shell commands inside the sandbox.
Retrieve the list of current sandboxes and their statuses.
Destroy a sandbox and release its resources.
Inspect metadata about files at a specified path within a sandbox.
Import files into a sandbox for execution or analysis.
Export files from a sandbox for external use.
Execute code with a single action from the MCP client.