@cloudgrid-io/mcp 0.20.50 → 0.20.52
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 +2 -1
- package/src/oauth.js +4 -1
- package/src/tools/cli.js +15 -7
- package/src/web.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudgrid-io/mcp",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.52",
|
|
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": {
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"smoke:web": "node test/smoke-web.mjs",
|
|
43
43
|
"smoke:redrop": "node test/smoke-redrop.mjs",
|
|
44
44
|
"smoke:oauth": "node test/smoke-oauth.mjs",
|
|
45
|
+
"test:oauth-gate": "node test/oauth-gate.test.mjs",
|
|
45
46
|
"test:auth": "node test/auth.test.mjs",
|
|
46
47
|
"test:auth-strictness": "node test/auth-strictness.test.mjs",
|
|
47
48
|
"test:win-cli": "node test/windows-cli-resolution.test.mjs",
|
package/src/oauth.js
CHANGED
|
@@ -73,8 +73,11 @@ function interstitialHtml(sid, loginUrl) {
|
|
|
73
73
|
/**
|
|
74
74
|
* Mounts the OAuth surface on an express app.
|
|
75
75
|
* publicBase = this server's public origin (e.g. https://mcp.cloudgrid.io).
|
|
76
|
+
* opts.requireAuth — when false the OAuth discovery and registration routes are
|
|
77
|
+
* not mounted (anonymous-first host has no use for them).
|
|
76
78
|
*/
|
|
77
|
-
export function mountOAuth(app, publicBase) {
|
|
79
|
+
export function mountOAuth(app, publicBase, opts = {}) {
|
|
80
|
+
if (!opts.requireAuth) return;
|
|
78
81
|
const base = publicBase.replace(/\/+$/, "");
|
|
79
82
|
|
|
80
83
|
const asMetadata = {
|
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/web.js
CHANGED
|
@@ -98,7 +98,7 @@ app.use(express.urlencoded({ extended: false })); // OAuth token exchange is for
|
|
|
98
98
|
|
|
99
99
|
app.get("/healthz", (_req, res) => res.json({ ok: true, edition: "web" }));
|
|
100
100
|
|
|
101
|
-
mountOAuth(app, PUBLIC_BASE);
|
|
101
|
+
mountOAuth(app, PUBLIC_BASE, { requireAuth: REQUIRE_AUTH });
|
|
102
102
|
|
|
103
103
|
// One transport per MCP session, keyed by the session id.
|
|
104
104
|
const transports = Object.create(null);
|