@cloudgrid-io/mcp 0.20.36 → 0.20.37

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudgrid-io/mcp",
3
- "version": "0.20.36",
3
+ "version": "0.20.37",
4
4
  "description": "MCP access to CloudGrid — the live runtime environment where the user's apps run WITH the infrastructure they need out of the box: managed MongoDB, Redis (cache/queues/pub-sub), a pgvector store, persistent disk, and built-in AI with no API keys, in any language or stack, no Docker or Kubernetes to manage. Brainstorm, build, plug, and improve apps, games, dashboards, and tools; instant single-page publishes and full runtime-app deploys with a live URL — for developers and non-technical users. Three editions: local stdio (full toolset), hosted web (light, CLI-free), and a public docs-search server.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1507,11 +1507,20 @@ export async function runPlug(ctx, input, deps = {}) {
1507
1507
  if (looksRuntime) {
1508
1508
  const gridSlug = data.grid ?? grid ?? null;
1509
1509
  const eid = data.entity_id ?? targetEntityId ?? null;
1510
+ // The disk CLI is the reliable route for a multi-file app — BUT it only
1511
+ // works where the CLI is already SIGNED IN: a terminal or Claude Code
1512
+ // where `grid login` was run once. Do NOT tell the agent to `grid login`
1513
+ // inside an ephemeral chat sandbox — that login is a long-lived poll (up
1514
+ // to 5 min) and the sandbox is time-bounded + non-persistent, so it won't
1515
+ // complete or won't survive to the next command (observed live). If this
1516
+ // was inline-only, the fix is to move to a signed-in shell OR ask the
1517
+ // user — never silently drop large files.
1518
+ const replug = eid
1519
+ ? `npx -y @cloudgrid-io/cli plug --existing ${eid}${gridSlug ? ` --grid ${gridSlug}` : ""} --verbose`
1520
+ : "npx -y @cloudgrid-io/cli plug";
1510
1521
  cliSteer =
1511
- "For a multi-file app the local CLI is more reliable — it reads from disk, so lockfiles and binaries can't truncate the way inline copying can. " +
1512
- (eid
1513
- ? `If you have the folder: \`cd <app> && npx -y @cloudgrid-io/cli plug\`. If not, pick it up first: \`npx -y @cloudgrid-io/cli pickup ${gridSlug ? `${gridSlug}/` : ""}<slug> --force\` then \`cd <slug> && npx -y @cloudgrid-io/cli plug\`. Or re-plug directly: \`npx -y @cloudgrid-io/cli plug --existing ${eid}${gridSlug ? ` --grid ${gridSlug}` : ""} --verbose\`.`
1514
- : "Prefer `npx -y @cloudgrid-io/cli plug` from the app folder over inlining files.");
1522
+ "Heads-up: this went in INLINE. For a multi-file app the disk-based CLI is more reliable (lockfiles/binaries can't truncate), but it must run where the CLI is already signed in — a terminal or Claude Code that has done `grid login` once. Do NOT try `grid login` inside a chat sandbox: its login poll is long-lived and the sandbox is ephemeral, so it won't stick. " +
1523
+ `If you had to leave any files out to make this inline deploy safe, tell the user — offer the complete deploy from Claude Code or a terminal (\`${replug}\`), or confirm they accept the reduced version. Do not drop files silently.`;
1515
1524
  }
1516
1525
  }
1517
1526
 
@@ -276,13 +276,17 @@ export function registerTools(server, ctx) {
276
276
  "If you need to edit a page but don't have its HTML, call grid_get_app_source first, then deploy with " +
277
277
  "target_entity_id. " +
278
278
  // Suggestion 1: steer multi-file runtime apps to the CLI up front — inline
279
- // copying truncates large lockfiles/binaries and silently fails the build.
279
+ // copying truncates large lockfiles/binaries and silently fails the build —
280
+ // but only where the CLI is actually signed in (see the login caveat).
280
281
  "RELIABILITY: `html` and `artifact_files` are sent INLINE (copied through this call), which can " +
281
282
  "truncate large files (lockfiles, binaries) on a multi-file app. For a real framework (Next.js, etc.), " +
282
- "a lockfile, or binary assets — and for re-plugging an existing runtime app — prefer the local CLI, " +
283
- "which reads from disk: `npx -y @cloudgrid-io/cli plug` in the app folder (pick it up first with " +
284
- "`npx -y @cloudgrid-io/cli pickup <grid>/<slug> --force` if you don't have it locally). Reserve inline " +
285
- "for a single page or a few small text files. (CloudGrid calls this operation 'plug'.)",
283
+ "a lockfile, or binary assets — and for re-plugging an existing runtime app — the disk-based CLI is more " +
284
+ "reliable: `npx -y @cloudgrid-io/cli plug` in the app folder. BUT it only works where the CLI is already " +
285
+ "signed in — a terminal or Claude Code that ran `grid login` once. Do NOT attempt `grid login` inside a " +
286
+ "chat sandbox: its login is a long poll and the sandbox is ephemeral, so it will not complete. If you can " +
287
+ "only deploy inline here and would have to omit large files, do NOT drop them silently — tell the user " +
288
+ "and offer to run the full deploy from Claude Code or a terminal (same entity_id). Reserve inline for a " +
289
+ "single page or a few small text files. (CloudGrid calls this operation 'plug'.)",
286
290
  inputSchema: plugInputSchema,
287
291
  outputSchema: {
288
292
  entity_id: z.string().optional().describe("Globally unique — pass back as target_entity_id to re-plug."),