Skip to main content

Serenity Cloud On-Demand GPU — User guide

This guide explains how to connect an MCP client (for example Cursor or Claude Desktop) to the Serenity Cloud On-Demand GPU MCP server, what authentication to use, and which tools, resources, and prompts are available.

Agent context​

For AI assistants and IDE integrations, download the MCP agent context document (tool summary, provisioning workflow, safety, and MCP resources).

Download agent context


Prerequisites​

  1. Serenity Cloud MCP key — Create or copy an mcp_token from the Serenity Cloud console (Resources → MCP Keys). The token is sent as Authorization: Bearer <token>.
  2. MCP endpoint URL — Hosted service: https://mcp-ondemand.substrate.ai/mcp (service root describes version, mcp_endpoint, and auth in JSON).
  3. SSH keys (recommended) — For SSH access to instances, register keys in Serenity Cloud (Resources → SSH Keys) and use list_ssh_keys before launching.

How to connect​

Clients use the streamable HTTP transport. Connect to the MCP URL:

https://mcp-ondemand.substrate.ai/mcp

Authentication: Every request to MCP endpoints must include:

Authorization: Bearer <your-mcp_token>

Paths without a Bearer token return 401, except:

  • GET https://mcp-ondemand.substrate.ai/health — liveness (no auth)
  • GET https://mcp-ondemand.substrate.ai/ — small JSON describing the service and /mcp (no auth)

Check that the service is up (optional): GET https://mcp-ondemand.substrate.ai/health (no auth).

Cursor (~/.cursor/mcp.json)​

Use the url transport and pass your token in headers:

{
"mcpServers": {
"substrate-ondemand": {
"url": "https://mcp-ondemand.substrate.ai/mcp",
"headers": {
"Authorization": "Bearer mcp_<your-substrate-token>"
}
}
}
}

Use HTTPS and your real Serenity Cloud token in place of mcp_<your-substrate-token>.

Other MCP clients​

Any client that supports streamable HTTP + custom headers should use the same pattern: URL = https://mcp-ondemand.substrate.ai/mcp, header = Authorization: Bearer <mcp_token>.


Available MCP tools​

All tools call Serenity Cloud on your behalf using the Bearer token you supplied on the connection.

ToolPurpose
pingVerify token and API reachability (run this first when debugging).
list_inventoryList GPU catalog; optional filters (see below).
list_ssh_keysList organisation SSH keys (for ssh_key_id on launch).
launch_instanceCreate a GPU instance (billing starts immediately).
poll_instance_until_activeWait until the instance is active and get SSH hints.
get_instanceDetails for one instance by UUID.
list_instancesAll non-deleted instances for the org.
update_instanceRename and/or replace tags.
delete_instanceTerminate an instance (irreversible — confirm with a human first).

list_inventory parameters (all optional)​

ParameterMeaning
gpu_typePartial, case-insensitive match (e.g. H100, A4000).
locationPartial region name (e.g. europe, north america).
gpu_countExact GPU count (e.g. 1, 4).
max_priceMaximum price per hour in EUR.

launch_instance parameters​

ParameterRequiredNotes
inventory_gpu_idYesUUID from list_inventory.
nameYesDisplay name, max 50 characters.
ssh_key_idNoUUID from list_ssh_keys (recommended).
osNoFrom inventory os_options, e.g. ubuntu22.04_cuda12.8.
tagsNoe.g. ["team:ml", "project:v2"].
docker_imageNoIf set, launches with Docker (see optional Docker fields).
docker_argsNoContainer CLI args.
docker_envsNoe.g. [{"name": "HF_TOKEN", "value": "hf_..."}].
docker_port_mappingsNoe.g. [{"container_port": 8000, "host_port": 8000}].

poll_instance_until_active parameters​

ParameterDefaultNotes
instance_id—Required UUID.
timeout_seconds300Max wait (seconds).
poll_interval_seconds10Polling interval (minimum 5 seconds).

Resources​

The server exposes MCP resources you can open in supporting clients:

URIContent
substrate://workflow-guideStep-by-step workflow for provisioning GPUs (same ideas as below).
substrate://configNon-secret server metadata (version, transport, retry/timeouts — not your token).

Prompts​

PromptPurpose
launch_gpu_promptOptional structured task description (default: train a machine learning model) to guide the assistant through inventory → SSH keys → launch → poll.

  1. ping — Confirm token and connectivity.
  2. list_inventory — Choose a GPU; note inventory_gpu_id and os_options.
  3. list_ssh_keys — Choose ssh_key_id if you need SSH.
  4. launch_instance — Start the instance.
  5. poll_instance_until_active — Wait until active; use the returned SSH information.
  6. Connect with your SSH client (for example ssh substrate@<ip> -p 22 -i ~/.ssh/your-key).
  7. delete_instance only after explicit human confirmation — termination is irreversible and billing rules apply on Serenity Cloud’s side.

Status flow: creating → pending → active → deleting → deleted.

Regions (for inventory filters): Europe, North America, Asia Pacific, Australia, South America, Middle East, Africa.


Troubleshooting​

SymptomWhat to check
401 UnauthorizedMissing or wrong Authorization: Bearer header.
400 Token too largeAuthorization value exceeds the server’s maximum size.
Serenity Cloud 401 / “token invalid”Regenerate or fix the MCP key in Serenity Cloud (Resources → MCP Keys).
404 on APIWrong UUID or resource belongs to another organisation.
Cannot reach /mcpUse https://mcp-ondemand.substrate.ai/mcp and check TLS / network.
Health failsTry https://mcp-ondemand.substrate.ai/health; if it fails, the service may be unavailable.

Quick reference — endpoints​

Host: https://mcp-ondemand.substrate.ai

MethodPathAuth
GEThttps://mcp-ondemand.substrate.ai/healthNo
GEThttps://mcp-ondemand.substrate.ai/No
MCPhttps://mcp-ondemand.substrate.ai/mcpYes (Bearer)

Version​

The GET /health and GET / responses include the running server version string.