302_sandbox_mcp

302_sandbox_mcp

By 302ai GitHub

Create a remote sandbox that can execute code/run commands/upload and download files. 创建远程沙盒,可以执行代码/运行命令/上传下载文件

302ai sandbox
Overview

what is 302AI Sandbox MCP?

302AI Sandbox MCP is a server designed for development and integration with Claude Desktop, allowing users to set up and run a model context protocol (MCP) server.

how to use 302AI Sandbox MCP?

To use the 302AI Sandbox MCP, install the necessary dependencies, build the server, and configure it with your Claude Desktop application by adding the server configuration to the appropriate config file based on your operating system.

key features of 302AI Sandbox MCP?

  • Easy installation and setup for developers
  • Auto-rebuild feature for development
  • Integration with Claude Desktop for enhanced functionality
  • Debugging tools available through MCP Inspector

use cases of 302AI Sandbox MCP?

  1. Developing and testing AI models in a controlled environment.
  2. Integrating custom AI solutions with existing applications.
  3. Debugging and optimizing AI server performance.

FAQ from 302AI Sandbox MCP?

  • How do I install the 302AI Sandbox MCP?

You can install it by running npm install and then build the server with npm run build.

  • Can I use this server on Windows?

Yes! The server can be configured on both MacOS and Windows.

  • Where can I find my API key?

You can find your 302AI_API_KEY here.

Content

🤖 302AI Sandbox MCP Server🚀✨

An MCP service with code sandbox that allows AI assistants to safely execute arbitrary code.

中文 | English | 日本語

Previews

Here are some usage examples

Here is the list of supported tools

✨ Features ✨

  • 🔧 Dynamic Loading - Automatically update tool list from remote server.
  • 🌐 Multi modes supported, you can use stdin mode locally, or host it as a remote HTTP server

🚀 Tool List

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Installation

To use with Claude Desktop, add the server config:

On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json

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

To use with Cherry Studio, add the server config:

{
  "mcpServers": {
    "Li2ZXXJkvhAALyKOFeO4N": {
      "name": "302ai-sandbox-mcp",
      "description": "",
      "isActive": true,
      "registryUrl": "",
      "command": "npx",
      "args": [
        "-y",
        "@302ai/sandbox-mcp@0.2.0"
      ],
      "env": {
        "302AI_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

To use with ChatWise, copy the following content to clipboard

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

Go to Settings -> Tools -> Add button -> Select Import from Clipboard

Find Your 302AI_API_KEY here

Using Tutorials

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:

npm run inspector

The Inspector will provide a URL to access debugging tools in your browser.

✨ About 302.AI ✨

302.AI is an enterprise-oriented AI application platform that offers pay-as-you-go services, ready-to-use solutions, and an open-source ecosystem.✨

  1. 🧠 Integrates the latest and most comprehensive AI capabilities and brands, including but not limited to language models, image models, voice models, and video models.
  2. 🚀 Develops deep applications based on foundation models - we develop real AI products, not just simple chatbots
  3. 💰 Zero monthly fee, all features are pay-per-use, fully open, achieving truly low barriers with high potential.
  4. 🛠 Powerful management backend for teams and SMEs - one person manages, many people use.
  5. 🔗 All AI capabilities provide API access, all tools are open source and customizable (in progress).

Tools

downloadSandboxFiles

Export files from a sandbox directory or file path to downloadable urls. Supports batch export of multiple directories or files. When exporting directories, only common file formats are included (documents, images, audio, video, compressed files, web files, and programming language files).

listSandboxes

Query the list of sandboxes associated with the current API key. If no parameters are passed, all current sandboxes will be returned.

createSandbox

Create a Linux sandbox that can execute code, run commands, upload and download files, and has complete Linux functionality. After successful creation, a sandbox_id will be returned, and all subsequent operations will need to include this sandbox_id to specify the corresponding sandbox. After successful creation, the sandbox will automatically pause. When calling other sandbox operation interfaces later, it will automatically reconnect and pause again after execution to avoid generating extra costs.

killSandbox

Destroy a sandbox by its ID.

directRunCode

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.

writeSandboxFiles

Import files from public URLs or base64 data into a sandbox. Supports batch import of multiple files. If the target file already exists, it will be overwritten. If the target directory doesn't exist, it will be automatically created. You must create a sandbox before calling this tool.

runCommand

Run a command line command on a specific linux sandbox. This returns text output only. For operations that generate files, you'll need to use separate file viewing and download endpoints.

runCode

Run code on a specific sandbox. This returns text output only. For operations that generate files, you'll need to use separate file viewing and export endpoints. Default file saving path is /home/user.

listSandboxFiles

List files and directories at specified paths within a sandbox. Supports batch queries with multiple paths. This operation can be used before downloadSandboxFiles to check if the file exists.
No content found.