mcp-server
v1.2.0Official GPUtw MCP server — manage GPU instances and Vault storage on gputw.ai from any MCP client
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list-gpus List GPU catalogue
List GPU models available on GPUtw with live pricing and demand. Start here when deploying: take the `id` of the model you want and pass it to list-available-nodes as catalogId. `liveRentablePrice: null` or `demandStatus: "售罄"` (sold out) means nothing is free right now. `rentalMode: "CONTACT_LONG_SESSION"` cannot be deployed via API - the user must email contactEmail. Prices are USD/hour; credits are charged in TWD. Returns the decision-relevant fields only.
list-available-nodes List available machines
List machines currently rentable for one GPU model. Pass the `id` from list-gpus as catalogId. Use a returned machine `id` as the nodeId for create-instance. Only one instance may run per machine, so `availableGpus: 0` or a non-zero queueDepth means it is occupied. Check that the machine `arch` (amd64 / arm64) is in the chosen template's architectures. An empty list means no capacity for that model right now. `hostname` is a public label, not a real host. `fastVault: true` machines read and write /vault faster: prefer them when the job loads large files from /vault (models, datasets) on every…
| Parameter | Type | Description |
|---|---|---|
catalogId * | string | GPU catalogue entry id, from list-gpus |
list-templates List workspace templates
List the prebuilt container templates (PyTorch/Jupyter, ComfyUI, vLLM, Ollama, Ubuntu, CUDA, DGX Spark variants). Pass a template `id` as templateId to create-instance. Never hardcode these ids - they change. `architectures` must contain the target machine's arch (DGX Spark machines are arm64). `minComputeCapability` above the machine's GPU is rejected at deploy time.
| Parameter | Type | Description |
|---|---|---|
arch | string | Only return templates supporting this machine architecture |
search | string | Case-insensitive substring match on the template name, e.g. "PyTorch" |
get-deploy-options Get deploy options
Bandwidth tiers accepted by create-instance. `bandwidthMbps` must be one of the returned bandwidthOptions values (the included one is free; others are billed per Mbps-hour). Omitting bandwidthMbps on create uses the included tier.
list-instances List instances
List this account's GPU instances (terminated ones are omitted). Billing runs while an instance is RUNNING. Do NOT call this in a polling loop - use get-instance-status for that.
get-instance-status Get instance status
Small, cheap status read built for polling - use this (not list-instances) while waiting for a machine to come up, about every 5 seconds with an overall timeout. Three terminal outcomes: RUNNING (success), FAILED (read get-instance-logs with previous=true), INSUFFICIENT_FUNDS (the user must top up). deployPhase (DEPLOYING only) walks SCHEDULING -> PREPARING -> STARTING -> RUNNING; PULLING_IMAGE means a pull failed and is retrying; CONFIG_ERROR / START_FAILED / CRASH_LOOP mean read the logs. A normal large image pull shows as PREPARING for minutes. A status that disagrees with podPhase means so…
| Parameter | Type | Description |
|---|---|---|
instanceId * | string |
get-instance-resources Get instance resources and usage
Allocation, live utilisation and burn rate in one call. Percentages are against the instance's own allocation, not the host. CRITICAL: check `usage.source` first - `prometheus` or `fallback` mean the numbers are real; `none` means there is NO telemetry and every metric is null. A null metric is not zero, so never conclude "idle" from it. Machines without GPU telemetry report null gpuPct/vramUsedMib while CPU and RAM still work.
| Parameter | Type | Description |
|---|---|---|
instanceId * | string |
get-instance-logs Get instance logs
Tail of the container log. Set previous=true to read the container that ran BEFORE the current one - on a crash loop that is the only place the real error appears. tail is capped at 2000 lines and the response at 48 KiB. Infrastructure identifiers are replaced with placeholders (worker-node, [internal-ip]) before the log leaves the server.
| Parameter | Type | Description |
|---|---|---|
instanceId * | string | |
previous | boolean | Read the previous container - use this on a crash loop |
tail | integer | Lines to return (default 200) |
get-instance-events Get instance events
Structured scheduling/startup events for the current container (type, reason, message, count, lastSeen). First stop when a deploy is stuck or FAILED, before reading logs. Events never carry over from a previous container, so an empty list with podExists=false means no container exists yet.
| Parameter | Type | Description |
|---|---|---|
instanceId * | string | |
limit | integer |
create-instance Create instance
Deploy a GPU instance. Requires the instances:create scope. Supply nodeId from list-available-nodes plus EXACTLY ONE of templateId, template (the docker image string) or customImage. Returns immediately with status DEPLOYING - then poll get-instance-status. Billing starts when it reaches RUNNING (for custom images, from image pull). Deploying needs credit for one hour of every running instance, else 402. Always stop or delete the instance when the work is done.
| Parameter | Type | Description |
|---|---|---|
nodeId * | string | Machine id from list-available-nodes |
autoStopAt | string | ISO 8601 time with offset to stop at; alternative to autoStopHours |
autoStopHours | number | Stop automatically after this many hours (10 minutes to 30 days). Recommended as a safety net |
bandwidthMbps | integer | Must match a get-deploy-options tier |
customImage | object | Bring your own image instead of a template |
name | string | Display name (default: the next free "GPU N"); a label only, not an idempotency key |
ports | array | HTTP ports to open; 2222, 6443 and 9000-9999 are reserved |
shmSizeGb | integer | |
template | string | Template docker image, e.g. gputw/pytorch:latest |
templateId | string | Template id from list-templates |
stop-instance Stop instance
Stop an instance and end compute billing, keeping the record and its settings so it can be restarted. Requires instances:manage. The container is removed and /workspace is DELETED - only /vault survives, so anything the user needs must already be in /vault. Confirm first.
| Parameter | Type | Description |
|---|---|---|
instanceId * | string |
delete-instance Delete instance
Terminate and remove an instance permanently, including its record. Requires instances:manage. /workspace is destroyed (as it is on stop) - anything the user needs must already be in /vault, which is unaffected. Prefer stop-instance only to keep the record for a restart. Confirm first.
| Parameter | Type | Description |
|---|---|---|
instanceId * | string |
restart-instance Restart instance
Restart a STOPPED or FAILED instance. mode="same" reuses the original machine; mode="alternative" needs a nodeId and creates a NEW instance on another machine. Requires instances:manage. Custom-image instances need a template or the image supplied again, because their registry credentials were cleared on stop.
| Parameter | Type | Description |
|---|---|---|
instanceId * | string | |
mode * | string | |
bandwidthMbps | integer | |
nodeId | string | Required when mode is "alternative" |
shmSizeGb | integer | |
template | string | |
templateId | string |
set-instance-auto-stop Set, extend or cancel the auto-stop timer
Server-side timer that STOPS a RUNNING or DEPLOYING instance at a set time, even if this session is gone. Requires instances:manage. Give exactly one of: autoStopAt (ISO 8601 with offset, 10 minutes to 30 days ahead), extendHours (push the current deadline out), or cancel=true. At the deadline the instance is stopped like stop-instance: /workspace is erased and only /vault is kept - tell the user that.
| Parameter | Type | Description |
|---|---|---|
instanceId * | string | |
autoStopAt | string | ISO 8601 time with offset, e.g. 2026-11-20T18:00:00+08:00 |
cancel | boolean | Remove the timer |
extendHours | number |
rename-instance Rename instance
Set the display name of an instance (up to 40 characters) so several similar machines are easy to tell apart. An empty name resets it to the next free "GPU N". Requires instances:manage. Cosmetic only: it does not change SSH (still pod-<id>) or the instance id.
| Parameter | Type | Description |
|---|---|---|
instanceId * | string | |
name * | string |
get-instance-metrics Get instance metrics history
Time series of cpu (%), ram (bytes), gpu (%), vram (MiB), netIn/netOut (Mbps) over range 1h (about every 15 s), 6h (every minute) or 24h (every 5 minutes). Use it for trends such as "has the GPU done anything in the last hour"; use get-instance-resources for the current value. An empty list or gpu=null means no telemetry, which is NOT the same as idle.
| Parameter | Type | Description |
|---|---|---|
instanceId * | string | |
range | string |
delete-stopped-instances Delete stopped and failed instances
Permanently delete STOPPED and FAILED instances in one call (at most 100, oldest first), or only the instanceIds given. Requires instances:manage. RUNNING and DEPLOYING instances are never touched - they come back in skipped with reason NOT_STOPPED. Stopped instances still count toward the instance limit, so this frees room. /vault is unaffected. Confirm first.
| Parameter | Type | Description |
|---|---|---|
instanceIds | array |
list-vault List Vault contents
List a folder in the account's persistent /vault storage. Requires vault:read. Paths are relative to the vault root ("models/vae", not "/vault/models/vae"); omit path for the root. /vault survives instance restarts and deletion and is shared by every instance on the account, unlike /workspace which dies with its instance.
| Parameter | Type | Description |
|---|---|---|
path | string | Folder relative to the vault root |
get-vault-stats Get Vault usage and quota
Vault usage, quota and storage rate. Requires vault:read. Check this before a large upload: exceeding the quota fails the upload with 413.
upload-to-vault Upload a local file to Vault
Upload a local file of any size into /vault using the resumable chunked protocol. Requires vault:write (the dashboard's "Upload token" preset is exactly this and nothing else - the right key for CI). Sends the bytes through the transfer host when available, which removes the 100 MB request cap. Handles sha256 verification, the server-chosen chunk size and resuming parts the server already holds. Runs to completion before returning, so prefer it for files up to a few GB; anything reachable by URL should use download-model-to-vault instead.
| Parameter | Type | Description |
|---|---|---|
localPath * | string | Absolute path to the file on this machine |
vaultPath * | string | Destination relative to the vault root, including the filename |
parallel | integer | Concurrent part uploads (default 4) |
download-model-to-vault Download a URL or Hugging Face file into Vault
Have the GPUtw server fetch a file straight into /vault - no running instance, no shell, no local copy, and the bytes never cross this machine. Requires vault:write. source accepts a direct https URL, a Hugging Face blob/resolve URL, or the shorthand hf:<owner>/<repo>:<file path>. For ComfyUI put models under models/<category>/ (checkpoints, diffusion_models, text_encoders, vae, loras, clip_vision, controlnet, upscale_models, embeddings) and they appear in its picker. Gated repos need hfToken, which is used for that one request and never stored. At most 3 downloads run at once per account.
| Parameter | Type | Description |
|---|---|---|
source * | string | https URL, HF blob/resolve URL, or hf:<owner>/<repo>:<path> |
targetPath * | string | Destination relative to the vault root; a folder alone takes the name from the source |
hfToken | string | Hugging Face token for a gated repo; never stored |
wait | boolean | Wait for completion (default true). False returns the job id to poll yourself. |
list-vault-downloads List recent Vault downloads
Recent server-side download jobs with status and progress. Requires vault:read. Use it to check a job started with wait=false, or to see why one failed.