@cloudgrid-io/mcp 0.20.21 → 0.20.22

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.21",
3
+ "version": "0.20.22",
4
4
  "description": "Use CloudGrid via MCP to brainstorm, build, deploy, and improve apps, games, websites, dashboards, and tools and get a live URL - templates, recipes, managed databases and AI, instant single-page publish, and full-app deploys, for developers and non-technical users. Three editions: local stdio (full toolset), hosted web (light, CLI-free), and a public docs-search server, over MCP.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -30,6 +30,7 @@
30
30
  "test:plug-output-schema": "node test/plug-output-schema.test.mjs",
31
31
  "test:zip-deploy": "node test/zip-deploy.test.mjs",
32
32
  "test:create-gates": "node test/create-gates.test.mjs",
33
+ "test:create-project-args": "node test/create-project-args.test.mjs",
33
34
  "test:mcpb-boot": "node test/mcpb-boot.test.mjs",
34
35
  "test:plug-timeout": "node test/plug-timeout.test.mjs",
35
36
  "test:manifest-confirm": "node test/manifest-confirm.test.mjs",
@@ -68,7 +68,7 @@ export const CLI_NPX_PKG = "@cloudgrid-io/cli@latest";
68
68
  // server-side with HTTP 426) — a gate below the floor green-lights CLIs the API
69
69
  // rejects on every call (issue #59). Bump this in lockstep with every floor
70
70
  // raise (CLI release protocol checklist).
71
- export const MIN_CLI_VERSION = "0.15.2";
71
+ export const MIN_CLI_VERSION = "0.15.14";
72
72
 
73
73
  // Upload/create POST budget. The build itself is async (server returns 202 +
74
74
  // poll_url); this bounds only the request→response, so a stalled server errors
@@ -28,6 +28,21 @@ import {
28
28
  runSource,
29
29
  } from "./deploy.js";
30
30
 
31
+ // Build the argv for grid_create_project → `grid new` (CLI >= 0.15.14; `init`
32
+ // is a deprecated alias we no longer author). Modern shape: `new <slug>` with
33
+ // `--agent` for agents (NOT the legacy `init <kind> <slug>` positional). The
34
+ // old `--description` flag was removed from the CLI, so it is gone here too.
35
+ // Exported pure so the argv is unit-tested without spawning a CLI.
36
+ export function buildCreateProjectArgs({ kind, name, type, needs, dir, org } = {}) {
37
+ const args = ["new", name];
38
+ if (kind === "agent") args.push("--agent");
39
+ if (type) args.push("--type", type);
40
+ if (Array.isArray(needs) && needs.length) args.push("--needs", needs.join(","));
41
+ if (dir) args.push("--dir", dir);
42
+ if (org) args.push("--grid", org); // CLI 0.12 dropped --org for --grid (same slug)
43
+ return args;
44
+ }
45
+
31
46
  // ── Registration ───────────────────────────────────────────────────────────────
32
47
  // Registers the tools onto `server`. ctx.edition decides whether the CLI-wrapping
33
48
  // tools are included (they need a local machine).
@@ -861,26 +876,19 @@ export function registerTools(server, ctx) {
861
876
 
862
877
  regTool(
863
878
  "grid_create_project",
864
- "Register a new CloudGrid app or agent, optionally seeding a web service. Wraps `grid new` (`init` remains an alias).",
879
+ "Scaffold a new CloudGrid app or agent folder (cloudgrid.yaml + a web service), optionally pre-declaring resources. Wraps `grid new` (scaffolds locally; no server entity until you grid_deploy).",
865
880
  {
866
- kind: z.enum(["app", "agent"]).describe("Entity kind."),
881
+ kind: z.enum(["app", "agent"]).describe("Entity kind. 'agent' scaffolds an agent: block."),
867
882
  name: z.string().describe("Slug: 3-40 lowercase alphanumerics and hyphens."),
868
883
  type: z.enum(["node", "nextjs", "python", "static"]).optional().describe("Seed a web service of this type."),
869
- description: z.string().optional().describe("Initial one-line description."),
870
- dir: z.string().optional().describe("Target directory. Defaults to ./<name>."),
871
- org: z.string().optional().describe("Override the active grid for this project."),
884
+ needs: z.array(z.enum(["database", "cache", "kv", "queue", "pubsub", "vector", "ai", "disk"])).optional()
885
+ .describe("Pre-declare infrastructure needs in the scaffolded cloudgrid.yaml (e.g. [\"database\",\"ai\"])."),
886
+ dir: z.string().optional().describe("Target directory. Defaults to the current folder."),
887
+ org: z.string().optional().describe("Override the active grid this project will target."),
872
888
  cwd: z.string().optional().describe("Working directory. The CLI runs in this directory. Defaults to the MCP server's working directory."),
873
889
  },
874
890
  { readOnlyHint: false, destructiveHint: false, openWorldHint: true },
875
- cliTool(({ kind, name, type, description, dir, org }) => {
876
- const args = ["init", kind, name];
877
- if (type) args.push("--type", type);
878
- if (description) args.push("--description", description);
879
- if (dir) args.push("--dir", dir);
880
- // CLI 0.12 dropped `--org` in favour of `--grid` (same slug).
881
- if (org) args.push("--grid", org);
882
- return args;
883
- }, { cwdParam: true }),
891
+ cliTool((input) => buildCreateProjectArgs(input), { cwdParam: true }),
884
892
  );
885
893
 
886
894
  // NOTE: grid_deploy is no longer CLI-wrapping — the unified direct-API verb
package/src/tools.js CHANGED
@@ -36,5 +36,5 @@ export {
36
36
  runFork,
37
37
  runSource,
38
38
  } from "./tools/deploy.js";
39
- export { registerTools } from "./tools/register.js";
39
+ export { registerTools, buildCreateProjectArgs } from "./tools/register.js";
40
40
  export { decodeJwt } from "./auth.js";