bonya-mcp
v1.0.3Model Context Protocol server for the Bonya Compute REST API — manage sandboxes, sessions, files, previews, and jobs from any MCP client.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
sandbox_create Create a sandbox
Create a new sandbox (an isolated cloud compute environment) from a template. By default returns immediately with the sandbox in 'creating' state (202); pass wait=true to block until it is ready (201). With template_id: only env and secret_sets may be added (not image, snapshot or network), and pass wait=true so the template's previews are created. To host a website that must come back by itself after a cold pause, use an image template (see the server instructions), not the default template.
| Parameter | Type | Description |
|---|---|---|
env | object | Optional environment variables set in the sandbox. |
gpu | object | Optional GPU request, for a GPU sandbox. Pick a type/count from sandbox_gpu_options (an empty list means no GPU capacity is available). Requires an `image` (or an image template); cannot be combined w… |
image | string | Optional public OCI image reference (tag or digest) to create the sandbox from instead of a template. Cannot be combined with snapshot, template_id or template_version. Required for GPU sandboxes unle… |
name | string | Optional display label (not unique; every lookup is by sandbox_id). |
network | object | Network egress policy for the sandbox. |
secret_sets | array | Optional secret set names to inject into the sandbox (see secret_set_list). |
snapshot | string | Optional snapshot id to restore the new sandbox from (see snapshot_list). |
template_id | string | Optional template id. Omit to use the deployment default. Use template_list to discover available templates. |
template_version | string | Optional specific template version. Defaults to the template's latest. |
wait | boolean | If true, block until the sandbox is ready instead of returning immediately. |
sandbox_list List sandboxes
List sandboxes, optionally filtered by state. Paginated.
| Parameter | Type | Description |
|---|---|---|
include_disposable | boolean | Include disposable (job-created) sandboxes in the listing. |
page_size | integer | Page size (default 50). |
page_token | string | Pagination token from a previous response. |
states | array | Filter to these states. Deleted sandboxes are not listed. |
sandbox_get Inspect a sandbox
Fetch the current state of a single sandbox by id.
| Parameter | Type | Description |
|---|---|---|
sandbox_id * | string | The sandbox id (e.g. as returned by sandbox_create or sandbox_list). |
sandbox_delete Delete a sandbox
Permanently and synchronously delete a sandbox. Deleting an already-deleted sandbox succeeds (idempotent). This cannot be undone.
| Parameter | Type | Description |
|---|---|---|
sandbox_id * | string | The sandbox id (e.g. as returned by sandbox_create or sandbox_list). |
sandbox_exec Run a command in a sandbox
Run a command in a sandbox and wait for it to finish (buffered, non-interactive). Returns exit code, stdout, and stderr. For long-running or interactive processes, use session_create instead. A process started here (including in the background) ends when the sandbox is paused cold and is not restarted.
| Parameter | Type | Description |
|---|---|---|
cmd * | array | Command and arguments, e.g. ["bash","-lc","echo hi"] or ["ls","-la"]. |
sandbox_id * | string | The sandbox id. |
env | object | Extra environment variables. |
output_encoding | string | Encoding for the returned stdout/stderr. Defaults to utf8. |
path | string | Working directory inside the sandbox. |
stdin_b64 | string | Base64-encoded bytes to write to the command's stdin. |
timeout_s | integer | Max seconds to wait for the command to finish (1-300). |
fs_read Read a file from a sandbox
Read a file's raw bytes from a sandbox and return its UTF-8 text content.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path to read inside the sandbox. |
sandbox_id * | string | The sandbox id. |
fs_write Write a file in a sandbox
Write UTF-8 text content to a file in a sandbox, creating or overwriting it.
| Parameter | Type | Description |
|---|---|---|
content * | string | UTF-8 text content to write. |
path * | string | Destination path inside the sandbox. |
sandbox_id * | string | The sandbox id. |
fs_list List a directory in a sandbox
List the entries of a directory in a sandbox.
| Parameter | Type | Description |
|---|---|---|
path * | string | Directory path inside the sandbox. |
sandbox_id * | string | The sandbox id. |
fs_stat Stat a file in a sandbox
Get metadata (kind, size, mode, modified time) for a path in a sandbox.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path inside the sandbox. |
sandbox_id * | string | The sandbox id. |
fs_mkdir Create a directory in a sandbox
Create a directory (and any missing parents) in a sandbox.
| Parameter | Type | Description |
|---|---|---|
path * | string | Directory path to create inside the sandbox. |
sandbox_id * | string | The sandbox id. |
fs_rename Rename or move a file in a sandbox
Rename or move a file or directory within a sandbox.
| Parameter | Type | Description |
|---|---|---|
from * | string | Existing path inside the sandbox. |
sandbox_id * | string | The sandbox id. |
to * | string | New path inside the sandbox. |
fs_delete Delete a file in a sandbox
Delete a file or directory in a sandbox. Pass recursive=true to delete a non-empty directory.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path to delete inside the sandbox. |
sandbox_id * | string | The sandbox id. |
recursive | boolean | Delete directories recursively (default false). |
session_create Create a session
Create a named, long-lived session running a command in a sandbox. Unlike sandbox_exec, the session keeps running in the background; use session_list to check on it and session_kill to stop it. Creating a session with a name that already has a live session fails with session_exists (409) unless replace is set, which replaces a terminal (finished) session of the same name. A session survives a warm pause but ends when the sandbox is paused cold and is not restarted.
| Parameter | Type | Description |
|---|---|---|
cmd * | array | Command and arguments, e.g. ["bash","-lc","npm run dev"]. |
name * | string | The session name (unique per sandbox). |
sandbox_id * | string | The sandbox id. |
cols | integer | Terminal columns. |
env | object | Extra environment variables. |
path | string | Working directory inside the sandbox. |
replace | boolean | Replace an existing terminal (finished) session of the same name. |
rows | integer | Terminal rows. |
session_list List sessions
List sessions for a sandbox. Never wakes a suspended sandbox; a suspended sandbox answers from its suspend snapshot (sandbox_suspended: true in the response).
| Parameter | Type | Description |
|---|---|---|
sandbox_id * | string | The sandbox id. |
session_kill Kill a session
Terminate a named session. Sends a signal (default TERM) and, after grace_ms, escalates. Returns the session's resulting state.
| Parameter | Type | Description |
|---|---|---|
sandbox_id * | string | The sandbox id. |
session_name * | string | The session name (unique per sandbox). |
grace_ms | integer | Grace period before escalation in ms (default 5000, max 60000). |
signal | string | Signal to send (default TERM). |
preview_create Create a preview
Create a preview URL that proxies to a port inside a sandbox, so a running service can be reached over the web. A 'private' preview (default) also returns a grant whose token and exchange_url are shown only in this response; open exchange_url once in a browser to get access. A 'public' preview needs no token.
| Parameter | Type | Description |
|---|---|---|
port * | integer | Port inside the sandbox to expose. |
sandbox_id * | string | The sandbox id. |
auth | string | 'private' (default) requires a grant token; 'public' is open. |
ttl_seconds | integer | Grant lifetime in seconds (0 or omitted uses the service default). |
preview_list List previews
List all previews for a sandbox. Never returns grant tokens.
| Parameter | Type | Description |
|---|---|---|
sandbox_id * | string | The sandbox id. |
preview_get Inspect a preview
Fetch a single preview by id.
| Parameter | Type | Description |
|---|---|---|
preview_id * | string | The preview id (e.g. pv-...). |
sandbox_id * | string | The sandbox id. |
preview_delete Delete a preview
Delete a preview by id, immediately disabling its URL. Returns the deleted preview.
| Parameter | Type | Description |
|---|---|---|
preview_id * | string | The preview id (e.g. pv-...). |
sandbox_id * | string | The sandbox id. |
preview_grant_create Create a preview access grant
Create a new access grant for a private preview. The token and exchange_url are shown only in this response.
| Parameter | Type | Description |
|---|---|---|
preview_id * | string | The preview id (e.g. pv-...). |
sandbox_id * | string | The sandbox id. |
ttl_seconds | integer | Grant lifetime in seconds (0 or omitted uses the service default). |
preview_grant_list List preview access grants
List a preview's access grants. Tokens are never returned here.
| Parameter | Type | Description |
|---|---|---|
preview_id * | string | The preview id (e.g. pv-...). |
sandbox_id * | string | The sandbox id. |
preview_grant_renew Renew a preview access grant
Extend an access grant's lifetime.
| Parameter | Type | Description |
|---|---|---|
grant_id * | string | The grant id. |
preview_id * | string | The preview id (e.g. pv-...). |
sandbox_id * | string | The sandbox id. |
ttl_seconds | integer | Grant lifetime in seconds (0 or omitted uses the service default). |
preview_grant_revoke Revoke a preview access grant
Revoke an access grant so its token stops working.
| Parameter | Type | Description |
|---|---|---|
grant_id * | string | The grant id. |
preview_id * | string | The preview id (e.g. pv-...). |
sandbox_id * | string | The sandbox id. |
job_create Run a job
Run or start a job on a new or existing sandbox. wait=false (default) starts durably and returns run_id immediately (202); wait=true blocks for the result, bounded by the caller's own request timeout (200).
| Parameter | Type | Description |
|---|---|---|
job * | object | Exactly one of existing_sandbox_id/new_sandbox is required, and exactly one of cmd/script is required. |
job_list List job runs
List a tenant's job runs, newest first. Paginated; optionally filtered by sandbox or schedule.
| Parameter | Type | Description |
|---|---|---|
page_size | integer | Page size. |
page_token | string | Pagination token from a previous response. |
sandbox_id | string | Filter to runs on this sandbox. |
schedule_id | string | Filter to runs fired by this schedule. |
job_get Inspect a job run
Full run detail: status, result, and an activity timeline, plus the stored job spec that started it. Since there is no endpoint to edit a run in place, to 'edit and rerun' a run: call job_get, modify the returned job object, and pass it to job_create as a new run.
| Parameter | Type | Description |
|---|---|---|
run_id * | string | The job run id (e.g. as returned by job_create or job_list). |
job_cancel Cancel a job run
Request cancellation of a running job. This cancels rather than terminates, so the run's own cleanup (e.g. deleting a sandbox it created) still executes.
| Parameter | Type | Description |
|---|---|---|
run_id * | string | The job run id (e.g. as returned by job_create or job_list). |
job_schedule_create Create a job schedule
Create a durable cron, interval, or one-shot trigger for a job. Exactly one of cron_expressions/interval_s/run_at_unix_nanos is required. A one-shot schedule is run_at_unix_nanos set (refused if in the past), not a separate mechanism.
| Parameter | Type | Description |
|---|---|---|
job * | object | Exactly one of existing_sandbox_id/new_sandbox is required, and exactly one of cmd/script is required. |
cron_expressions | array | Cron expressions to fire on. |
interval_s | integer | Fire every N seconds. |
jitter_s | integer | Random delay added to each fire, in seconds. |
overlap | string | What a fire does when the previous run is still going (default 'skip', which drops the new fire). |
paused | boolean | Create the schedule already paused (default false). |
run_at_unix_nanos | number | One-shot: a single future calendar time (unix nanos). Refused if in the past. |
time_zone | string | IANA zone, e.g. US/Pacific. Empty is UTC. |
job_schedule_list List job schedules
List a tenant's job schedules. Paginated.
| Parameter | Type | Description |
|---|---|---|
page_size | integer | Page size. |
page_token | string | Pagination token from a previous response. |
job_schedule_get Inspect a job schedule
Fetch a job schedule, including its timing, stored job spec, pause state, next run time, and recent/running run ids.
| Parameter | Type | Description |
|---|---|---|
schedule_id * | string | The job schedule id (e.g. as returned by job_schedule_create or job_schedule_list). |
job_schedule_update Update a job schedule
Replace a job schedule's timing and/or job spec. Same body shape and same-field requirements as job_schedule_create (exactly one of cron_expressions/interval_s/run_at_unix_nanos).
| Parameter | Type | Description |
|---|---|---|
job * | object | Exactly one of existing_sandbox_id/new_sandbox is required, and exactly one of cmd/script is required. |
schedule_id * | string | The job schedule id (e.g. as returned by job_schedule_create or job_schedule_list). |
cron_expressions | array | Cron expressions to fire on. |
interval_s | integer | Fire every N seconds. |
jitter_s | integer | Random delay added to each fire, in seconds. |
overlap | string | What a fire does when the previous run is still going (default 'skip', which drops the new fire). |
paused | boolean | Whether the schedule is paused. |
run_at_unix_nanos | number | One-shot: a single future calendar time (unix nanos). Refused if in the past. |
time_zone | string | IANA zone, e.g. US/Pacific. Empty is UTC. |
job_schedule_delete Delete a job schedule
Permanently delete a job schedule. Does not cancel any run currently in flight.
| Parameter | Type | Description |
|---|---|---|
schedule_id * | string | The job schedule id (e.g. as returned by job_schedule_create or job_schedule_list). |
job_schedule_pause Pause or resume a job schedule
Set a job schedule's paused state.
| Parameter | Type | Description |
|---|---|---|
paused * | boolean | true to pause, false to resume. |
schedule_id * | string | The job schedule id (e.g. as returned by job_schedule_create or job_schedule_list). |
note | string | Optional note recorded alongside the pause/resume. |
job_schedule_trigger Trigger a job schedule now
Fire one run of a job schedule immediately, overriding the schedule's own timing.
| Parameter | Type | Description |
|---|---|---|
schedule_id * | string | The job schedule id (e.g. as returned by job_schedule_create or job_schedule_list). |
template_list List templates
List the organization's saved templates (launch configurations), each at its latest revision. Use a template's id as sandbox_create's template_id.
template_get Inspect a template
Fetch a template, optionally at a specific revision (default: latest).
| Parameter | Type | Description |
|---|---|---|
template_id * | string | The template id. |
revision | integer |
template_create Create a template
Create a template from an image and settings. The image is resolved and validated on save; the template starts at revision 1. Use one to host a website or app that must come back by itself after a cold pause: its command runs again on every cold wake (recipe in the server instructions). Check template_list first and reuse a matching template instead of creating another.
| Parameter | Type | Description |
|---|---|---|
config * | object | Template launch configuration. The service resolves the image to a digest and pins secret set revisions on save. |
name * | string | Template name (unique per organization). |
description | string |
template_update Update a template
Update a template. Omitted fields keep their value. Changing config publishes a new immutable revision; pass revision (the current one) to guard against concurrent edits.
| Parameter | Type | Description |
|---|---|---|
template_id * | string | The template id. |
config | object | Template launch configuration. The service resolves the image to a digest and pins secret set revisions on save. |
description | string | |
name | string | |
revision | integer | Expected current revision. |
template_delete Delete a template
Permanently delete a template. Existing sandboxes are not affected.
| Parameter | Type | Description |
|---|---|---|
template_id * | string | The template id. |
registry_connection_list List registry connections
List stored credentials for pulling private container images. Passwords are never returned.
registry_connection_create Create a registry connection
Store credentials for a private container registry. The password is write-only.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
password * | string | Password or access token (write-only). |
registry * | string | Registry host, e.g. ghcr.io. |
username * | string |
registry_connection_update Update a registry connection
Replace a registry connection's name, host, username and password.
| Parameter | Type | Description |
|---|---|---|
connection_id * | string | The registry connection id. |
name * | string | |
password * | string | Password or access token (write-only). |
registry * | string | |
username * | string |
registry_connection_delete Delete a registry connection
Delete a registry connection. Fails if a template still uses it.
| Parameter | Type | Description |
|---|---|---|
connection_id * | string | The registry connection id. |
registry_connection_validate Validate a registry connection
Resolve an image through a registry connection and return its digest.
| Parameter | Type | Description |
|---|---|---|
connection_id * | string | The registry connection id. |
image * | string | Image reference to resolve. |
secret_list List secrets
List secrets (names and timestamps only; values are write-only and never returned).
secret_create Create a secret
Store a write-only secret, bindable to an environment variable in a template (secret_bindings).
| Parameter | Type | Description |
|---|---|---|
name * | string | |
value * | string | The secret value (write-only). |
secret_update Update a secret
Replace a secret's name and value.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
secret_id * | string | The secret id. |
value * | string | New value (write-only). |
secret_delete Delete a secret
Delete a secret. Fails if a template still binds it.
| Parameter | Type | Description |
|---|---|---|
secret_id * | string | The secret id. |
secret_set_list List secret sets
List secret sets: named groups of environment variables you can inject into sandboxes and jobs via secret_sets. Key names are returned, never values.
secret_set_get Inspect a secret set
Fetch a secret set (key names and revision; no values).
| Parameter | Type | Description |
|---|---|---|
secret_set_id * | string | The secret set id. |
secret_set_create Create a secret set
Create a secret set from environment variable names and values (values are write-only).
| Parameter | Type | Description |
|---|---|---|
name * | string | |
values * | object | Environment variable name -> value (write-only). |
secret_set_update Update a secret set
Update a secret set; publishes a new revision. Pass revision (the current one) to guard against concurrent edits.
| Parameter | Type | Description |
|---|---|---|
secret_set_id * | string | The secret set id. |
name | string | |
revision | integer | Expected current revision. |
values | object | Replacement values (write-only). |
secret_set_delete Delete a secret set
Delete a secret set. Fails if a template still references it.
| Parameter | Type | Description |
|---|---|---|
secret_set_id * | string | The secret set id. |
organization_list List organizations
List the organizations the API key's user belongs to, with your role in each. Use an organization_id as BONYA_ORGANIZATION_ID to scope this server to it.
sandbox_gpu_options List GPU options
List the GPU type/count combinations currently available for GPU sandboxes (the 'gpu' parameter of sandbox_create, which also needs an 'image'). An empty list means no GPU capacity is configured.
sandbox_pause Pause a sandbox
Force a sandbox to pause. 'warm' keeps memory and running processes and resumes quickly; 'cold' frees more resources, resumes slower, and ends every process (files are kept; processes are not restarted). Returns once the stage is reached. A paused sandbox wakes by itself on exec, file access, or preview traffic; sandbox_keepalive is not needed to wake it.
| Parameter | Type | Description |
|---|---|---|
sandbox_id * | string | The sandbox id (e.g. as returned by sandbox_create or sandbox_list). |
stage * | string | Pause stage. |
sandbox_keepalive Keep a sandbox awake
Place an expiring keep-awake hold on a sandbox so it is not auto-paused; a paused sandbox is woken. Returns keepalive_until. Call this ONLY when the user explicitly asks to keep the sandbox awake, alive, or running. Do not call it by default, after sandbox_create or exec, to wake a sandbox (exec, file access and preview traffic wake it), or on your own to keep a website or server up. A hold keeps the sandbox running and billed for its whole duration.
| Parameter | Type | Description |
|---|---|---|
for * | string | Hold duration as a Go-style duration, e.g. "30m" or "2h". Use the duration the user asked for; if they gave none, ask them or use a short one and say so. |
sandbox_id * | string | The sandbox id (e.g. as returned by sandbox_create or sandbox_list). |
sandbox_network_update Update sandbox network policy
Replace the network egress policy of a running sandbox (open, allowlist of domains/CIDRs, or airgap).
| Parameter | Type | Description |
|---|---|---|
mode * | string | open = unrestricted egress (default); allowlist = only the 'allow' destinations; airgap = no network. |
sandbox_id * | string | The sandbox id (e.g. as returned by sandbox_create or sandbox_list). |
allow | array | Allowed destinations; used when mode is 'allowlist'. |
sandbox_fork Fork a sandbox
Create N new sandboxes that start with the source sandbox's memory and disk, on the same node. Each child is a separate sandbox you must delete when done.
| Parameter | Type | Description |
|---|---|---|
count * | integer | Number of forks to create. |
sandbox_id * | string | The sandbox id (e.g. as returned by sandbox_create or sandbox_list). |
snapshot_create Snapshot a sandbox
Create a named snapshot of a sandbox that new sandboxes can later be restored from (sandbox_create with 'snapshot').
| Parameter | Type | Description |
|---|---|---|
name * | string | Snapshot name. |
sandbox_id * | string | The sandbox id (e.g. as returned by sandbox_create or sandbox_list). |
snapshot_list List a sandbox's snapshots
List the snapshots taken of a sandbox.
| Parameter | Type | Description |
|---|---|---|
sandbox_id * | string | The sandbox id (e.g. as returned by sandbox_create or sandbox_list). |
snapshot_get Inspect a snapshot
Fetch a single snapshot by id.
| Parameter | Type | Description |
|---|---|---|
snapshot_id * | string | The snapshot id (as returned by snapshot_create or snapshot_list). |
snapshot_delete Delete a snapshot
Permanently delete a snapshot. This cannot be undone.
| Parameter | Type | Description |
|---|---|---|
snapshot_id * | string | The snapshot id (as returned by snapshot_create or snapshot_list). |