@wplaunchify/ml-mcp-server 2.4.6 → 2.4.8
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/build/wordpress.js +16 -8
- package/package.json +1 -1
package/build/wordpress.js
CHANGED
|
@@ -9,7 +9,7 @@ let wpClient;
|
|
|
9
9
|
export async function initWordPress() {
|
|
10
10
|
const apiUrl = process.env.WORDPRESS_API_URL;
|
|
11
11
|
const username = process.env.WORDPRESS_USERNAME;
|
|
12
|
-
const appPassword = process.env.WORDPRESS_PASSWORD;
|
|
12
|
+
const appPassword = process.env.WORDPRESS_APP_PASSWORD || process.env.WORDPRESS_PASSWORD;
|
|
13
13
|
if (!apiUrl) {
|
|
14
14
|
throw new Error('WordPress API URL not found in environment variables');
|
|
15
15
|
}
|
|
@@ -42,14 +42,22 @@ export async function initWordPress() {
|
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
wpClient = axios.create(config);
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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) {
|
|
49
|
+
try {
|
|
50
|
+
await wpClient.get('');
|
|
51
|
+
logToFile('Successfully connected to WordPress API');
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
logToFile(`Warning: Failed to verify WordPress API connection: ${error.message}`);
|
|
55
|
+
logToFile('Server will continue anyway. Connection will be verified on first tool call.');
|
|
56
|
+
// Don't throw - let the server start and fail gracefully on first tool call if needed
|
|
57
|
+
}
|
|
49
58
|
}
|
|
50
|
-
|
|
51
|
-
logToFile(
|
|
52
|
-
throw new Error(`Failed to connect to WordPress API: ${error.message}`);
|
|
59
|
+
else {
|
|
60
|
+
logToFile('Skipping WordPress API connection verification (SKIP_INIT_CHECK=true)');
|
|
53
61
|
}
|
|
54
62
|
}
|
|
55
63
|
// Configure logging
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wplaunchify/ml-mcp-server",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.8",
|
|
4
4
|
"description": "Universal MCP Server for WordPress + Fluent Suite (Community, CRM, Cart) + MinuteLaunch Plugins. Comprehensive tools for AI-powered WordPress management via Claude, Cursor, and other MCP clients.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/server.js",
|