302_sandbox

mcp/302_sandbox Docker Image

302 Sandbox MCP

2 次收藏下载次数: 0状态:社区镜像维护者:mcp(Model Context Protocol)仓库类型:镜像最近更新:

302 Sandbox MCP Server

302 Sandbox MCP.

https://www.anthropic.com/news/model-context-protocol

Characteristics

AttributeDetails
Docker Imagehttps://hub.docker.com/repository/docker/mcp/302_sandbox
Authorhttps://github.com/302ai
Repositoryhttps://github.com/302ai/302_sandbox_mcp
Dockerfilehttps://github.com/302ai/302_sandbox_mcp/blob/main/Dockerfile
Docker Image built byDocker Inc.
Docker Scout Health Score
Verify SignatureCOSIGN_REPOSITORY=mcp/signatures cosign verify mcp/302_sandbox --key https://raw.githubusercontent.com/docker/keyring/refs/heads/main/public/mcp/latest.pub
LicenceMIT License

Available Tools

Tools provided by this ServerShort Description
createSandboxCreate a Linux sandbox that can execute code, run commands, upload and download files, and has complete Linux functionality.
directRunCodeAutomatically creates a sandbox, executes code, and immediately destroys the sandbox after execution.
downloadSandboxFilesExport files from a sandbox directory or file path to downloadable urls.
killSandboxDestroy a sandbox by its ID.
listSandboxFilesList files and directories at specified paths within a sandbox.
listSandboxesQuery the list of sandboxes associated with the current API key.
runCodeRun code on a specific sandbox.
runCommandRun a command line command on a specific linux sandbox.
writeSandboxFilesImport files from public URLs or base64 data into a sandbox.

Tools Details

Tool: 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.

ParametersTypeDescription
max_alive_timeintegerMaximum alive time of the sandbox (seconds), recommand 300.
envsobject optionalEnvironment variables to set (optional)
metadataobject optionalSandbox metadata (optional)
sandbox_namestring optionalCustom sandbox name (optional)

Tool: 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.

ParametersTypeDescription
codestringThe source code to be executed in the sandbox
languagestringThe programming language to execute the code. If not provided or if the value is not in the allowed options, it will be treated as Python code
envsobject optionalEnvironment variables to be set during code execution. Supports passing custom environment variables as key-value pairs
is_downloadboolean optionalFlag to indicate whether to download generated files. Must be enabled if the code generates files that need to be retrieved
timeoutnumber optionalMaximum execution time in seconds for the sandbox. If code execution exceeds this time, it will be terminated and return a timeout error. Default is 5

Tool: 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).

ParametersTypeDescription
pathstringPath(s) to export from the sandbox.
sandbox_idstringThe ID of the sandbox to export files from

Tool: killSandbox

Destroy a sandbox by its ID.

ParametersTypeDescription
sandbox_idstringThe ID of the sandbox to destroy

Tool: 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.

ParametersTypeDescription
pathstring
sandbox_idstringThe ID of the sandbox to query files from

Tool: listSandboxes

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

ParametersTypeDescription
sandbox_idstring optionalFilter by sandbox ID (optional)
sandbox_namestring optionalFilter by sandbox name provided during creation (optional)

Tool: 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.

ParametersTypeDescription
codestringThe code to run
sandbox_idstringThe ID of the sandbox to run the code on
envsobject optionalEnvironment variables to set when running the code
languagestring optionalThe programming language to use. If not specified or if the value is not in the allowed range, it will be treated as Python code.
timeoutinteger optionalThe timeout for code execution in seconds

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.

ParametersTypeDescription
cmdstringThe command line command to run
sandbox_idstringThe ID of the sandbox to run the command on
envsobject optionalEnvironment variables to set when running the command
timeoutinteger optionalThe timeout for command execution in seconds. When installing dependencies or performing similar operations, it is recommended to set it to above 120 seconds.

Tool: 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.

ParametersTypeDescription
file_listarrayList of files to import into the sandbox
sandbox_idstringThe ID of the sandbox to write files to.

Use this MCP Server

json
{
  "mcpServers": {
    "302_sandbox": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "302AI_API_KEY",
        "mcp/302_sandbox"
      ],
      "env": {
        "302AI_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

https://www.docker.com/blog/the-model-context-protocol-simplifying-building-ai-apps-with-anthropic-claude-desktop-and-docker/

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 302_sandbox 镜像标签

docker pull docker.xuanyuan.run/mcp/302_sandbox:<标签>

DockerHub 原生拉取命令

docker pull mcp/302_sandbox:<标签>
专业版 · 高速稳定拉取镜像
50GB 仅 ¥8/年
高速镜像下载在线技术支持专业版保障服务可用付费会员免广告