@paraloncloud/mcp 1.3.0 → 1.4.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.
- package/README.md +15 -2
- package/package.json +1 -1
- package/server.js +65 -7
package/README.md
CHANGED
|
@@ -27,10 +27,18 @@ 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
|
|
31
|
-
| `get_rental` | Status +
|
|
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 |
|
|
32
32
|
| `list_rentals` | Your active rentals (`status: "all"` for history) | free |
|
|
33
33
|
| `destroy_rental` | Stop a rental and stop billing | — |
|
|
34
|
+
| `list_ssh_keys` | The SSH public keys an SSH rental installs | free |
|
|
35
|
+
| `add_ssh_key` | Save an SSH public key (the `.pub` line, never the private key) | free |
|
|
36
|
+
| `delete_ssh_key` | Delete a saved key; new SSH rentals stop accepting it | free |
|
|
37
|
+
|
|
38
|
+
An SSH rental installs every saved key, so the agent can make its own key, add it, rent with
|
|
39
|
+
`type: "ssh"`, and run commands on the machine. Connecting needs
|
|
40
|
+
[cloudflared](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/)
|
|
41
|
+
on the computer that holds the private key: `get_rental` returns the command.
|
|
34
42
|
|
|
35
43
|
### Your nodes, for GPU providers (key needs the `nodes` scope)
|
|
36
44
|
|
|
@@ -100,6 +108,11 @@ Optional env: `PARALON_BASE_URL` (defaults to `https://paraloncloud.com/api/v1`)
|
|
|
100
108
|
The agent calls `list_gpus`, picks a node, and calls `create_rental` with `hours: 2`. It then
|
|
101
109
|
polls `get_rental` for the Jupyter URL. Say "stop it" and it calls `destroy_rental`.
|
|
102
110
|
|
|
111
|
+
> "Rent a 4090 over SSH, run nvidia-smi on it, then stop it."
|
|
112
|
+
|
|
113
|
+
The agent makes a key with `ssh-keygen`, saves it with `add_ssh_key`, picks a node with
|
|
114
|
+
`ssh: true`, starts it with `type: "ssh"`, runs the command `get_rental` returns, and stops it.
|
|
115
|
+
|
|
103
116
|
As a provider:
|
|
104
117
|
|
|
105
118
|
> "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.
|
|
3
|
+
"version": "1.4.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
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
// MCP server for the ParalonCloud Rental API and Provider API.
|
|
3
3
|
//
|
|
4
4
|
// Exposes the REST API (https://paraloncloud.com/api/v1) as MCP tools so an AI
|
|
5
|
-
// agent can browse GPUs, rent one, poll it for
|
|
5
|
+
// agent can browse GPUs, rent one with JupyterLab or SSH, poll it for the
|
|
6
|
+
// connection, and stop it; register the SSH public keys an SSH rental logs in
|
|
7
|
+
// with;
|
|
6
8
|
// and, for a GPU provider, manage their own nodes: list them with live GPU
|
|
7
9
|
// load and temperature, add one and get its install command, take it off the
|
|
8
10
|
// market and back, set its price, reclaim a spot node, and read earnings.
|
|
@@ -87,7 +89,7 @@ function reply(result, note) {
|
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
const server = new Server(
|
|
90
|
-
{ name: "paraloncloud", version: "1.
|
|
92
|
+
{ name: "paraloncloud", version: "1.4.0" },
|
|
91
93
|
{ capabilities: { tools: {} } }
|
|
92
94
|
);
|
|
93
95
|
|
|
@@ -95,7 +97,7 @@ const TOOLS = [
|
|
|
95
97
|
{
|
|
96
98
|
name: "list_gpus",
|
|
97
99
|
description:
|
|
98
|
-
"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).",
|
|
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'.",
|
|
99
101
|
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
100
102
|
},
|
|
101
103
|
{
|
|
@@ -114,8 +116,8 @@ const TOOLS = [
|
|
|
114
116
|
node_id: { type: "string", description: "Node UUID from list_gpus." },
|
|
115
117
|
type: {
|
|
116
118
|
type: "string",
|
|
117
|
-
enum: ["jupyter"],
|
|
118
|
-
description: "
|
|
119
|
+
enum: ["jupyter", "ssh"],
|
|
120
|
+
description: "How to reach the machine. 'jupyter' (default): JupyterLab in the browser, get_rental returns a URL with its token. 'ssh': a root shell over SSH, for running commands, scp/rsync and VS Code Remote-SSH; only on a node where list_gpus says ssh: true, and it needs an SSH public key saved first (list_ssh_keys / add_ssh_key), since every saved key is installed on the machine. Prefer 'ssh' when you will run commands on the machine yourself.",
|
|
119
121
|
},
|
|
120
122
|
hours: {
|
|
121
123
|
type: "integer",
|
|
@@ -132,7 +134,7 @@ const TOOLS = [
|
|
|
132
134
|
{
|
|
133
135
|
name: "get_rental",
|
|
134
136
|
description:
|
|
135
|
-
"Get one rental's status and connection details (
|
|
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.",
|
|
136
138
|
inputSchema: {
|
|
137
139
|
type: "object",
|
|
138
140
|
properties: { rental_id: { type: "string" } },
|
|
@@ -164,6 +166,38 @@ const TOOLS = [
|
|
|
164
166
|
},
|
|
165
167
|
},
|
|
166
168
|
|
|
169
|
+
{
|
|
170
|
+
name: "list_ssh_keys",
|
|
171
|
+
description:
|
|
172
|
+
"List the SSH public keys saved for this API key's person: every one of them is installed on each SSH rental they start. Read-only, no cost.",
|
|
173
|
+
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "add_ssh_key",
|
|
177
|
+
description:
|
|
178
|
+
"Save an SSH public key so SSH rentals accept it (the key also shows on the account's SSH keys page). Pass the PUBLIC key line, e.g. the contents of ~/.ssh/id_ed25519.pub; never a private key. To make one: ssh-keygen -t ed25519 -N '' -f ~/.ssh/paralon_ed25519, then add the .pub file's line and connect with -i ~/.ssh/paralon_ed25519. A key added after a rental started is not on that rental. No cost.",
|
|
179
|
+
inputSchema: {
|
|
180
|
+
type: "object",
|
|
181
|
+
properties: {
|
|
182
|
+
public_key: { type: "string", description: "One OpenSSH public key line: 'ssh-ed25519 AAAA… comment' (ed25519, ecdsa or rsa ≥2048)." },
|
|
183
|
+
name: { type: "string", description: "Optional label, e.g. 'laptop' or 'claude-agent'. Defaults to the key's comment." },
|
|
184
|
+
},
|
|
185
|
+
required: ["public_key"],
|
|
186
|
+
additionalProperties: false,
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: "delete_ssh_key",
|
|
191
|
+
description:
|
|
192
|
+
"Delete a saved SSH public key by its id (from list_ssh_keys). New SSH rentals no longer accept it; a rental already running keeps it until it stops. Confirm with the user unless they asked for it.",
|
|
193
|
+
inputSchema: {
|
|
194
|
+
type: "object",
|
|
195
|
+
properties: { key_id: { type: "string" } },
|
|
196
|
+
required: ["key_id"],
|
|
197
|
+
additionalProperties: false,
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
|
|
167
201
|
// ---- Provider tools: the account's own nodes (key needs the 'nodes' scope)
|
|
168
202
|
{
|
|
169
203
|
name: "list_my_nodes",
|
|
@@ -340,7 +374,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
340
374
|
return reply(
|
|
341
375
|
result,
|
|
342
376
|
result.ok
|
|
343
|
-
?
|
|
377
|
+
? (body.type === "ssh"
|
|
378
|
+
? "Rental is provisioning. Call get_rental with this rental_id until status is 'running' to get the SSH command."
|
|
379
|
+
: "Rental is provisioning. Call get_rental with this rental_id until status is 'running' to get the connection URL.")
|
|
344
380
|
: undefined
|
|
345
381
|
);
|
|
346
382
|
}
|
|
@@ -376,6 +412,28 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
376
412
|
return reply(await api("DELETE", `/rentals/${encodeURIComponent(args.rental_id)}`));
|
|
377
413
|
}
|
|
378
414
|
|
|
415
|
+
case "list_ssh_keys":
|
|
416
|
+
return reply(await api("GET", "/ssh-keys"));
|
|
417
|
+
|
|
418
|
+
case "add_ssh_key": {
|
|
419
|
+
if (!args.public_key) {
|
|
420
|
+
return reply({ ok: false, data: { error: "invalid_request", message: "public_key is required: the line of a .pub file." } });
|
|
421
|
+
}
|
|
422
|
+
if (/PRIVATE KEY/.test(args.public_key)) {
|
|
423
|
+
return reply({ ok: false, data: { error: "invalid_request", message: "That is a private key. Never send it; pass the public key (the .pub file)." } });
|
|
424
|
+
}
|
|
425
|
+
const body = { public_key: args.public_key };
|
|
426
|
+
if (args.name) body.name = args.name;
|
|
427
|
+
return reply(await api("POST", "/ssh-keys", { body }));
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
case "delete_ssh_key": {
|
|
431
|
+
if (!args.key_id) {
|
|
432
|
+
return reply({ ok: false, data: { error: "invalid_request", message: "key_id is required (see list_ssh_keys)." } });
|
|
433
|
+
}
|
|
434
|
+
return reply(await api("DELETE", `/ssh-keys/${encodeURIComponent(args.key_id)}`));
|
|
435
|
+
}
|
|
436
|
+
|
|
379
437
|
// ---- Provider tools
|
|
380
438
|
case "list_my_nodes":
|
|
381
439
|
return reply(await api("GET", "/nodes"));
|