aliyun-agent-sandbox-mcp

v0.1.0
aliyun-agent-sandbox-mcp Checked 1 day ago Published 18 days ago

MCP server for Alibaba Cloud Agent Sandbox (阿里云智能体沙箱): run commands, execute Python/JS code and manage files in cloud sandboxes via the…

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

sandbox_status Check Agent Sandbox configuration

Show the Alibaba Cloud Agent Sandbox endpoint configuration this server will use (region, domain, API URL, default template) and whether E2B_API_KEY is set. Does not call the network.

sandbox_create Create a sandbox

Create a new Alibaba Cloud Agent Sandbox (阿里云智能体沙箱) and return its sandbox_id. Keep the ID to reuse the sandbox in later tool calls, and call sandbox_kill when done. Defaults to the code-interpreter-v1 template with a 5 minute TTL.

ParameterTypeDescription
envsobjectEnvironment variables injected into the sandbox.
metadataobjectFree-form key/value metadata stored on the sandbox.
templatestringTemplate name or ID. Defaults to E2B_TEMPLATE / code-interpreter-v1.
timeout_msintegerSandbox TTL in milliseconds. Defaults to SANDBOX_TIMEOUT_MS (300000 = 5 minutes).

sandbox_list List sandboxes

List sandboxes in the configured region, optionally filtered by state or template. Note: the control-plane list endpoint is eventually consistent, so a sandbox created moments ago may not appear yet.

ParameterTypeDescription
limitintegerMaximum number of sandboxes to return (default 20).
statestringFilter by state, defaults to "all".
templatestringOnly list sandboxes created from this template.

sandbox_info Inspect a sandbox

Return state, template, resource size and expiry for one sandbox.

ParameterTypeDescription
sandbox_id *stringSandbox ID, e.g. sbx-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (returned by sandbox_create).

sandbox_kill Kill a sandbox

Terminate a sandbox immediately and release its resources. Irreversible.

ParameterTypeDescription
sandbox_id *stringSandbox ID, e.g. sbx-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (returned by sandbox_create).

sandbox_set_timeout Extend the sandbox TTL

Update the time-to-live of a running sandbox so long jobs are not reaped while they run.

ParameterTypeDescription
sandbox_id *stringSandbox ID, e.g. sbx-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (returned by sandbox_create).
timeout_ms *integerNew TTL in milliseconds.

run_command Run a shell command

Run a shell command inside the sandbox and return stdout, stderr and the exit code. When sandbox_id is omitted a temporary sandbox is created for the call and killed afterwards.

ParameterTypeDescription
command *stringShell command to run, e.g. "ls -la /home/user".
cwdstringWorking directory for the command.
envsobjectExtra environment variables for the command.
sandbox_idstringReuse this sandbox instead of creating a temporary one.
timeout_msintegerSandbox TTL and command timeout in milliseconds.

run_code Execute code in the sandbox

Execute Python/JavaScript/TypeScript/Bash/R/Java in the sandbox Jupyter kernel and return stdout, stderr, rich results and any error traceback. Requires a code-interpreter template. When sandbox_id is omitted a temporary sandbox is created and killed afterwards.

ParameterTypeDescription
code *stringSource code to execute.
languagestringExecution language, defaults to "python".
sandbox_idstringReuse this sandbox instead of creating a temporary one.
timeout_msintegerSandbox TTL in milliseconds. Defaults to SANDBOX_TIMEOUT_MS (300000 = 5 minutes).

file_read Read a file

Read a text file from the sandbox. Use offset/limit to page through large files.

ParameterTypeDescription
path *stringAbsolute path inside the sandbox, e.g. /home/user/main.py.
limitintegerMaximum number of lines (default 2000).
offsetinteger0-based line offset (default 0).
sandbox_idstringSandbox ID, e.g. sbx-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (returned by sandbox_create).

file_write Write a file

Create or overwrite a file inside the sandbox. Parent directories are created automatically.

ParameterTypeDescription
content *stringFull UTF-8 file content.
path *stringAbsolute path inside the sandbox, e.g. /home/user/main.py.
appendbooleanAppend instead of overwriting (implemented as read + write).
sandbox_idstringSandbox ID, e.g. sbx-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (returned by sandbox_create).

file_list List a directory

List the entries of a directory inside the sandbox with type and size.

ParameterTypeDescription
path *stringDirectory path, e.g. /home/user.
sandbox_idstringSandbox ID, e.g. sbx-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (returned by sandbox_create).

file_make_dir Create a directory

Create a directory (recursively) inside the sandbox.

ParameterTypeDescription
path *stringDirectory path to create.
sandbox_idstringSandbox ID, e.g. sbx-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (returned by sandbox_create).

file_remove Remove a file or directory

Delete a file or directory inside the sandbox. Irreversible.

ParameterTypeDescription
path *stringPath to delete.
sandbox_idstringSandbox ID, e.g. sbx-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (returned by sandbox_create).

file_rename Rename or move a path

Rename or move a file or directory inside the sandbox.

ParameterTypeDescription
from *stringExisting path.
to *stringNew path.
sandbox_idstringSandbox ID, e.g. sbx-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (returned by sandbox_create).