bonya-mcp

v1.0.3
@bonya-ai/bonya-mcp Checked 1 day ago Published 17 days ago

Model 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.

ParameterTypeDescription
envobjectOptional environment variables set in the sandbox.
gpuobjectOptional 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…
imagestringOptional 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…
namestringOptional display label (not unique; every lookup is by sandbox_id).
networkobjectNetwork egress policy for the sandbox.
secret_setsarrayOptional secret set names to inject into the sandbox (see secret_set_list).
snapshotstringOptional snapshot id to restore the new sandbox from (see snapshot_list).
template_idstringOptional template id. Omit to use the deployment default. Use template_list to discover available templates.
template_versionstringOptional specific template version. Defaults to the template's latest.
waitbooleanIf true, block until the sandbox is ready instead of returning immediately.

sandbox_list List sandboxes

List sandboxes, optionally filtered by state. Paginated.

ParameterTypeDescription
include_disposablebooleanInclude disposable (job-created) sandboxes in the listing.
page_sizeintegerPage size (default 50).
page_tokenstringPagination token from a previous response.
statesarrayFilter to these states. Deleted sandboxes are not listed.

sandbox_get Inspect a sandbox

Fetch the current state of a single sandbox by id.

ParameterTypeDescription
sandbox_id *stringThe 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.

ParameterTypeDescription
sandbox_id *stringThe 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.

ParameterTypeDescription
cmd *arrayCommand and arguments, e.g. ["bash","-lc","echo hi"] or ["ls","-la"].
sandbox_id *stringThe sandbox id.
envobjectExtra environment variables.
output_encodingstringEncoding for the returned stdout/stderr. Defaults to utf8.
pathstringWorking directory inside the sandbox.
stdin_b64stringBase64-encoded bytes to write to the command's stdin.
timeout_sintegerMax 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.

ParameterTypeDescription
path *stringPath to read inside the sandbox.
sandbox_id *stringThe 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.

ParameterTypeDescription
content *stringUTF-8 text content to write.
path *stringDestination path inside the sandbox.
sandbox_id *stringThe sandbox id.

fs_list List a directory in a sandbox

List the entries of a directory in a sandbox.

ParameterTypeDescription
path *stringDirectory path inside the sandbox.
sandbox_id *stringThe sandbox id.

fs_stat Stat a file in a sandbox

Get metadata (kind, size, mode, modified time) for a path in a sandbox.

ParameterTypeDescription
path *stringPath inside the sandbox.
sandbox_id *stringThe sandbox id.

fs_mkdir Create a directory in a sandbox

Create a directory (and any missing parents) in a sandbox.

ParameterTypeDescription
path *stringDirectory path to create inside the sandbox.
sandbox_id *stringThe sandbox id.

fs_rename Rename or move a file in a sandbox

Rename or move a file or directory within a sandbox.

ParameterTypeDescription
from *stringExisting path inside the sandbox.
sandbox_id *stringThe sandbox id.
to *stringNew 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.

ParameterTypeDescription
path *stringPath to delete inside the sandbox.
sandbox_id *stringThe sandbox id.
recursivebooleanDelete 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.

ParameterTypeDescription
cmd *arrayCommand and arguments, e.g. ["bash","-lc","npm run dev"].
name *stringThe session name (unique per sandbox).
sandbox_id *stringThe sandbox id.
colsintegerTerminal columns.
envobjectExtra environment variables.
pathstringWorking directory inside the sandbox.
replacebooleanReplace an existing terminal (finished) session of the same name.
rowsintegerTerminal 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).

ParameterTypeDescription
sandbox_id *stringThe 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.

ParameterTypeDescription
sandbox_id *stringThe sandbox id.
session_name *stringThe session name (unique per sandbox).
grace_msintegerGrace period before escalation in ms (default 5000, max 60000).
signalstringSignal 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.

ParameterTypeDescription
port *integerPort inside the sandbox to expose.
sandbox_id *stringThe sandbox id.
authstring'private' (default) requires a grant token; 'public' is open.
ttl_secondsintegerGrant lifetime in seconds (0 or omitted uses the service default).

preview_list List previews

List all previews for a sandbox. Never returns grant tokens.

ParameterTypeDescription
sandbox_id *stringThe sandbox id.

preview_get Inspect a preview

Fetch a single preview by id.

ParameterTypeDescription
preview_id *stringThe preview id (e.g. pv-...).
sandbox_id *stringThe sandbox id.

preview_delete Delete a preview

Delete a preview by id, immediately disabling its URL. Returns the deleted preview.

ParameterTypeDescription
preview_id *stringThe preview id (e.g. pv-...).
sandbox_id *stringThe 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.

ParameterTypeDescription
preview_id *stringThe preview id (e.g. pv-...).
sandbox_id *stringThe sandbox id.
ttl_secondsintegerGrant 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.

ParameterTypeDescription
preview_id *stringThe preview id (e.g. pv-...).
sandbox_id *stringThe sandbox id.

preview_grant_renew Renew a preview access grant

Extend an access grant's lifetime.

ParameterTypeDescription
grant_id *stringThe grant id.
preview_id *stringThe preview id (e.g. pv-...).
sandbox_id *stringThe sandbox id.
ttl_secondsintegerGrant 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.

ParameterTypeDescription
grant_id *stringThe grant id.
preview_id *stringThe preview id (e.g. pv-...).
sandbox_id *stringThe 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).

ParameterTypeDescription
job *objectExactly 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.

