@paraloncloud/mcp 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +9 -2
  2. package/package.json +1 -1
  3. package/server.js +23 -5
package/README.md CHANGED
@@ -27,8 +27,9 @@ using natural language.
27
27
  | --- | --- | --- |
28
28
  | `list_gpus` | List rentable GPUs with price, VRAM, compute capability, country | free |
29
29
  | `get_balance` | Your credit balance | free |
30
- | `create_rental` | Start a rental with JupyterLab or SSH (`type: "ssh"`) (async → poll) | **spends credits** |
31
- | `get_rental` | Status + the JupyterLab URL or the SSH command once running | free |
30
+ | `list_templates` | Apps a rental can start with (ComfyUI), their version and minimums | free |
31
+ | `create_rental` | Start a rental with JupyterLab or SSH (`type: "ssh"`), optionally with an app installed (`template: "comfyui"`) (async → poll) | **spends credits** |
32
+ | `get_rental` | Status + the JupyterLab URL or the SSH command once running, and an app's link (`connection.app_url`) | free |
32
33
  | `list_rentals` | Your active rentals (`status: "all"` for history) | free |
33
34
  | `destroy_rental` | Stop a rental and stop billing | — |
34
35
  | `list_ssh_keys` | The SSH public keys an SSH rental installs | free |
