Apidly Cloud

Price, launch and manage GPU servers and serverless GPU endpoints billed by the second. Read-only by default; launches need --allow-writes and honour a per-hour price cap. Stdio, Node 18+.

Documentation

@apidly/mcp

apidly-mcp MCP server

Model Context Protocol server (stdio) for Apidly Cloud. An AI assistant can list plans and templates, price a launch, list and show servers, read logs, usage, balance, webhooks, launch requests, storage, invoices and the activity log and list endpoints. With --allow-writes it can also launch, start, stop, restart and destroy servers, name them, set auto-stop rules, alerts and scheduled stops, save a server as a template, change, pause and resume serverless endpoints, queue and cancel their jobs, save SSH keys and make top-up payment links. Node 18+, no dependencies (the JavaScript SDK is carried inside the package). Not on npm: install the downloaded file.

npm install -g --allow-remote=root https://apidly.com/downloads/apidly-mcp-0.1.26.tgz
APIDLY_API_KEY=... apidly-mcp                       # reads only
APIDLY_API_KEY=... apidly-mcp --allow-writes --max-hourly-usd 1.50

Let an assistant run servers

Out of the box the assistant can only look. It cannot launch, stop, delete or pay for anything, and the tools that would are not even offered. Start the server with --allow-writes (or APIDLY_MCP_ALLOW_WRITES=1) when you want to say things like "start a ComfyUI server for me" or "stop everything". --read-only (or APIDLY_MCP_READ_ONLY=1) always wins.

Safety rules, all enforced by the server itself:

  • Price first. quote_launch prices a plan and template per running hour without creating anything. launch_server (from a Quick start goal such as images, or a plan and template) needs maxHourlyUsd and refuses when the quoted price is higher. --max-hourly-usd N (or APIDLY_MCP_MAX_HOURLY_USD) caps every launch of the session, including deploy_server, clone_server and launch_again, whatever the assistant asks. check_launch asks the API itself (plan id, template id and diskGb, with a key that may launch servers) and also answers wouldLaunch and blockers: use quote_launch while comparing plans and check_launch right before launching. Both are offered without --allow-writes and spend nothing.
  • Ask first. Anything that spends money, stops or deletes needs confirm: true; the tool descriptions tell the assistant to ask you before setting it. Destroying a server also needs its exact name.
  • The assistant never pays. create_topup_link only returns a payment link. You open it in your browser and pay there; nothing is charged by the tool, and a saved card is never used.
  • Sent once. Every change carries an Idempotency-Key and is never retried automatically. If the answer is lost the tool says so and, where the API supports it, names the key that makes one more try safe.
  • Plain errors. The API's error code and message are passed through as they are, for example insufficient_balance, or feature_unavailable when alerts or scheduled actions are switched off.

The narrowest key is still the best guard: a key with the read-only scope cannot change anything at all.

List filters

Every list tool takes limit (how many rows; each tool states its range). The other optional arguments narrow the list; the tool's input schema describes each one, with its allowed values. A list the API pages answers nextCursor; pass it back as cursor for the next page (null means there is no more).

