@paraloncloud/mcp 1.5.0 → 1.6.2

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 +14 -4
  2. package/package.json +1 -1
  3. package/server.js +50 -2
package/README.md CHANGED
@@ -27,8 +27,8 @@ 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
- | `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** |
30
+ | `list_templates` | Apps a rental can start with (ComfyUI, Open WebUI with Ollama, Unsloth Studio), their version and minimums | free |
31
+ | `create_rental` | Start a rental with JupyterLab or SSH (`type: "ssh"`), optionally with an app installed (`template: "comfyui"`, `"openwebui"` or `"unsloth"`; an app with its own sign-in returns it in `app.login`) (async → poll) | **spends credits** |
32
32
  | `get_rental` | Status + the JupyterLab URL or the SSH command once running, and an app's link (`connection.app_url`) | free |
33
33
  | `list_rentals` | Your active rentals (`status: "all"` for history) | free |
34
34
  | `destroy_rental` | Stop a rental and stop billing | — |
@@ -133,6 +133,9 @@ As a provider:
133
133
  - `create_rental` and `destroy_rental` change what you're billed — your MCP client will ask you
134
134
  to approve them (Claude Code/Desktop confirm tool calls by default). Keep that on.
135
135
  - `create_rental` auto-generates an idempotency key, so a retried call never starts a second GPU.
136
+ - `create_rental` takes `max_price_per_hour`, the price the agent read in `list_gpus`. If the
137
+ node costs more when the rental starts, nothing is started or charged (`price_changed`), and the
138
+ agent is told to ask you before renting at the new price.
136
139
  - Pass `hours` so a rental auto-stops even if the agent forgets to.
137
140
  - The key's `max_active_rentals` limit (set in the Console) caps concurrency regardless.
138
141
  - The node tools that change something (`add_node`, `set_node_available`, `set_node_price`,
@@ -145,12 +148,19 @@ As a provider:
145
148
  ## Test
146
149
 
147
150
  ```bash
148
- npm install
151
+ npm ci
149
152
  PARALON_API_KEY=prlc_your_key_here node smoke-test.mjs
150
153
  ```
151
154
 
152
155
  It calls the read-only tools, and the node tools only on a node that does not exist, so it
153
- changes nothing.
156
+ changes nothing. Without a key it only starts the server and checks the tool list (what CI runs).
157
+
158
+ ## Releases
159
+
160
+ Releases are published from GitHub Actions with npm provenance, never from a laptop: bump the
161
+ version in `package.json`, `server.json` and `server.js`, commit, then push an annotated tag
162
+ `vX.Y.Z`. The `publish` workflow runs the check, publishes to npm, then to the official MCP
163
+ registry. The npm page shows the commit it was built from.
154
164
 
155
165
  ## Run locally (dev)
156
166
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paraloncloud/mcp",
3
- "version": "1.5.0",
3
+ "version": "1.6.2",
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.5.0" },
92
+ { name: "paraloncloud", version: "1.6.2" },
93
93
  { capabilities: { tools: {} } }
94
94
  );
95
95
 
@@ -115,7 +115,7 @@ const TOOLS = [
115
115
  {
116
116
  name: "create_rental",
117
117
  description:
118
- "Start renting a GPU. SPENDS CREDITS (per-minute billing) — confirm with the user before calling. Asynchronous: returns a rental_id with status 'pending'. Provisioning + the secure tunnel take ~20-40 seconds. After creating, call get_rental ONCE to fetch the connection URL — it waits internally for startup and returns when ready, so do NOT poll it in a tight loop. DURATION: the rental is open-ended by default (runs until the user stops it with destroy_rental) — use open-ended as the default. When starting one, briefly tell the user it's open-ended and bills per minute until stopped, and that they can set an 'hours' auto-stop cap instead if they prefer; only pass 'hours' when the user asks for a time limit. An idempotency key is generated automatically so accidental repeats don't start a second GPU.",
118
+ "Start renting a GPU. SPENDS CREDITS (per-minute billing) — confirm with the user before calling. Asynchronous: returns a rental_id with status 'pending'. Provisioning + the secure tunnel take ~20-40 seconds. After creating, call get_rental ONCE to fetch the connection URL — it waits internally for startup and returns when ready, so do NOT poll it in a tight loop. DURATION: the rental is open-ended by default (runs until the user stops it with destroy_rental) — use open-ended as the default. When starting one, briefly tell the user it's open-ended and bills per minute until stopped, and that they can set an 'hours' auto-stop cap instead if they prefer; only pass 'hours' when the user asks for a time limit. An idempotency key is generated automatically so accidental repeats don't start a second GPU. PRICE: always pass max_price_per_hour = the price_per_hour you read for this node in list_gpus (the price you told the user). If the node now costs more, nothing is started or charged and the error is price_changed with the new price_per_hour: tell the user the new price and only retry with it as the new max_price_per_hour if they agree.",
119
119
  inputSchema: {
120
120
  type: "object",
121
121
  properties: {
@@ -136,6 +136,11 @@ const TOOLS = [
136
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
137
  },
138
138
  name: { type: "string", description: "Optional label for the rental." },
139
+ max_price_per_hour: {
140
+ type: "number",
141
+ exclusiveMinimum: 0,
142
+ description: "The highest price per hour (USD) to rent at: the price_per_hour list_gpus gave for this node. If the node costs more when the rental starts, it is refused with price_changed and nothing is started or charged.",
143
+ },
139
144
  },
140
145
  required: ["node_id"],
141
146
  additionalProperties: false,
@@ -358,6 +363,46 @@ const TOOLS = [
358
363
  },
359
364
  ];
360
365
 
366
+ // MCP tool annotations: a title, and whether a tool only reads, changes
367
+ // something, or undoes something (stops a GPU, deletes a key, takes a spot
368
+ // node back). Clients use them to decide what to confirm; Anthropic's
369
+ // connector directory requires them. None of these tools reach anything but
370
+ // the ParalonCloud API, so openWorldHint is false throughout.
371
+ const READ = { readOnlyHint: true, openWorldHint: false };
372
+ const WRITE = (idempotent) => ({ readOnlyHint: false, destructiveHint: false, idempotentHint: idempotent, openWorldHint: false });
373
+ const UNDO = { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false };
374
+ const ANNOTATIONS = {
375
+ list_gpus: { title: "List rentable GPUs", ...READ },
376
+ list_templates: { title: "List rental app templates", ...READ },
377
+ get_balance: { title: "Get credit balance", ...READ },
378
+ // Spends credits per minute; the price ceiling and the automatic
379
+ // idempotency key keep a repeat from starting a second GPU, but each call
380
+ // is a new rental, so it is not idempotent.
381
+ create_rental: { title: "Rent a GPU (spends credits)", ...WRITE(false) },
382
+ get_rental: { title: "Get a rental and its connection", ...READ },
383
+ list_rentals: { title: "List rentals", ...READ },
384
+ destroy_rental: { title: "Stop a rental (stops billing)", ...UNDO },
385
+ list_ssh_keys: { title: "List SSH keys", ...READ },
386
+ add_ssh_key: { title: "Add an SSH key", ...WRITE(false) },
387
+ delete_ssh_key: { title: "Delete an SSH key", ...UNDO },
388
+ list_my_nodes: { title: "List my GPU nodes", ...READ },
389
+ get_my_node: { title: "Get one of my nodes", ...READ },
390
+ add_node: { title: "Add a GPU node", ...WRITE(false) },
391
+ get_node_install_command: { title: "Get a node's install command", ...READ },
392
+ set_node_available: { title: "Put a node on or off the market", ...WRITE(true) },
393
+ set_node_price: { title: "Set a node's price", ...WRITE(true) },
394
+ update_node: { title: "Update a node", ...WRITE(true) },
395
+ reclaim_spot_node: { title: "Take a spot node back (stops its rental)", ...UNDO },
396
+ get_node_access: { title: "Get who can rent a node", ...READ },
397
+ // Replaces the whole list: entries left out lose access.
398
+ set_node_access: { title: "Set who can rent a node", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
399
+ get_earnings: { title: "Get provider earnings", ...READ },
400
+ };
401
+ for (const t of TOOLS) {
402
+ if (!ANNOTATIONS[t.name]) throw new Error(`tool ${t.name} has no annotations`);
403
+ t.annotations = ANNOTATIONS[t.name];
404
+ }
405
+
361
406
  server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
362
407
 
363
408
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
@@ -381,6 +426,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
381
426
  if (args.hours != null) body.hours = args.hours;
382
427
  if (args.name) body.name = args.name;
383
428
  if (args.template) body.template = args.template;
429
+ if (args.max_price_per_hour != null) body.max_price_per_hour = args.max_price_per_hour;
384
430
  const result = await api("POST", "/rentals", {
385
431
  body,
386
432
  headers: { "Idempotency-Key": randomUUID() },
@@ -393,6 +439,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
393
439
  : body.type === "ssh"
394
440
  ? "Rental is provisioning. Call get_rental with this rental_id until status is 'running' to get the SSH command."
395
441
  : "Rental is provisioning. Call get_rental with this rental_id until status is 'running' to get the connection URL.")
442
+ : result.data && result.data.error === "price_changed"
443
+ ? `Not rented: the price changed to $${result.data.price_per_hour}/h (the ceiling was $${body.max_price_per_hour}/h). Nothing was started or charged. Tell the user the new price; retry with max_price_per_hour ${result.data.price_per_hour} only if they agree.`
396
444
  : undefined
397
445
  );
398
446
  }