cloudgpu-mcp 0.16.5 → 0.16.7

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 CHANGED
@@ -179,7 +179,10 @@ The server also provides a `train_on_cloudgpu` prompt.
179
179
 
180
180
  ## Guardrails
181
181
 
182
+ - **Bounded local MCP inputs.** A tool call may contain at most 10,000 combined array entries and object members, including nested values. Larger calls are rejected before tool-schema validation or API/SSH handlers. This includes inline ComfyUI workflows; simplify oversized workflows rather than splitting a paid operation or silently dropping fields. The stdio transport also retains its 10 MiB buffered-input limit. These are local MCP limits, not a claim about the remote service.
183
+
182
184
  - **A quote first.** `create_instance` only takes a `quote_id` from `estimate_cost` and `user_confirmed=true`.
185
+ - **Restoring a Workspace on a new rental.** Set `workspace_restore_required: true` in `estimate_cost` and use its confirmed quote for `create_instance`. A `workspace_route_unavailable` response means review another configuration or region before renting. Transfer rates vary by route. Managed Jobs bind this requirement automatically when given `workspace_version_id`.
183
186
  - **Server-side limits.** Every instance is created with `max_spend_usd`, `max_hours` and an idle limit (60 minutes by default). CloudGPU's servers check them and destroy the instance when one is hit, even if your client has disconnected or your laptop is asleep.
184
187
  - **Your own ceiling.** `CLOUDGPU_MAX_SPEND_USD` and `CLOUDGPU_MAX_HOURS` cap what the agent may set.
185
188
  - **Results before shutdown.** After commands have run, `stop_instance` refuses until something has been downloaded, unless the user confirms `force=true`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudgpu-mcp",
3
- "version": "0.16.5",
3
+ "version": "0.16.7",
4
4
  "mcpName": "io.github.cloudgpu-app/cloudgpu-mcp",
5
5
  "description": "MCP server and command-line tool for cloudgpu.app: let Claude Code, Cursor, Cline, opencode, goose and other MCP clients (or you, from a terminal) rent a GPU with explicit billing quotes, run a job, fetch the results and shut it down, with spending limits the platform enforces.",
6
6
  "type": "module",
@@ -53,6 +53,6 @@
53
53
  "dependencies": {
54
54
  "@modelcontextprotocol/sdk": "^1.32.2",
55
55
  "ssh2": "^1.17.0",
56
- "zod": "^3.25.0"
56
+ "zod": "^4.6.7"
57
57
  }
58
58
  }
package/src/index.js CHANGED
@@ -42,7 +42,7 @@ import {
42
42
  shq,
43
43
  } from "./guards.js";
44
44
 
45
- const VERSION = "0.16.5";
45
+ const VERSION = "0.16.7";
46
46
  const HERE = path.dirname(fileURLToPath(import.meta.url));
47
47
  const RULES = fs.readFileSync(path.join(HERE, "..", "rules", "cloudgpu.md"), "utf8");
48
48
 
@@ -80,7 +80,9 @@ Jobs: for a batch task (one command that writes its results somewhere), run_job
80
80
  No API key yet? connect_account gives the user a link to approve this assistant with a spending limit; then finish_connect stores the key on this computer.
