multisite-cms-mcp 1.7.3 → 1.7.5

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/dist/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
1
  #!/usr/bin/env node
2
- export {};
2
+ /**
3
+ * Wait for any in-progress authentication to complete
4
+ */
5
+ export declare function waitForAuth(): Promise<void>;
3
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAiqBA;;GAEG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAIjD"}
package/dist/index.js CHANGED
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  };
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.waitForAuth = waitForAuth;
37
38
  const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
38
39
  const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
39
40
  const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
@@ -649,6 +650,16 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
649
650
  };
650
651
  }
651
652
  });
653
+ // Track in-progress authentication
654
+ let authInProgress = null;
655
+ /**
656
+ * Wait for any in-progress authentication to complete
657
+ */
658
+ async function waitForAuth() {
659
+ if (authInProgress) {
660
+ await authInProgress;
661
+ }
662
+ }
652
663
  async function main() {
653
664
  const transport = new stdio_js_1.StdioServerTransport();
654
665
  // Check authentication status (non-blocking)
@@ -659,11 +670,14 @@ async function main() {
659
670
  const { startDeviceFlow } = await Promise.resolve().then(() => __importStar(require('./lib/device-flow')));
660
671
  console.error('FastMode MCP Server - Authentication Required');
661
672
  console.error('Starting authentication flow...');
662
- // Start auth in background (don't block server startup)
663
- startDeviceFlow().then(result => {
673
+ // Start auth in background but track it so tools can wait
674
+ authInProgress = startDeviceFlow();
675
+ authInProgress.then(result => {
664
676
  console.error(result);
677
+ authInProgress = null;
665
678
  }).catch(err => {
666
679
  console.error('Authentication error:', err);
680
+ authInProgress = null;
667
681
  });
668
682
  }
669
683
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../../src/lib/api-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED;;GAEG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,SAAS,CAAC,CAgB5D;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAKxC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAED;;GAEG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,OAAO,CAAC,CAO5D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAS/C;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAChC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CA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Q,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAChC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,GAAG,QAAQ,CAAC,CAoEjC;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,QAAQ,CAOlE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAEvD;AAYD;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAwCnH;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,CAAC,EACxC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAM,GAChD,OAAO,CAAC;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,GAAG,QAAQ,CAAC,CAOjC"}
@@ -3,6 +3,39 @@
3
3
  * Centralized API client for FastMode API requests
4
4
  * Uses stored credentials with automatic refresh, or falls back to env var
5
5
  */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || (function () {
23
+ var ownKeys = function(o) {
24
+ ownKeys = Object.getOwnPropertyNames || function (o) {
25
+ var ar = [];
26
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
27
+ return ar;
28
+ };
29
+ return ownKeys(o);
30
+ };
31
+ return function (mod) {
32
+ if (mod && mod.__esModule) return mod;
33
+ var result = {};
34
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
35
+ __setModuleDefault(result, mod);
36
+ return result;
37
+ };
38
+ })();
6
39
  Object.defineProperty(exports, "__esModule", { value: true });
7
40
  exports.getApiUrl = getApiUrl;
8
41
  exports.getApiConfigAsync = getApiConfigAsync;
@@ -59,6 +92,14 @@ function isAuthConfigured() {
59
92
  * Check if we need to trigger the device flow
60
93
  */
61
94
  async function needsAuthentication() {
95
+ // Wait for any startup auth that might be in progress
96
+ try {
97
+ const { waitForAuth } = await Promise.resolve().then(() => __importStar(require('../index')));
98
+ await waitForAuth();
99
+ }
100
+ catch {
101
+ // Ignore if waitForAuth not available
102
+ }
62
103
  const credentials = await (0, credentials_1.getValidCredentials)();
63
104
  if (credentials)
64
105
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"device-flow.d.ts","sourceRoot":"","sources":["../../src/lib/device-flow.ts"],"names":[],"mappings":"AA0DA;;;GAGG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC,CA+FvD;AA0ED;;;GAGG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC;IAAE,aAAa,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAuBhG"}
1
+ {"version":3,"file":"device-flow.d.ts","sourceRoot":"","sources":["../../src/lib/device-flow.ts"],"names":[],"mappings":"AA0DA;;;GAGG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC,CAqGvD;AA0ED;;;GAGG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC;IAAE,aAAa,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CA+BhG"}
@@ -130,6 +130,9 @@ ${authResponse.verification_uri}
130
130
 
131
131
  And enter this code: ${authResponse.user_code}
132
132
 
133
+ **Don't have a Fast Mode account?**
134
+ Sign up at https://fastmode.ai first, then return here.
135
+
133
136
  Waiting for authorization...
134
137
  `);
135
138
  // Start polling
@@ -151,7 +154,10 @@ You can now use FastMode MCP tools.
151
154
 
152
155
  ${pollResult.error || 'Authorization timed out or was denied.'}
153
156
 
154
- Please try again with \`list_projects\` or \`get_tenant_schema\`.
157
+ **Don't have an account?**
158
+ Sign up at https://fastmode.ai and then try again.
159
+
160
+ **To retry:** Call any authenticated tool like \`list_projects\` to start a new auth flow.
155
161
  `;
156
162
  }
157
163
  }
@@ -217,6 +223,14 @@ async function pollForToken(apiUrl, deviceCode, interval, expiresAt) {
217
223
  async function ensureAuthenticated() {
218
224
  // Import here to avoid circular dependency
219
225
  const { getValidCredentials } = await Promise.resolve().then(() => __importStar(require('./credentials')));
226
+ // Wait for any startup auth that might be in progress
227
+ try {
228
+ const { waitForAuth } = await Promise.resolve().then(() => __importStar(require('../index')));
229
+ await waitForAuth();
230
+ }
231
+ catch {
232
+ // Ignore if waitForAuth not available
233
+ }
220
234
  const credentials = await getValidCredentials();
221
235
  if (credentials) {
222
236
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multisite-cms-mcp",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
4
4
  "description": "MCP server for Fast Mode CMS. Convert websites, validate packages, and deploy directly to Fast Mode. Includes authentication, project creation, schema sync, and one-click deployment.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {