@cloudgrid-io/mcp 0.20.51 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudgrid-io/mcp",
3
- "version": "0.20.51",
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/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);