81
81
  The same API key also works for the OpenAI-compatible model API at ${cfg.baseUrl}/v1 (see list_models).`;
82
82
 
83
- const server = new McpServer({ name: "cloudgpu", version: VERSION }, { instructions: INSTRUCTIONS });
83
+ // Bound collection work before any tool schema validation or handler execution.
84
+ // Includes nested array entries and object members (not string bytes).
85
+ const server = new McpServer({ name: "cloudgpu", version: VERSION }, { instructions: INSTRUCTIONS, maxToolInputElements: 10000 });
84
86
  useStrictToolInputs(server);
85
87
  registerFundingTools(server,{api,wrap,ok,readOnly:cfg.readOnly});
86
88
  registerAgentReadinessTools(server,{api,wrap,ok});
@@ -237,11 +239,12 @@ server.registerTool(
237
239
  gpu_model: z.string().describe("GPU model exactly as list_gpus returns it"),
238
240
  gpu_count: z.number().int().min(1).max(8).default(1),
239
241
  hours: z.number().positive().describe("Expected run time in hours"),
242
+ workspace_restore_required: z.boolean().optional().describe("Reserve a rental for restoring a saved Workspace. Excludes suppliers with known impaired restore routes."),
240
243
  template: z.string().optional().describe("Template id from list_templates; omit for a plain GPU with Python and CUDA"),
241
244
  },
242
245
  annotations: { readOnlyHint: true, openWorldHint: true },
243
246
  },
244
- wrap(async ({ gpu_model, gpu_count = 1, hours, template, continent }) => {
247
+ wrap(async ({ gpu_model, gpu_count = 1, hours, template, continent, workspace_restore_required }) => {
245
248
  const [offers, account] = await Promise.all([api.offers(), api.account().catch(() => null)]);
246
249
  const offer = offers.find((o) => String(o.gpu_model).toLowerCase() === gpu_model.toLowerCase());
247
250
  if (!offer) {
@@ -250,7 +253,10 @@ server.registerTool(
250
253
  if (gpu_count < (offer.min_gpu_count || 1)) {
251
254
  return fail(`${offer.gpu_model} is rented in groups of at least ${offer.min_gpu_count} GPUs.`);
252
255
  }
253
- const billing = await api.rentalBillingQuote({gpuModel:offer.gpu_model,gpuCount:gpu_count,...(continent?{continent}:{}),...(template?{templateId:template}:{})});
256
+ const billing = await api.rentalBillingQuote({gpuModel:offer.gpu_model,gpuCount:gpu_count,...(continent?{continent}:{}),...(template?{templateId:template}:{}),...(workspace_restore_required?{workspaceRestoreRequired:true}:{})});
257
+ if (workspace_restore_required && billing.workspaceRestoreRequired !== true) {
258
+ return fail("workspace_route_unavailable: Select another configuration or region before renting for this Workspace.");
259
+ }
254
260
  if(continent&&billing.continent!==continent)return fail("The billing quote did not bind the requested continent. No rental was started.");
255
261
  const {hourly,increment,estimate}=rentalBilling(billing,hours);
256
262
  const balance = account ? Number(account.balance_usd) : null;
@@ -265,6 +271,7 @@ server.registerTool(
265
271
  const quote_id = quotes.put({ continent, gpu_model: offer.gpu_model, gpu_count, template, hourly, hours, estimate, billingQuoteId:billing.billingQuoteId, billingExpiresAt:billing.expiresAt, minimumChargeUsd:Number(billing.minimumChargeUsd), billingIncrementSeconds:increment });
266
272
  return ok({
267
273
  quote_id,
274
+ ...(workspace_restore_required?{workspace_restore_required:true}:{}),
268
275
  continent:continent||null,
269
276
  gpu_model: offer.gpu_model,
270
277
  gpu_count,
@@ -531,7 +538,7 @@ if (!cfg.readOnly) {
531
538
  },wrap(async (input)=>ok(await resolveModelReference(input))));
532
539
  server.registerTool("prepare_model_deployment", {
533
540
  title:"Prepare models and a ComfyUI workflow",description:"Preparation only; no GPU is started. Create a reviewed setup script for the existing ComfyUI template. Downloads go from the public model host directly to the rented GPU, never through CloudGPU storage. Use model names as categories (checkpoints, loras, vae, diffusion_models, text_encoders, clip, controlnet, upscale_models). Does not install custom nodes, execute workflows, accept licenses for the user, or promise compatibility. Pass the setup_script only after explicit approval to the existing deployment flow.",
534
- inputSchema:{model_references:z.array(z.record(z.unknown())).min(1).max(4),workflow:z.record(z.unknown()).optional()},
541
+ inputSchema:{model_references:z.array(z.record(z.string(),z.unknown())).min(1).max(4),workflow:z.record(z.string(),z.unknown()).optional()},
535
542
  annotations:{readOnlyHint:true,destructiveHint:false,idempotentHint:true,openWorldHint:false},
536
543
  },wrap(async (input)=>ok(await api.prepareModelDeployment(input))));
537
544
  server.registerTool("prepare_job_rerun", {