@wplaunchify/ml-mcp-server 2.5.11 → 2.6.1

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.
@@ -332,6 +332,23 @@ export declare const mlSimpleSiteHandlers: {
332
332
  }[];
333
333
  };
334
334
  }>;
335
+ mlss_get_revision_content: (args: any) => Promise<{
336
+ toolResult: {
337
+ content: {
338
+ type: string;
339
+ text: string;
340
+ }[];
341
+ isError?: undefined;
342
+ };
343
+ } | {
344
+ toolResult: {
345
+ isError: boolean;
346
+ content: {
347
+ type: string;
348
+ text: string;
349
+ }[];
350
+ };
351
+ }>;
335
352
  mlss_restore_revision: (args: any) => Promise<{
336
353
  toolResult: {
337
354
  content: {
@@ -119,6 +119,13 @@ export const mlSimpleSiteTools = [
119
119
  description: 'List all saved revisions of the SimpleSite with metadata (index, description, timestamp, user, block count). Use this to show version history or before restoring.',
120
120
  inputSchema: { type: 'object', properties: {} },
121
121
  },
122
+ {
123
+ name: 'mlss_get_revision_content',
124
+ description: 'Get full content of a specific revision (blocks, settings, metadata) WITHOUT restoring it. Perfect for previewing, comparing, or showing users what\'s in a revision before deciding to restore.',
125
+ inputSchema: { type: 'object', properties: z.object({
126
+ revision_index: z.number().describe('Index of revision to preview (get from mlss_get_revisions)'),
127
+ }).shape },
128
+ },
122
129
  {
123
130
  name: 'mlss_restore_revision',
124
131
  description: 'Restore a specific revision by index. Automatically saves current state before restoring. Perfect for rolling back changes or A/B testing.',
@@ -375,6 +382,30 @@ export const mlSimpleSiteHandlers = {
375
382
  };
376
383
  }
377
384
  },
385
+ mlss_get_revision_content: async (args) => {
386
+ try {
387
+ const response = await makeWordPressRequest('GET', `mlss/v1/revision-content?revision_index=${args.revision_index}`);
388
+ return {
389
+ toolResult: {
390
+ content: [{
391
+ type: 'text',
392
+ text: JSON.stringify(response, null, 2)
393
+ }]
394
+ }
395
+ };
396
+ }
397
+ catch (error) {
398
+ return {
399
+ toolResult: {
400
+ isError: true,
401
+ content: [{
402
+ type: 'text',
403
+ text: `Error getting revision content: ${error.message}`
404
+ }]
405
+ }
406
+ };
407
+ }
408
+ },
378
409
  mlss_restore_revision: async (args) => {
379
410
  try {
380
411
  const response = await makeWordPressRequest('POST', 'mlss/v1/restore-revision', args);
@@ -16,14 +16,6 @@ export declare function makeWordPressRequest(method: string, endpoint: string, d
16
16
  isFormData?: boolean;
17
17
  rawResponse?: boolean;
18
18
  }): Promise<any>;
19
- /**
20
- * Detect which plugins are installed and active
21
- * Returns a set of plugin slugs that are active
22
- *
23
- * IMPORTANT: This function makes an HTTP request and should NOT block server startup.
24
- * It has a timeout and fails gracefully to prevent Claude Desktop crashes.
25
- */
26
- export declare function detectInstalledPlugins(): Promise<Set<string>>;
27
19
  /**
28
20
  * Make a request to the WordPress.org Plugin Repository API
29
21
  * @param searchQuery Search query string
@@ -42,10 +42,11 @@ export async function initWordPress() {
42
42
  };
43
43
  }
44
44
  wpClient = axios.create(config);
45
- // Optionally verify connection to WordPress API (don't crash if it fails)
46
- // This prevents startup crashes when multiple servers start simultaneously
47
- const skipInitCheck = process.env.SKIP_INIT_CHECK === 'true';
48
- if (!skipInitCheck) {
45
+ // CRITICAL: NO HTTP requests during startup to prevent Claude Desktop hangs
46
+ // Connection will be verified on first tool call instead
47
+ // Set VERIFY_CONNECTION_ON_STARTUP=true to enable startup verification (NOT recommended)
48
+ const verifyOnStartup = process.env.VERIFY_CONNECTION_ON_STARTUP === 'true';
49
+ if (verifyOnStartup) {
49
50
  try {
50
51
  await wpClient.get('');
51
52
  logToFile('Successfully connected to WordPress API');
@@ -57,7 +58,8 @@ export async function initWordPress() {
57
58
  }
58
59
  }
59
60
  else {
60
- logToFile('Skipping WordPress API connection verification (SKIP_INIT_CHECK=true)');
61
+ logToFile('Skipping WordPress API connection verification during startup (prevents Claude Desktop hangs)');
62
+ logToFile('Connection will be verified on first tool call.');
61
63
  }
62
64
  }
63
65
  // Configure logging
@@ -145,52 +147,6 @@ Data: ${JSON.stringify(error.response?.data || {}, null, 2)}
145
147
  throw error;
146
148
  }
147
149
  }
148
- /**
149
- * Detect which plugins are installed and active
150
- * Returns a set of plugin slugs that are active
151
- *
152
- * IMPORTANT: This function makes an HTTP request and should NOT block server startup.
153
- * It has a timeout and fails gracefully to prevent Claude Desktop crashes.
154
- */
155
- export async function detectInstalledPlugins() {
156
- const installedPlugins = new Set();
157
- // Check if plugin detection should be skipped
158
- const skipDetection = process.env.SKIP_PLUGIN_DETECTION === 'true';
159
- if (skipDetection) {
160
- logToFile('Plugin detection skipped (SKIP_PLUGIN_DETECTION=true)');
161
- return installedPlugins; // Return empty set - will load all tools
162
- }
163
- try {
164
- // Add timeout to prevent blocking server startup
165
- const timeoutMs = 3000; // 3 seconds max
166
- const timeoutPromise = new Promise((_, reject) => {
167
- setTimeout(() => reject(new Error('Plugin detection timeout')), timeoutMs);
168
- });
169
- const detectionPromise = (async () => {
170
- // Get list of active plugins
171
- const response = await makeWordPressRequest('GET', 'wp/v2/plugins', { status: 'active' });
172
- if (Array.isArray(response)) {
173
- response.forEach((plugin) => {
174
- // Extract plugin slug from plugin path (e.g., "fluent-crm/fluent-crm.php" -> "fluent-crm")
175
- const slug = plugin.plugin?.split('/')[0] || plugin.slug;
176
- if (slug) {
177
- installedPlugins.add(slug);
178
- }
179
- });
180
- }
181
- return installedPlugins;
182
- })();
183
- // Race between detection and timeout
184
- await Promise.race([detectionPromise, timeoutPromise]);
185
- logToFile(`✓ Detected active plugins: ${Array.from(installedPlugins).join(', ')}`);
186
- }
187
- catch (error) {
188
- // Silently fail - if we can't detect plugins, we'll load all tools
189
- // This prevents server crashes when WordPress is slow or endpoint requires auth
190
- logToFile(`Plugin detection failed (will load all tools): ${error.message}`);
191
- }
192
- return installedPlugins;
193
- }
194
150
  /**
195
151
  * Make a request to the WordPress.org Plugin Repository API
196
152
  * @param searchQuery Search query string
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wplaunchify/ml-mcp-server",
3
- "version": "2.5.11",
3
+ "version": "2.6.1",
4
4
  "description": "Universal MCP Server for WordPress + Fluent Suite (Community, CRM, Cart) + FluentMCP Pro. Comprehensive tools for AI-powered WordPress management via Claude, Cursor, and other MCP clients.",
5
5
  "type": "module",
6
6
  "main": "./build/server.js",