@@ -113,6 +114,12 @@ polls `get_rental` for the Jupyter URL. Say "stop it" and it calls `destroy_rent
113
114
  The agent makes a key with `ssh-keygen`, saves it with `add_ssh_key`, picks a node with
114
115
  `ssh: true`, starts it with `type: "ssh"`, runs the command `get_rental` returns, and stops it.
115
116
 
117
+ > "Start ComfyUI on a GPU with 24 GB for an hour and give me the link."
118
+
119
+ The agent calls `list_templates`, picks a node whose `templates` has `comfyui`, starts it with
120
+ `template: "comfyui"` and `hours: 1`, and hands you `connection.app_url` from `get_rental` once the
121
+ app answers, a minute or two after the machine.
122
+
116
123
  As a provider:
117
124
 
118
125
  > "How are my nodes doing? Is any GPU running hot?"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraloncloud/mcp",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "mcpName": "io.github.ParalonCloud/paralon-mcp",
5
5
  "description": "ParalonCloud MCP server: rent GPUs, and as a GPU provider manage your own nodes, prices and earnings, from an AI agent.",
6
6
  "license": "MIT",
package/server.js CHANGED
@@ -89,7 +89,7 @@ function reply(result, note) {
89
89
  }
90
90
 
91
91
  const server = new Server(
92
- { name: "paraloncloud", version: "1.4.0" },
92
+ { name: "paraloncloud", version: "1.5.0" },
93
93
  { capabilities: { tools: {} } }
94
94
  );
95
95
 
@@ -97,7 +97,13 @@ const TOOLS = [
97
97
  {
98
98
  name: "list_gpus",
99
99
  description:
100
- "List GPU nodes available to rent right now, with price per hour, GPU model, VRAM, CUDA compute capability, and country. Rent by the returned node_id. reserved_for_you: true marks a node its provider keeps for this key's person or organization: such nodes come first and nobody else sees them. Read-only, no cost. For modern LLM work prefer compute_cap >= 8.9 (FP8). spot: true marks a spot node: cheaper (list_price_per_hour is the on-demand price), but its provider can take it back with two minutes' notice, so avoid it for long unattended jobs. restricted_internet: true means the node's own network cannot reach the services in unreachable_services (e.g. GitHub, Hugging Face, PyPI, Docker Hub), so git clone, pip install and model or image downloads fail there; prefer a node where it is false when the job downloads anything (null means not checked yet). ssh: true means create_rental can start it with type 'ssh'.",
100
+ "List GPU nodes available to rent right now, with price per hour, GPU model, VRAM, CUDA compute capability, and country. Rent by the returned node_id. reserved_for_you: true marks a node its provider keeps for this key's person or organization: such nodes come first and nobody else sees them. Read-only, no cost. For modern LLM work prefer compute_cap >= 8.9 (FP8). spot: true marks a spot node: cheaper (list_price_per_hour is the on-demand price), but its provider can take it back with two minutes' notice, so avoid it for long unattended jobs. restricted_internet: true means the node's own network cannot reach the services in unreachable_services (e.g. GitHub, Hugging Face, PyPI, Docker Hub), so git clone, pip install and model or image downloads fail there; prefer a node where it is false when the job downloads anything (null means not checked yet). ssh: true means create_rental can start it with type 'ssh'. templates lists the apps create_rental can install on that node (e.g. [\"comfyui\"]); see list_templates.",
101
+ inputSchema: { type: "object", properties: {}, additionalProperties: false },
102
+ },
103
+ {
104
+ name: "list_templates",
105
+ description:
106
+ "List the apps a rental can start with, installed and running and opened in the browser by its own link: today ComfyUI (node-based image and video generation: Flux, SDXL, Wan). Each has a slug for create_rental's template, the version a rental gets (tested and pinned), and what a machine needs (min_vram_gb per GPU, min_disk_gb). Pick a node whose templates in list_gpus contains the slug. Read-only, no cost. Use it when the user wants to generate images or video, or names one of these apps.",
101
107
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
102
108
  },
103
109
  {
@@ -125,6 +131,10 @@ const TOOLS = [
125
131
  maximum: 720,
126
132
  description: "Optional auto-stop cap: the rental stops itself after this many whole hours. Omit (the default) for an open-ended rental that runs until stopped with destroy_rental.",
127
133
  },
134
+ template: {
135
+ type: "string",
136
+ description: "Optional app to install and start on the machine, by slug from list_templates (e.g. 'comfyui'). Only on a node whose templates in list_gpus contains it. The rental is still JupyterLab or SSH as type says, at the same price; the app comes up a minute or two after the machine answers, and get_rental then returns connection.app_url (its own link with a token). It starts empty: the user downloads models from inside the app.",
137
+ },
128
138
  name: { type: "string", description: "Optional label for the rental." },
129
139
  },
130
140
  required: ["node_id"],
@@ -134,7 +144,7 @@ const TOOLS = [
134
144
  {
135
145
  name: "get_rental",
136
146
  description:
137
- "Get one rental's status and connection details: for a JupyterLab rental connection.access_url (URL with its token), for an SSH rental connection.ssh_command (run it from the computer holding the private key; it needs cloudflared installed, and -i <private key> when the key is not in ~/.ssh). After create_rental, call this to get the URL. It WAITS internally (up to ~24s) for the rental to finish coming up and returns as soon as it's ready — so you usually only need ONE call, at most two. Do NOT call it repeatedly in a tight loop. Provisioning plus the secure tunnel take ~20-40 seconds total; the URL is ready when connection_pending is false. Read-only.",
147
+ "Get one rental's status and connection details: for a JupyterLab rental connection.access_url (URL with its token), for an SSH rental connection.ssh_command (run it from the computer holding the private key; it needs cloudflared installed, and -i <private key> when the key is not in ~/.ssh). A rental started with a template also has app (name, version, state installing / starting / ready / failed, step) and, once the app answers, connection.app_url: the link that opens it, with its token; treat it like a password. state failed means the app did not start while the machine runs and bills: say so and offer to stop it. After create_rental, call this to get the URL. It WAITS internally (up to ~24s) for the rental to finish coming up and returns as soon as it's ready — so you usually only need ONE call, at most two. Do NOT call it repeatedly in a tight loop. Provisioning plus the secure tunnel take ~20-40 seconds total; the URL is ready when connection_pending is false. Read-only.",
138
148
  inputSchema: {
139
149
  type: "object",
140
150
  properties: { rental_id: { type: "string" } },
@@ -360,6 +370,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
360
370
  case "get_balance":
361
371
  return reply(await api("GET", "/balance"));
362
372
 
373
+ case "list_templates":
374
+ return reply(await api("GET", "/templates"));
375
+
363
376
  case "create_rental": {
364
377
  if (!args.node_id) {
365
378
  return reply({ ok: false, data: { error: "invalid_request", message: "node_id is required (see list_gpus)." } });
@@ -367,6 +380,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
367
380
  const body = { node_id: args.node_id, type: args.type || "jupyter" };
368
381
  if (args.hours != null) body.hours = args.hours;
369
382
  if (args.name) body.name = args.name;
383
+ if (args.template) body.template = args.template;
370
384
  const result = await api("POST", "/rentals", {
371
385
  body,
372
386
  headers: { "Idempotency-Key": randomUUID() },
@@ -374,7 +388,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
374
388
  return reply(
375
389
  result,
376
390
  result.ok
377
- ? (body.type === "ssh"
391
+ ? (body.template
392
+ ? `Rental is provisioning with ${body.template}. Call get_rental with this rental_id: the machine answers first, the app a minute or two later; connection.app_url is its link.`
393
+ : body.type === "ssh"
378
394
  ? "Rental is provisioning. Call get_rental with this rental_id until status is 'running' to get the SSH command."
379
395
  : "Rental is provisioning. Call get_rental with this rental_id until status is 'running' to get the connection URL.")
380
396
  : undefined
@@ -390,9 +406,11 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
390
406
  // "pending" that makes the agent hammer this tool, wait here: poll every
391
407
  // 3s for up to ~24s and return as soon as the connection is ready (or the
392
408
  // budget runs out). One or two calls cover the whole startup.
409
+ // A template's app comes up after the machine: wait for it the same way.
410
+ const appPending = (d) => !!d?.app && d.status === "running" && (d.app.state === "installing" || d.app.state === "starting");
393
411
  let result = await api("GET", path);
394
412
  let waited = 0;
395
- while (result.ok && result.data && result.data.connection_pending === true && waited < 24000) {
413
+ while (result.ok && result.data && (result.data.connection_pending === true || appPending(result.data)) && waited < 24000) {
396
414
  await sleep(3000);
397
415
  waited += 3000;
398
416
  result = await api("GET", path);