aliyun-agent-sandbox-mcp
v0.1.0MCP 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.
| Parameter | Type | Description |
|---|---|---|
envs | object | Environment variables injected into the sandbox. |
metadata | object | Free-form key/value metadata stored on the sandbox. |
template | string | Template name or ID. Defaults to E2B_TEMPLATE / code-interpreter-v1. |
timeout_ms | integer | Sandbox 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.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Maximum number of sandboxes to return (default 20). |
state | string | Filter by state, defaults to "all". |
template | string | Only list sandboxes created from this template. |
sandbox_info Inspect a sandbox
Return state, template, resource size and expiry for one sandbox.
| Parameter | Type | Description |
|---|---|---|
sandbox_id * | string | Sandbox 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.
| Parameter | Type | Description |
|---|---|---|
sandbox_id * | string | Sandbox 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.
| Parameter | Type | Description |
|---|---|---|
sandbox_id * | string | Sandbox ID, e.g. sbx-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (returned by sandbox_create). |
timeout_ms * | integer | New 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.
| Parameter | Type | Description |
|---|---|---|
command * | string | Shell command to run, e.g. "ls -la /home/user". |
cwd | string | Working directory for the command. |
envs | object | Extra environment variables for the command. |
sandbox_id | string | Reuse this sandbox instead of creating a temporary one. |
timeout_ms | integer | Sandbox 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.
| Parameter | Type | Description |
|---|---|---|
code * | string | Source code to execute. |
language | string | Execution language, defaults to "python". |
sandbox_id | string | Reuse this sandbox instead of creating a temporary one. |
timeout_ms | integer | Sandbox 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.
| Parameter | Type | Description |
|---|---|---|
path * | string | Absolute path inside the sandbox, e.g. /home/user/main.py. |
limit | integer | Maximum number of lines (default 2000). |
offset | integer | 0-based line offset (default 0). |
sandbox_id | string | Sandbox 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.
| Parameter | Type | Description |
|---|---|---|
content * | string | Full UTF-8 file content. |
path * | string | Absolute path inside the sandbox, e.g. /home/user/main.py. |
append | boolean | Append instead of overwriting (implemented as read + write). |
sandbox_id | string | Sandbox 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.
| Parameter | Type | Description |
|---|---|---|
path * | string | Directory path, e.g. /home/user. |
sandbox_id | string | Sandbox 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.
| Parameter | Type | Description |
|---|---|---|
path * | string | Directory path to create. |
sandbox_id | string | Sandbox 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.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path to delete. |
sandbox_id | string | Sandbox 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.
| Parameter | Type | Description |
|---|---|---|
from * | string | Existing path. |
to * | string | New path. |
sandbox_id | string | Sandbox ID, e.g. sbx-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (returned by sandbox_create). |