@cloudgrid-io/mcp 0.20.49 → 0.20.51
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 +64 -47
- package/package.json +1 -1
- package/src/auth.js +9 -2
- package/src/corpus/install.md +7 -2
- package/src/tools/cli.js +15 -7
- package/src/tools/deploy.js +9 -0
- package/src/tools/register.js +4 -1
package/README.md
CHANGED
|
@@ -6,17 +6,17 @@ It ships in two editions from one codebase:
|
|
|
6
6
|
|
|
7
7
|
- **Local (stdio)** — runs on your machine, full toolset including the CLI-wrapping
|
|
8
8
|
tools. This README covers it. For Claude Code, Cursor, Claude Desktop.
|
|
9
|
-
- **Web (hosted HTTP)** — a
|
|
10
|
-
|
|
9
|
+
- **Web (hosted HTTP)** — a lighter toolset (14 shared direct-API tools, no CLI
|
|
10
|
+
wrappers) for web clients like claude.ai. See [REMOTE.md](REMOTE.md).
|
|
11
11
|
|
|
12
12
|
The local edition wraps the `grid` CLI for authenticated operations (the CLI
|
|
13
13
|
handles auth, org context, and error formatting) and calls the API directly for the
|
|
14
|
-
|
|
14
|
+
plug, login, and visibility tools.
|
|
15
15
|
|
|
16
16
|
## CLI compatibility
|
|
17
17
|
|
|
18
18
|
The MCP uses an installed CLI only when it meets the platform floor
|
|
19
|
-
(`MIN_CLI_VERSION`, currently 0.15.
|
|
19
|
+
(`MIN_CLI_VERSION`, currently 0.15.14 — kept in lockstep with the API's live
|
|
20
20
|
`cli_compat` floor, which rejects older CLIs with HTTP 426). Below the floor it
|
|
21
21
|
skips the local/global CLI and lazily fetches `@cloudgrid-io/cli@latest` via
|
|
22
22
|
npx instead. A CI drift guard (`npm run test:drift-guard`) asserts every
|
|
@@ -50,13 +50,27 @@ npx -y @cloudgrid-io/mcp
|
|
|
50
50
|
Or from a clone:
|
|
51
51
|
|
|
52
52
|
```
|
|
53
|
-
cd mcp
|
|
53
|
+
cd mcp
|
|
54
54
|
npm install
|
|
55
55
|
npm start
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
It speaks MCP over stdio. Point any MCP client at the `cloudgrid-mcp` command.
|
|
59
59
|
|
|
60
|
+
### One CloudGrid server per client
|
|
61
|
+
|
|
62
|
+
Run EITHER this local (stdio) server — standalone or via the Claude Code
|
|
63
|
+
plugin, which bundles it — OR a hosted connector (`mcp.cloudgrid.io` /
|
|
64
|
+
`mcp-connected.cloudgrid.io`) in a given client. Never both: each `grid_*`
|
|
65
|
+
tool appears twice, the two servers hold separate sign-in state (the local
|
|
66
|
+
edition shares the CLI's `~/.cloudgrid/credentials`; the connector holds an
|
|
67
|
+
OAuth session), and they can disagree about whether you are signed in — the
|
|
68
|
+
model may then act on whichever answered last. How to tell: duplicate
|
|
69
|
+
`grid_*` entries in the client's tool list, or two CloudGrid servers in its
|
|
70
|
+
MCP/connector settings. Which to keep: the local edition wherever you build
|
|
71
|
+
runtime apps from folders (it has `path` + the CLI); the connector in
|
|
72
|
+
chat-only clients where you publish single pages.
|
|
73
|
+
|
|
60
74
|
### QA session log (optional)
|
|
61
75
|
|
|
62
76
|
Set `CLOUDGRID_QA_SLACK_WEBHOOK` to an **internal / private** Slack incoming-webhook
|
|
@@ -67,24 +81,29 @@ MUST be internal. Unset → the feature is fully dark (nothing captured, nothing
|
|
|
67
81
|
posted). `CLOUDGRID_QA_IDLE_MS` overrides the abandoned-idle window (default
|
|
68
82
|
900000 = 15 min).
|
|
69
83
|
|
|
84
|
+
<!-- gen:tools -->
|
|
70
85
|
## Tools
|
|
71
86
|
|
|
87
|
+
36 tools registered (14 shared across both editions, 22 local-only). No deprecated aliases. MIN_CLI_VERSION: 0.15.14.
|
|
88
|
+
|
|
72
89
|
### Direct-API tools (both editions)
|
|
73
90
|
|
|
74
|
-
| Tool | Wraps |
|
|
91
|
+
| Tool | Wraps | Summary |
|
|
75
92
|
|---|---|---|
|
|
76
|
-
| `
|
|
77
|
-
| `
|
|
78
|
-
| `
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
85
|
-
| `
|
|
86
|
-
| `
|
|
87
|
-
| `
|
|
93
|
+
| `grid_pickup` | API | Pick up an app: make your OWN COPY of any app you can see (like a git fork) into a grid you can build in. |
|
|
94
|
+
| `grid_pull` | API | Pull an app to continue/edit it IN PLACE — like `git clone` of the SAME entity: your next grid_plug (with its target_... |
|
|
95
|
+
| `grid_create_grid` | API | Create a new grid (workspace) for the signed-in user — they become its admin. |
|
|
96
|
+
| `grid_note` | API | Optionally leave a one-paragraph summary of what you built this session and why. |
|
|
97
|
+
| `grid_plug` | API | Plug an app, website, game, or single HTML page into CloudGrid — the live runtime that runs it and provides its infra... |
|
|
98
|
+
| `grid_get_app_source` | API | Retrieve the CURRENT deployed HTML of an inspiration/drop inline as text, so you can edit it and re-plug the SAME URL... |
|
|
99
|
+
| `grid_login` | API | Start a CLI-free CloudGrid sign-in. |
|
|
100
|
+
| `grid_login_status` | API | Finish a sign-in started by grid_login. |
|
|
101
|
+
| `grid_visibility` | API | Change who can see a CloudGrid inspiration OR runtime app/agent. |
|
|
102
|
+
| `grid_check_deploy` | API | Check whether an async runtime-app build has finished and the app is live. |
|
|
103
|
+
| `grid_list_grids` | API | List the signed-in user's grids, each with slug, name, role, and provisioning status. |
|
|
104
|
+
| `grid_start` | API | Orient before building with CloudGrid — the live runtime environment where the user's apps run WITH the infrastructur... |
|
|
105
|
+
| `grid_get_template` | corpus | Load a specific CloudGrid workflow, template, example, rule, or doc by name — deterministic retrieval from the bundle... |
|
|
106
|
+
| `grid_report` | API | Report a genuine CloudGrid failure to the CloudGrid team — ONLY with the user's explicit consent. |
|
|
88
107
|
|
|
89
108
|
The direct-API tools call the platform without the CLI, so they also work in
|
|
90
109
|
the web edition. `grid_login` writes the same `~/.cloudgrid/credentials` the
|
|
@@ -92,40 +111,38 @@ CLI uses, so the two share one identity.
|
|
|
92
111
|
|
|
93
112
|
### CLI-wrapping tools (local edition only)
|
|
94
113
|
|
|
95
|
-
| Tool | Wraps |
|
|
114
|
+
| Tool | Wraps | Summary |
|
|
96
115
|
|---|---|---|
|
|
97
|
-
| `grid_create_project` | `grid new` | Scaffold
|
|
98
|
-
| `grid_view_logs` | `grid logs` |
|
|
99
|
-
| `grid_share` | `grid visibility set` | Set visibility
|
|
100
|
-
| `
|
|
116
|
+
| `grid_create_project` | `grid new` | Scaffold a new CloudGrid app or agent folder (cloudgrid.yaml + a web service), optionally pre-declaring resources. |
|
|
117
|
+
| `grid_view_logs` | `grid logs` | Tail recent logs for an entity. |
|
|
118
|
+
| `grid_share` | `grid visibility set` | Set an entity's visibility and print its URL. |
|
|
119
|
+
| `grid_feedback` | `grid feedback list` | List recent feedback events for the active grid. |
|
|
120
|
+
| `grid_whoami` | `grid whoami` | Show the signed-in user and active grid. |
|
|
101
121
|
| `grid_switch_grid` | `grid use` | Switch the active grid. |
|
|
102
|
-
| `grid_logout` | `grid logout` | Sign out and clear local credentials.
|
|
103
|
-
| `grid_status` | `grid status` |
|
|
104
|
-
| `grid_info` | `grid info` |
|
|
105
|
-
| `grid_get` | `grid get grids
|
|
106
|
-
| `grid_describe_grid` | `grid describe grid <slug
|
|
107
|
-
| `grid_edit_existing_app` | `grid
|
|
108
|
-
| `grid_rename` | `grid rename` | Rename
|
|
109
|
-
| `grid_take_offline` | `grid unplug` | Take an entity off the grid.
|
|
110
|
-
| `grid_delete` | `grid delete entity` | Archive
|
|
111
|
-
| `grid_rollback_deploy` | `grid rollback` | Rollback to a previous version. |
|
|
112
|
-
| `grid_list_versions` | `grid versions` | List published versions
|
|
113
|
-
| `grid_set_env` | `grid env` |
|
|
114
|
-
| `grid_set_secret` | `grid secrets` | Set or list secret names
|
|
115
|
-
| `grid_scaffold` | `grid scaffold` |
|
|
116
|
-
| `grid_diagnose` | `grid doctor` | Run
|
|
117
|
-
| `grid_get_url` | `grid open --print` | Return the public URL
|
|
122
|
+
| `grid_logout` | `grid logout` | Sign out and clear local credentials. |
|
|
123
|
+
| `grid_status` | `grid status` | Org dashboard, entity detail, or deploy snapshot. |
|
|
124
|
+
| `grid_info` | `grid info` | Show metadata for a CloudGrid entity. |
|
|
125
|
+
| `grid_get` | `grid get <grids|entities|spaces> --json` | List CloudGrid grids, entities, or spaces. |
|
|
126
|
+
| `grid_describe_grid` | `grid describe grid <slug> --json` | Show a grid's detail: role, members, spaces, tier, wildcard-TLS state. |
|
|
127
|
+
| `grid_edit_existing_app` | `grid pull` | Continue/edit an EXISTING entity locally: download its source + cloudgrid.yaml and link the folder so your next `grid... |
|
|
128
|
+
| `grid_rename` | `grid rename` | Rename a CloudGrid entity's display name (slug stays the same). |
|
|
129
|
+
| `grid_take_offline` | `grid unplug` | Take an entity off the grid. |
|
|
130
|
+
| `grid_delete` | `grid delete entity` | Archive a CloudGrid inspiration. |
|
|
131
|
+
| `grid_rollback_deploy` | `grid rollback` | Rollback an entity to a previous version. |
|
|
132
|
+
| `grid_list_versions` | `grid versions` | List published versions for an entity. |
|
|
133
|
+
| `grid_set_env` | `grid env` | Manage environment variables for an entity. |
|
|
134
|
+
| `grid_set_secret` | `grid secrets` | Set or list secret names for an entity. |
|
|
135
|
+
| `grid_scaffold` | `grid scaffold` | Scaffold service folders declared in cloudgrid.yaml (idempotent). |
|
|
136
|
+
| `grid_diagnose` | `grid doctor` | Run CloudGrid diagnostics on the local environment. |
|
|
137
|
+
| `grid_get_url` | `grid open --print` | Return the public URL for an entity. |
|
|
138
|
+
|
|
139
|
+
<!-- /gen:tools -->
|
|
118
140
|
|
|
119
141
|
`grid_share` and `grid_visibility` overlap on purpose: `grid_share`
|
|
120
142
|
wraps the CLI and defaults to `link`; `grid_visibility` is direct API, takes an
|
|
121
|
-
explicit scope, and defaults its target to the session's last drop
|
|
143
|
+
explicit scope, and defaults its target to the session's last drop — it is the one
|
|
122
144
|
the web edition gets.
|
|
123
145
|
|
|
124
|
-
37 tool names are advertised in total: 35 canonical + 2 kept deprecated
|
|
125
|
-
aliases (`grid_fetch`, `grid_logs`). The 0.20.8 alias diet dropped the other 16
|
|
126
|
-
legacy aliases. Per-tool internals (signature, sketch, behavior):
|
|
127
|
-
[docs/TOOL-INTERNALS.md](docs/TOOL-INTERNALS.md).
|
|
128
|
-
|
|
129
146
|
All tools carry MCP annotations (`readOnlyHint`, `destructiveHint`,
|
|
130
147
|
`openWorldHint`) for clients that support them.
|
|
131
148
|
|
|
@@ -135,7 +152,7 @@ A smoke test spawns the server with a real MCP client, lists the tools, and call
|
|
|
135
152
|
the read-only `grid_feedback` tool end to end:
|
|
136
153
|
|
|
137
154
|
```
|
|
138
|
-
cd mcp
|
|
155
|
+
cd mcp
|
|
139
156
|
npm install
|
|
140
157
|
npm run smoke
|
|
141
158
|
```
|
|
@@ -146,5 +163,5 @@ It needs a logged-in CLI on `$PATH`.
|
|
|
146
163
|
|
|
147
164
|
- Shells out with `execFile` and an argument array, so there is no shell and no
|
|
148
165
|
injection surface.
|
|
149
|
-
- `
|
|
166
|
+
- `grid_view_logs` never uses `--follow`; a streaming call would never return.
|
|
150
167
|
- Stateless. Each call is one CLI invocation.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudgrid-io/mcp",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.51",
|
|
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": {
|
package/src/auth.js
CHANGED
|
@@ -25,6 +25,13 @@ const PUBLIC_API_BASE = (
|
|
|
25
25
|
process.env.CLOUDGRID_PUBLIC_API_URL || "https://api.cloudgrid.io"
|
|
26
26
|
).replace(/\/+$/, "");
|
|
27
27
|
|
|
28
|
+
// The public URL of the connected (OAuth) MCP host, used in error guidance that
|
|
29
|
+
// suggests the hosted connector as an alternative. Derived from MCP_PUBLIC_URL
|
|
30
|
+
// (set on the deployment) with a fallback.
|
|
31
|
+
const CONNECTED_MCP_HOST =
|
|
32
|
+
process.env.MCP_PUBLIC_URL?.replace(/\/+$/, "") ||
|
|
33
|
+
"https://mcp-connected.cloudgrid.io";
|
|
34
|
+
|
|
28
35
|
export function cloudgridHome() {
|
|
29
36
|
return process.env.CLOUDGRID_HOME || join(homedir(), ".cloudgrid");
|
|
30
37
|
}
|
|
@@ -52,7 +59,7 @@ const CERT_ERROR_GUIDANCE =
|
|
|
52
59
|
"- Install the root CA into your OS trust store (macOS Keychain, Windows " +
|
|
53
60
|
"Certificate Manager, or /usr/local/share/ca-certificates on Linux), or\n" +
|
|
54
61
|
"- Set NODE_EXTRA_CA_CERTS=/path/to/root-ca.pem before launching the MCP, or\n" +
|
|
55
|
-
|
|
62
|
+
`- Use the hosted MCP connector: ${CONNECTED_MCP_HOST}/mcp`;
|
|
56
63
|
|
|
57
64
|
function throwCertError() {
|
|
58
65
|
const err = new Error(CERT_ERROR_GUIDANCE);
|
|
@@ -82,7 +89,7 @@ export async function pollStatusOnce(code) {
|
|
|
82
89
|
throw new Error(
|
|
83
90
|
`Can't reach api.cloudgrid.io (${cause}). ` +
|
|
84
91
|
`If you are behind a proxy, set HTTPS_PROXY; or use the hosted connector ` +
|
|
85
|
-
|
|
92
|
+
`${CONNECTED_MCP_HOST}/mcp.`,
|
|
86
93
|
);
|
|
87
94
|
}
|
|
88
95
|
if (res.status === 404) {
|
package/src/corpus/install.md
CHANGED
|
@@ -136,8 +136,13 @@ npx -y @cloudgrid-io/mcp
|
|
|
136
136
|
```
|
|
137
137
|
|
|
138
138
|
It wraps the same `grid` CLI and uses the same credentials, so no extra login
|
|
139
|
-
is needed. Remote-capable clients can point at
|
|
140
|
-
|
|
139
|
+
is needed. Remote-capable clients can point at one of two hosted endpoints:
|
|
140
|
+
|
|
141
|
+
- `https://mcp.cloudgrid.io/mcp` — anonymous-first; no account needed to try it.
|
|
142
|
+
- `https://mcp-connected.cloudgrid.io/mcp` — connected; native OAuth sign-in
|
|
143
|
+
when you add it (for claude.ai org connectors and clients that support OAuth).
|
|
144
|
+
|
|
145
|
+
See [USAGE.md](USAGE.md) for per-client snippets.
|
|
141
146
|
|
|
142
147
|
### Claude Desktop — one-click install
|
|
143
148
|
|
package/src/tools/cli.js
CHANGED
|
@@ -68,7 +68,12 @@ export function resolveBundledCli(deps = {}) {
|
|
|
68
68
|
const pkgPath = pathImpl.join(srcDir, "..", "node_modules", "@cloudgrid-io", "cli", "package.json");
|
|
69
69
|
if (!fsExists(pkgPath)) return null;
|
|
70
70
|
const pkg = JSON.parse(fsRead(pkgPath, "utf-8"));
|
|
71
|
-
|
|
71
|
+
// The CLI's bin renamed cloudgrid -> grid (the product verb). Accept both:
|
|
72
|
+
// current packages ship { grid: ... } only; the cloudgrid key covers a
|
|
73
|
+
// bundled pre-rename CLI. Without the grid key this rung was silently DEAD
|
|
74
|
+
// on every current install and everything fell through to npx (review L7 —
|
|
75
|
+
// the flagged future risk had already happened).
|
|
76
|
+
const bin = pkg.bin && (pkg.bin.grid || pkg.bin.cloudgrid);
|
|
72
77
|
if (!bin) return null;
|
|
73
78
|
return { entry: pathImpl.join(pathImpl.dirname(pkgPath), bin), version: pkg.version || null };
|
|
74
79
|
} catch {
|
|
@@ -358,10 +363,13 @@ export async function runCloudgrid(args, opts = {}, deps = {}) {
|
|
|
358
363
|
);
|
|
359
364
|
}
|
|
360
365
|
|
|
361
|
-
// 2. Global
|
|
362
|
-
//
|
|
363
|
-
|
|
364
|
-
|
|
366
|
+
// 2. Global CLI on PATH — version-gated. The bin renamed cloudgrid -> grid
|
|
367
|
+
// (the product verb); try `grid` first, then the pre-rename `cloudgrid`.
|
|
368
|
+
// The version gate doubles as an identity check: an unrelated `grid`
|
|
369
|
+
// binary won't print a CloudGrid semver >= the floor, so it is skipped.
|
|
370
|
+
// On Windows the bins are `.cmd` shims; run via cmd.exe (execMaybeCmd).
|
|
371
|
+
for (const name of ["grid", "cloudgrid"]) {
|
|
372
|
+
const globalBin = IS_WIN ? `${name}.cmd` : name;
|
|
365
373
|
let useGlobal = false;
|
|
366
374
|
try {
|
|
367
375
|
const { stdout: vOut } = await execMaybeCmd(
|
|
@@ -379,11 +387,11 @@ export async function runCloudgrid(args, opts = {}, deps = {}) {
|
|
|
379
387
|
useGlobal = true;
|
|
380
388
|
} else {
|
|
381
389
|
console.error(
|
|
382
|
-
`cloudgrid-mcp: global CLI ${ver || vOut.trim()} < ${MIN_CLI_VERSION}, skipping`,
|
|
390
|
+
`cloudgrid-mcp: global CLI (${name}) ${ver || vOut.trim()} < ${MIN_CLI_VERSION}, skipping`,
|
|
383
391
|
);
|
|
384
392
|
}
|
|
385
393
|
} catch {
|
|
386
|
-
// Not on PATH or --version failed —
|
|
394
|
+
// Not on PATH or --version failed — try the next name
|
|
387
395
|
}
|
|
388
396
|
if (useGlobal) {
|
|
389
397
|
try {
|
package/src/tools/deploy.js
CHANGED
|
@@ -1240,6 +1240,15 @@ export async function runPlug(ctx, input, deps = {}) {
|
|
|
1240
1240
|
"may accompany a .zip `path` — it becomes the index.html over the archive's assets.",
|
|
1241
1241
|
);
|
|
1242
1242
|
}
|
|
1243
|
+
// M3: a create/re-plug with NO source at all is a caller mistake — fail it
|
|
1244
|
+
// here with the source list instead of letting it wander into an obscure
|
|
1245
|
+
// downstream error.
|
|
1246
|
+
if (!hasHtml && !hasArtifacts && !hasPath) {
|
|
1247
|
+
throw new Error(
|
|
1248
|
+
"No source to plug. Pass exactly one of: `html` (a single inline HTML document), " +
|
|
1249
|
+
"`artifact_files` (multiple inline files), or `path` (a local file/folder/zip, local edition only).",
|
|
1250
|
+
);
|
|
1251
|
+
}
|
|
1243
1252
|
if (ctx.edition === "web" && hasPath) {
|
|
1244
1253
|
throw new Error(
|
|
1245
1254
|
"The hosted server cannot read local files — pass the source inline via `html` or `artifact_files`.",
|
package/src/tools/register.js
CHANGED
|
@@ -398,7 +398,10 @@ export function registerTools(server, ctx) {
|
|
|
398
398
|
})).optional().describe("Alias of grids (legacy picker alias)."),
|
|
399
399
|
via: z.string().optional().describe("Recovery marker: 'cli-fallback' when a signed-in create was published through the bundled CloudGrid CLI."),
|
|
400
400
|
},
|
|
401
|
-
|
|
401
|
+
// destructiveHint (M3): a re-plug with target_entity_id REPLACES what is
|
|
402
|
+
// live at a public URL in place. Versions + grid rollback exist, but the
|
|
403
|
+
// honest MCP annotation for overwrite-live-state is destructive.
|
|
404
|
+
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true },
|
|
402
405
|
...(ctx.edition === "web" && APPS_WIDGETS_ENABLED ? {
|
|
403
406
|
_meta: {
|
|
404
407
|
ui: { resourceUri: LIVE_RESULT_URI, csp: WIDGET_CSP },
|