multisite-cms-mcp 1.7.5 → 1.7.7

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,6 +1,3 @@
1
1
  #!/usr/bin/env node
2
- /**
3
- * Wait for any in-progress authentication to complete
4
- */
5
- export declare function waitForAuth(): Promise<void>;
2
+ export {};
6
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js CHANGED
@@ -34,7 +34,6 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  };
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.waitForAuth = waitForAuth;
38
37
  const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
39
38
  const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
40
39
  const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
@@ -60,6 +59,7 @@ const server = new index_js_1.Server({
60
59
  }, {
61
60
  capabilities: {
62
61
  tools: {},
62
+ resources: {},
63
63
  },
64
64
  });
65
65
  // Define available tools
@@ -650,20 +650,57 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
650
650
  };
651
651
  }
652
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;
653
+ // Handle list resources request - helps agents that incorrectly call list_mcp_resources
654
+ server.setRequestHandler(types_js_1.ListResourcesRequestSchema, async () => {
655
+ return {
656
+ resources: [
657
+ {
658
+ uri: 'fastmode://help',
659
+ name: 'How to Use FastMode MCP',
660
+ description: 'Instructions for using FastMode tools - READ THIS if tools are not working',
661
+ mimeType: 'text/plain',
662
+ },
663
+ ],
664
+ };
665
+ });
666
+ // Handle read resource request
667
+ server.setRequestHandler(types_js_1.ReadResourceRequestSchema, async (request) => {
668
+ if (request.params.uri === 'fastmode://help') {
669
+ return {
670
+ contents: [
671
+ {
672
+ uri: 'fastmode://help',
673
+ mimeType: 'text/plain',
674
+ text: `# FastMode MCP Server - How to Use
675
+
676
+ This server exposes TOOLS, not resources. To use FastMode:
677
+
678
+ ## Available Tools (use CallMcpTool to call these):
679
+
680
+ 1. **list_projects** - List all your FastMode projects
681
+ 2. **get_tenant_schema** - Get collections/fields for a project
682
+ 3. **create_cms_item** - Create content items
683
+ 4. **deploy_package** - Deploy a website
684
+ 5. **get_started** - CALL THIS FIRST for guided help
685
+
686
+ ## Example:
687
+ Call the "list_projects" tool with no arguments to see your projects.
688
+
689
+ ## Authentication:
690
+ Authentication happens automatically via browser login on first use.
691
+
692
+ DO NOT look for resources - use the TOOLS listed above.`,
693
+ },
694
+ ],
695
+ };
661
696
  }
662
- }
697
+ throw new Error(`Unknown resource: ${request.params.uri}`);
698
+ });
663
699
  async function main() {
664
700
  const transport = new stdio_js_1.StdioServerTransport();
665
701
  // Check authentication status (non-blocking)
666
702
  const { getValidCredentials } = await Promise.resolve().then(() => __importStar(require('./lib/credentials')));
703
+ const { setAuthInProgress } = await Promise.resolve().then(() => __importStar(require('./lib/auth-state')));
667
704
  const credentials = await getValidCredentials();
668
705
  if (!credentials) {
669
706
  // No valid credentials - start device flow in background
@@ -671,13 +708,14 @@ async function main() {
671
708
  console.error('FastMode MCP Server - Authentication Required');
672
709
  console.error('Starting authentication flow...');
673
710
  // Start auth in background but track it so tools can wait
674
- authInProgress = startDeviceFlow();
675
- authInProgress.then(result => {
711
+ const authPromise = startDeviceFlow();
712
+ setAuthInProgress(authPromise);
713
+ authPromise.then(result => {
676
714
  console.error(result);
677
- authInProgress = null;
715
+ setAuthInProgress(null);
678
716
  }).catch(err => {
679
717
  console.error('Authentication error:', err);
680
- authInProgress = null;
718
+ setAuthInProgress(null);
681
719
  });
682
720
  }
683
721
  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,CAe5D;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,CAAC;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,GAAG,QAAQ,CAAC,CAoEjC;AAED;;GAEG;AACH,wBAAgB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Q,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"}
@@ -93,13 +93,8 @@ function isAuthConfigured() {
93
93
  */
94
94
  async function needsAuthentication() {
95
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
- }
96
+ const { waitForAuth } = await Promise.resolve().then(() => __importStar(require('./auth-state')));
97
+ await waitForAuth();
103
98
  const credentials = await (0, credentials_1.getValidCredentials)();
104
99
  if (credentials)
105
100
  return false;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Shared authentication state
3
+ * Separate file to avoid circular dependencies
4
+ */
5
+ /**
6
+ * Set the in-progress auth promise
7
+ */
8
+ export declare function setAuthInProgress(promise: Promise<string> | null): void;
9
+ /**
10
+ * Wait for any in-progress authentication to complete
11
+ */
12
+ export declare function waitForAuth(): Promise<void>;
13
+ //# sourceMappingURL=auth-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-state.d.ts","sourceRoot":"","sources":["../../src/lib/auth-state.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,CAEvE;AAED;;GAEG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAIjD"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /**
3
+ * Shared authentication state
4
+ * Separate file to avoid circular dependencies
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.setAuthInProgress = setAuthInProgress;
8
+ exports.waitForAuth = waitForAuth;
9
+ // Track in-progress authentication
10
+ let authInProgress = null;
11
+ /**
12
+ * Set the in-progress auth promise
13
+ */
14
+ function setAuthInProgress(promise) {
15
+ authInProgress = promise;
16
+ }
17
+ /**
18
+ * Wait for any in-progress authentication to complete
19
+ */
20
+ async function waitForAuth() {
21
+ if (authInProgress) {
22
+ await authInProgress;
23
+ }
24
+ }
@@ -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,CAqGvD;AA0ED;;;GAGG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC;IAAE,aAAa,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CA+BhG"}
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,CA2BhG"}
@@ -223,14 +223,9 @@ async function pollForToken(apiUrl, deviceCode, interval, expiresAt) {
223
223
  async function ensureAuthenticated() {
224
224
  // Import here to avoid circular dependency
225
225
  const { getValidCredentials } = await Promise.resolve().then(() => __importStar(require('./credentials')));
226
+ const { waitForAuth } = await Promise.resolve().then(() => __importStar(require('./auth-state')));
226
227
  // 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
- }
228
+ await waitForAuth();
234
229
  const credentials = await getValidCredentials();
235
230
  if (credentials) {
236
231
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multisite-cms-mcp",
3
- "version": "1.7.5",
3
+ "version": "1.7.7",
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": {