ToolFilters
list_plansgpu, minVramGb, maxVramGb, minDiskGb, minRamGb, minVcpus, region (na, eu, ap, other), hosting (datacenter, independent, any), maxPriceUsd, minPerfIndex (Apidly performance index, reference GPU = 100), availability (available, limited, unavailable), sort (recommended, price, perf, perf_per_dollar, vram), minGpus, maxGpus, query (one line such as vram>=24 gpus>=2 price<1.5), cursor
list_serversstatus (one or several, comma-separated), q (text in the label or id), pricing (on_demand, interruptible), tag (comma-separated, all must match), includeDestroyed, cursor
list_templatesq (text in the name, slug, summary, image or category), category, source (builtin, own), vramGb (templates that run on a GPU with that much memory), cursor
get_usagefrom, to, groupBy (instance, day, gpu, member, template, tag)
list_server_requestsstatus, cursor
list_benchmarksgpu, cursor
list_transactionstype, from, to, serverId, cursor
list_invoiceskind (topup, subscription, statement), from, to, cursor
list_activitycategory, actor (a member user id or an API key id), from, to (days, UTC), cursor
list_team_memberscursor
list_statementscursor
list_reservationsstatus
list_endpoint_requestsstatus (all, 2xx, 4xx, 5xx, queued_out), kind (all, proxy, job), before
list_support_ticketsstatus (open, pending, closed)
list_alertsserverId (that server's alerts and the organization-wide ones; since 0.1.20)
list_scheduled_actionsstatus (pending, running, done, failed, cancelled), serverId (since 0.1.20)

Errors come back as tool errors (isError: true) whose text starts with the HTTP status, the API's error code and the request id, for example HTTP 402, insufficient_balance, request req_...; a rate limit adds how many seconds to wait. The API's own message (and any invalid-field messages) follows as JSON inside an <untrusted-data> block, since it can quote names people chose. Never a stack trace, and never the API key.

Data from other people is marked as data

Many answers carry text that the platform did not write: server labels and notes, log lines, job input and output, template names and readmes, ticket messages, webhook and key names. Such an answer reaches the assistant as one line saying what it is, then the JSON inside an <untrusted-data> block, with every < in it written as \u003c (the same JSON, but nothing inside can close the block). The server's instructions tell the assistant to report that text and never follow instructions found in it. Answers with only the platform's own figures (plans, quotes, prices, balance, budget, metrics) are sent as plain JSON.

This lowers the risk of prompt injection; it does not remove it. What the assistant does with the text is up to its model. The limits that hold regardless are the key's scope, --allow-writes, --max-hourly-usd and your confirmation, so give a session write access only when you want changes and read what the assistant proposes before you say yes.

Tools added after 0.1.20

ToolWhat it doesOffered
check_launchThe API's own check of a launch: the price per running hour it would lock and every reason (blockers) a real launch would be refused today. Creates nothing.always
save_server_as_templateSaves a server's launch settings as a private template; secret values are never copied (secretsToFill).--allow-writes
update_endpoint_settingsChanges an endpoint's workers, idle time, concurrency, spend cap, queue and job limits, rateLimitPerMinute (0 = platform limit) and autoRollback.--allow-writes, confirm: true
pause_endpointRefuses new requests and releases the workers.--allow-writes, confirm: true
resume_endpointTakes requests again; workers come back and bill.--allow-writes, confirm: true
submit_endpoint_jobQueues an async job with priority (-10 to 10), queueTtlSeconds (60 to 3600) and resultTtlSeconds (60 to 86400); input up to 1 MB.--allow-writes, confirm: true
cancel_endpoint_jobCancels a job that has not finished.--allow-writes, confirm: true
retry_endpoint_jobSends a failed, cancelled or expired job again as a new job (retryOf names the original).--allow-writes, confirm: true
purge_endpoint_queueCancels every job still waiting (running jobs untouched); dryRun counts them first.--allow-writes, confirm: true
cancel_scheduled_actionCancels a pending scheduled action.--allow-writes, confirm: true
cancel_server_requestCancels a launch request that waits for review.--allow-writes, confirm: true
update_alertChanges an alert's level (thresholdPercent, minutes, amountUsd) or switches it on or off.--allow-writes
delete_alertDeletes an alert.--allow-writes, confirm: true
unwatch_planStops watching a plan.--allow-writes
test_webhookSends one webhook.test event to a webhook now.--allow-writes
check_registry_loginTries a saved private registry login against the registry's own sign-in (nothing is pulled): accepted, refused, or unchecked with the reason.always

Left out on purpose, whatever the flags: moving money (credit transfers, promo codes, budgets, auto top-up, reserved terms, raising a price cap), creating, rotating or revoking API keys, team members, roles and invitations, sub-account changes and closure, secret values, stored registry and cloud credentials, and running commands on a server. The reasons are listed per operation in docs/SURFACES.md.

New read-only tools in 0.1.20: list_alerts, get_alert, list_scheduled_actions (each answers with a plain explanation while the platform has that feature switched off).

New tools in 0.1.14: quote_launch, get_topup_bonus (always offered), launch_server, stop_all_servers, set_server_label, create_idle_alert, schedule_server_stop, add_ssh_key, create_topup_link (with --allow-writes). destroy_server now needs serverName. Before 0.1.14 the changing tools were offered by default; add --allow-writes to keep them.

Check that it starts

APIDLY_API_KEY=... apidly-mcp --read-only    # prints "apidly-mcp 0.1.21 ready (read-only)" on stderr, then waits; Ctrl+C

The tool list is read when the client starts the server: restart it (or reload the client's MCP servers) after changing a flag.

Troubleshooting

  • HTTP 401 ... the API key was refused: APIDLY_API_KEY is wrong, expired or revoked. A server that does not start and asks for APIDLY_API_KEY was not given the client's env entry.
  • HTTP 403 ... this key may not do that (insufficient_scope): the key's scope does not allow the call. A read key changes nothing; check_launch needs a key that may launch servers; saving a template, endpoint settings and listing or testing webhooks need the full scope (webhooks also an owner or admin key). Keys cannot be widened: create a new one.
  • The assistant cannot launch or stop anything, or a tool is missing: writes are off (no --allow-writes, or --read-only / APIDLY_MCP_READ_ONLY=1, which always wins). The start line says (read-only) or (writes allowed).
  • Not done. ... call again with confirm=true: intended; the tool costs money or can lose work and needs your yes.
  • HTTP 429: reads are retried by themselves up to two more times when the wait is 30 seconds or less; changes never are. The error adds Retry after N seconds.
  • feature_unavailable: that feature is switched off on the platform; the tool stays listed and changes nothing.
  • No answer arrived, so it is not known whether ... happened: check first; a repeat with the idempotencyKey the error names is safe.
  • [cut: N more characters; narrow the request]: one answer is limited to 60,000 characters; filter, lower limit or page with cursor.

Full guide: https://apidly.com/docs/mcp