ParameterTypeDescription
page_sizeintegerPage size.
page_tokenstringPagination token from a previous response.
sandbox_idstringFilter to runs on this sandbox.
schedule_idstringFilter 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.

ParameterTypeDescription
run_id *stringThe 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.

ParameterTypeDescription
run_id *stringThe 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.

ParameterTypeDescription
job *objectExactly one of existing_sandbox_id/new_sandbox is required, and exactly one of cmd/script is required.
cron_expressionsarrayCron expressions to fire on.
interval_sintegerFire every N seconds.
jitter_sintegerRandom delay added to each fire, in seconds.
overlapstringWhat a fire does when the previous run is still going (default 'skip', which drops the new fire).
pausedbooleanCreate the schedule already paused (default false).
run_at_unix_nanosnumberOne-shot: a single future calendar time (unix nanos). Refused if in the past.
time_zonestringIANA zone, e.g. US/Pacific. Empty is UTC.

job_schedule_list List job schedules

List a tenant's job schedules. Paginated.

ParameterTypeDescription
page_sizeintegerPage size.
page_tokenstringPagination 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.

ParameterTypeDescription
schedule_id *stringThe 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).

ParameterTypeDescription
job *objectExactly one of existing_sandbox_id/new_sandbox is required, and exactly one of cmd/script is required.
schedule_id *stringThe job schedule id (e.g. as returned by job_schedule_create or job_schedule_list).
cron_expressionsarrayCron expressions to fire on.
interval_sintegerFire every N seconds.
jitter_sintegerRandom delay added to each fire, in seconds.
overlapstringWhat a fire does when the previous run is still going (default 'skip', which drops the new fire).
pausedbooleanWhether the schedule is paused.
run_at_unix_nanosnumberOne-shot: a single future calendar time (unix nanos). Refused if in the past.
time_zonestringIANA 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.

ParameterTypeDescription
schedule_id *stringThe 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.

ParameterTypeDescription
paused *booleantrue to pause, false to resume.
schedule_id *stringThe job schedule id (e.g. as returned by job_schedule_create or job_schedule_list).
notestringOptional 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.

ParameterTypeDescription
schedule_id *stringThe 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).

ParameterTypeDescription
template_id *stringThe template id.
revisioninteger

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.

ParameterTypeDescription
config *objectTemplate launch configuration. The service resolves the image to a digest and pins secret set revisions on save.
name *stringTemplate name (unique per organization).
descriptionstring

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.

ParameterTypeDescription
template_id *stringThe template id.
configobjectTemplate launch configuration. The service resolves the image to a digest and pins secret set revisions on save.
descriptionstring
namestring
revisionintegerExpected current revision.

template_delete Delete a template

Permanently delete a template. Existing sandboxes are not affected.

ParameterTypeDescription
template_id *stringThe 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.

ParameterTypeDescription
name *string
password *stringPassword or access token (write-only).
registry *stringRegistry host, e.g. ghcr.io.
username *string

registry_connection_update Update a registry connection

Replace a registry connection's name, host, username and password.

ParameterTypeDescription
connection_id *stringThe registry connection id.
name *string
password *stringPassword 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.

ParameterTypeDescription
connection_id *stringThe registry connection id.

registry_connection_validate Validate a registry connection

Resolve an image through a registry connection and return its digest.

ParameterTypeDescription
connection_id *stringThe registry connection id.
image *stringImage 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).

ParameterTypeDescription
name *string
value *stringThe secret value (write-only).

secret_update Update a secret

Replace a secret's name and value.

ParameterTypeDescription
name *string
secret_id *stringThe secret id.
value *stringNew value (write-only).

secret_delete Delete a secret

Delete a secret. Fails if a template still binds it.

ParameterTypeDescription
secret_id *stringThe 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).

ParameterTypeDescription
secret_set_id *stringThe secret set id.

secret_set_create Create a secret set

Create a secret set from environment variable names and values (values are write-only).

ParameterTypeDescription
name *string
values *objectEnvironment 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.

ParameterTypeDescription
secret_set_id *stringThe secret set id.
namestring
revisionintegerExpected current revision.
valuesobjectReplacement values (write-only).

secret_set_delete Delete a secret set

Delete a secret set. Fails if a template still references it.

ParameterTypeDescription
secret_set_id *stringThe 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.

ParameterTypeDescription
sandbox_id *stringThe sandbox id (e.g. as returned by sandbox_create or sandbox_list).
stage *stringPause 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.

ParameterTypeDescription
for *stringHold 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 *stringThe 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).

ParameterTypeDescription
mode *stringopen = unrestricted egress (default); allowlist = only the 'allow' destinations; airgap = no network.
sandbox_id *stringThe sandbox id (e.g. as returned by sandbox_create or sandbox_list).
allowarrayAllowed 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.

ParameterTypeDescription
count *integerNumber of forks to create.
sandbox_id *stringThe 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').

ParameterTypeDescription
name *stringSnapshot name.
sandbox_id *stringThe 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.

ParameterTypeDescription
sandbox_id *stringThe sandbox id (e.g. as returned by sandbox_create or sandbox_list).

snapshot_get Inspect a snapshot

Fetch a single snapshot by id.

ParameterTypeDescription
snapshot_id *stringThe snapshot id (as returned by snapshot_create or snapshot_list).

snapshot_delete Delete a snapshot

Permanently delete a snapshot. This cannot be undone.

ParameterTypeDescription
snapshot_id *stringThe snapshot id (as returned by snapshot_create or snapshot_list).