opensandbox-mcp
v1.3.0OpenSandbox MCP Sandbox Server (Python)
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
sandbox_create
Create a sandbox and store it in the MCP server session. This allocates a new sandbox instance using the OpenSandbox API and tracks it locally so subsequent tool calls can reuse it. Parameters: image: Container image reference (e.g., "python:3.11"). ctx: MCP context for progress reporting (optional). auth_username: Registry username for private images. auth_password: Registry password/token for private images. timeout_seconds: Sandbox lifetime in seconds (absolute TTL). ready_timeout_seconds: Max…
| Parameter | Type | Description |
|---|---|---|
image * | string | |
auth_password | ||
auth_username | ||
entrypoint | ||
env | ||
extensions | ||
health_check_polling_interval_ms | integer | |
metadata | ||
network_policy | ||
ready_timeout_seconds | number | |
resource | ||
skip_health_check | boolean | |
timeout_seconds | number |
sandbox_connect
Connect to an existing sandbox and store it locally. Use this when a sandbox already exists and you want to use it in this MCP server session without creating a new one. Parameters: sandbox_id: Existing sandbox identifier. connect_timeout_seconds: Max time to wait for readiness. health_check_polling_interval_ms: Interval between health checks in ms. skip_health_check: If True, return before readiness checks complete. Returns: SandboxInfoResponse with: sandbox_id: The sandbox identifie…
| Parameter | Type | Description |
|---|---|---|
sandbox_id * | string | |
connect_timeout_seconds | number | |
health_check_polling_interval_ms | integer | |
skip_health_check | boolean |
sandbox_kill
Terminate a sandbox by ID and remove it from local registry. Parameters: sandbox_id: Target sandbox identifier. Returns: {"status": "killed"} when successful.
| Parameter | Type | Description |
|---|---|---|
sandbox_id * | string |
sandbox_get_info
Fetch sandbox info by ID. Parameters: sandbox_id: Target sandbox identifier. Returns: Sandbox info dict from the SDK.
| Parameter | Type | Description |
|---|---|---|
sandbox_id * | string |
sandbox_list
List sandboxes matching filter criteria. Parameters: ctx: MCP context for progress reporting (optional). filter: SandboxFilter object (states, metadata, page, page_size). Returns: Paginated sandbox list.
| Parameter | Type | Description |
|---|---|---|
filter |
sandbox_renew
Set the sandbox to expire timeout_seconds from now. This replaces the current expiration time instead of adding to it, so a value smaller than the remaining lifetime shortens the sandbox's life. Call sandbox_get_info first and compare expires_at if you only want to extend it. Parameters: sandbox_id: Target sandbox identifier. timeout_seconds: Seconds from now until the sandbox expires. Returns: Renew response dict including new expiration time.
| Parameter | Type | Description |
|---|---|---|
sandbox_id * | string | |
timeout_seconds * | number |
sandbox_get_metrics
Get resource metrics for a sandbox. Parameters: sandbox_id: Target sandbox identifier. connect_if_missing: Connect if sandbox not in local registry. Returns: Metrics dict.
| Parameter | Type | Description |
|---|---|---|
sandbox_id * | string | |
connect_if_missing | boolean |
sandbox_healthcheck
Check if a sandbox is healthy. Parameters: sandbox_id: Target sandbox identifier. connect_if_missing: Connect if sandbox not in local registry. Returns: {"sandbox_id": "...", "healthy": true|false}.
| Parameter | Type | Description |
|---|---|---|
sandbox_id * | string | |
connect_if_missing | boolean |
command_run
Run a command inside a sandbox. Parameters: sandbox_id: Target sandbox identifier. command: Shell command to execute (supports pipes/redirects). background: If True, run asynchronously and return immediately. working_directory: Working directory for the command. connect_if_missing: Connect if sandbox not in local registry. Returns: Execution result with id, exit code, and streamed logs; timing lives on the ``complete`` event (``execution_time_in_millis``). Example: result =…
| Parameter | Type | Description |
|---|---|---|
command * | string | |
sandbox_id * | string | |
background | boolean | |
connect_if_missing | boolean | |
working_directory |
command_interrupt
Interrupt a running command execution. Parameters: sandbox_id: Target sandbox identifier. execution_id: Execution identifier to interrupt. connect_if_missing: Connect if sandbox not in local registry. Returns: {"status": "interrupted"} when successful.
| Parameter | Type | Description |
|---|---|---|
execution_id * | string | |
sandbox_id * | string | |
connect_if_missing | boolean |
command_get_status
Get the status of a command started by command_run. Works for both foreground and background executions. Parameters: sandbox_id: Target sandbox identifier. execution_id: Execution identifier returned by command_run. connect_if_missing: Connect if sandbox not in local registry. Returns: Command status with running flag, exit code, error, and start/finish timestamps. ``running=False`` means the command has finished; check ``exit_code`` and ``error`` for the outcome. ``running=None`` mea…
| Parameter | Type | Description |
|---|---|---|
execution_id * | string | |
sandbox_id * | string | |
connect_if_missing | boolean |
command_get_logs
Read the combined stdout/stderr of a background command. Pass the returned ``cursor`` back on the next call to read only new output; omit it to read from the start of the log. Treat ``cursor`` as an opaque server-side position and never derive it from the content length. Empty ``content`` does not mean the command finished; use command_get_status for that. Each read returns at most one page of 16 MiB, so once command_get_status reports ``running=False``, keep calling this tool with the last cursor until ``content`` is empty and…
| Parameter | Type | Description |
|---|---|---|
execution_id * | string | |
sandbox_id * | string | |
connect_if_missing | boolean | |
cursor |
file_read
Read a text file from the sandbox. Parameters: sandbox_id: Target sandbox identifier. path: File path to read. encoding: Text encoding. range_header: Optional byte range header (e.g., "bytes=0-1023"). connect_if_missing: Connect if sandbox not in local registry. Returns: {"path": "...", "content": "..."}.
| Parameter | Type | Description |
|---|---|---|
path * | string | |
sandbox_id * | string | |
connect_if_missing | boolean | |
encoding | string | |
range_header |
file_write
Write a text file inside the sandbox. Parameters: sandbox_id: Target sandbox identifier. path: Destination file path. content: File content. encoding: Text encoding. mode: Unix file permissions. owner: Owner username. group: Group name. connect_if_missing: Connect if sandbox not in local registry. Returns: {"status": "written"} when successful.
| Parameter | Type | Description |
|---|---|---|
content * | string | |
path * | string | |
sandbox_id * | string | |
connect_if_missing | boolean | |
encoding | string | |
group | ||
mode | integer | |
owner |
file_delete
Delete files inside the sandbox. Parameters: sandbox_id: Target sandbox identifier. paths: File paths to delete. connect_if_missing: Connect if sandbox not in local registry. Returns: {"status": "deleted"} when successful.
| Parameter | Type | Description |
|---|---|---|
paths * | array | |
sandbox_id * | string | |
connect_if_missing | boolean |
file_search
Search for files matching a pattern. Parameters: sandbox_id: Target sandbox identifier. path: Base directory to search. pattern: Glob pattern (e.g., "*.py"). connect_if_missing: Connect if sandbox not in local registry. Returns: List of entry info objects.
| Parameter | Type | Description |
|---|---|---|
path * | string | |
pattern * | string | |
sandbox_id * | string | |
connect_if_missing | boolean |
file_create_directories
Create directories inside the sandbox. Parameters: sandbox_id: Target sandbox identifier. entries: List of directory entries (path, mode, owner, group). connect_if_missing: Connect if sandbox not in local registry. Returns: {"status": "created"} when successful.
| Parameter | Type | Description |
|---|---|---|
entries * | array | |
sandbox_id * | string | |
connect_if_missing | boolean |
file_delete_directories
Delete directories inside the sandbox. Parameters: sandbox_id: Target sandbox identifier. paths: Directory paths to delete. connect_if_missing: Connect if sandbox not in local registry. Returns: {"status": "deleted"} when successful.
| Parameter | Type | Description |
|---|---|---|
paths * | array | |
sandbox_id * | string | |
connect_if_missing | boolean |
file_move
Move or rename files/directories inside the sandbox. Parameters: sandbox_id: Target sandbox identifier. entries: List of move entries (source, destination). connect_if_missing: Connect if sandbox not in local registry. Returns: {"status": "moved"} when successful.
| Parameter | Type | Description |
|---|---|---|
entries * | array | |
sandbox_id * | string | |
connect_if_missing | boolean |
file_replace_contents
Replace content inside files. Parameters: sandbox_id: Target sandbox identifier. entries: List of replace entries (path, old_content, new_content). connect_if_missing: Connect if sandbox not in local registry. Returns: List of replacement results with counts per file.
| Parameter | Type | Description |
|---|---|---|
entries * | array | |
sandbox_id * | string | |
connect_if_missing | boolean |
sandbox_get_endpoint
Get a sandbox network endpoint for a specific port. Parameters: sandbox_id: Target sandbox identifier. port: Port number inside the sandbox. connect_if_missing: Connect if sandbox not in local registry. Returns: Endpoint info dict.
| Parameter | Type | Description |
|---|---|---|
port * | integer | |
sandbox_id * | string | |
connect_if_missing | boolean |