@wplaunchify/ml-mcp-server 2.6.1 → 2.6.3
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/server.js +7 -8
- package/build/tools/index.js +8 -4
- package/build/wordpress.js +33 -31
- package/package.json +1 -1
package/build/server.js
CHANGED
|
@@ -91,16 +91,16 @@ console.error(`✅ Registered ${registeredCount} of ${allTools.length} tools`);
|
|
|
91
91
|
async function main() {
|
|
92
92
|
const { logToFile } = await import('./wordpress.js');
|
|
93
93
|
logToFile('Starting WordPress MCP server...');
|
|
94
|
-
//
|
|
95
|
-
//
|
|
94
|
+
// CRITICAL: DO NOT call initWordPress() during startup
|
|
95
|
+
// It will be called lazily on first tool execution
|
|
96
|
+
// This prevents blocking when multiple servers start simultaneously
|
|
96
97
|
if (!process.env.WORDPRESS_API_URL) {
|
|
97
|
-
logToFile('Warning: WORDPRESS_API_URL not set. Will
|
|
98
|
+
logToFile('Warning: WORDPRESS_API_URL not set. Will be initialized on first tool call.');
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
logToFile('WORDPRESS_API_URL is set. Client will be initialized on first tool call.');
|
|
98
102
|
}
|
|
99
103
|
try {
|
|
100
|
-
logToFile('Initializing WordPress client...');
|
|
101
|
-
const { initWordPress } = await import('./wordpress.js');
|
|
102
|
-
await initWordPress();
|
|
103
|
-
logToFile('WordPress client initialized successfully.');
|
|
104
104
|
logToFile('Setting up server transport...');
|
|
105
105
|
const transport = new StdioServerTransport();
|
|
106
106
|
await server.connect(transport);
|
|
@@ -108,7 +108,6 @@ async function main() {
|
|
|
108
108
|
}
|
|
109
109
|
catch (error) {
|
|
110
110
|
logToFile(`Failed to initialize server: ${error}`);
|
|
111
|
-
// Don't exit immediately - let the MCP client handle the error
|
|
112
111
|
throw error;
|
|
113
112
|
}
|
|
114
113
|
}
|
package/build/tools/index.js
CHANGED
|
@@ -35,7 +35,9 @@ const toolCategories = {
|
|
|
35
35
|
...pluginRepositoryTools,
|
|
36
36
|
...commentTools,
|
|
37
37
|
...mlCanvasTools,
|
|
38
|
-
...mlSimpleSiteTools
|
|
38
|
+
...mlSimpleSiteTools,
|
|
39
|
+
...mlImageEditorTools, // AI image generation via ML Image Editor
|
|
40
|
+
...mlMediaHubTools // Image search & icon import via ML Media Hub P2P
|
|
39
41
|
],
|
|
40
42
|
// Full FluentCommunity (91 tools) - legacy support
|
|
41
43
|
fluentcommunity: [
|
|
@@ -79,7 +81,7 @@ const toolCategories = {
|
|
|
79
81
|
]
|
|
80
82
|
};
|
|
81
83
|
const handlerCategories = {
|
|
82
|
-
// WP (ENABLED_TOOLS=wordpress) - 45 tools
|
|
84
|
+
// WP (ENABLED_TOOLS=wordpress) - 45+ tools (includes ML Image Editor & Media Hub)
|
|
83
85
|
wordpress: {
|
|
84
86
|
...unifiedContentHandlers,
|
|
85
87
|
...unifiedTaxonomyHandlers,
|
|
@@ -88,8 +90,10 @@ const handlerCategories = {
|
|
|
88
90
|
...userHandlers,
|
|
89
91
|
...pluginRepositoryHandlers,
|
|
90
92
|
...commentHandlers,
|
|
91
|
-
...mlCanvasHandlers, // ML Canvas
|
|
92
|
-
...mlSimpleSiteHandlers // ML Simple Site tools
|
|
93
|
+
...mlCanvasHandlers, // ML Canvas Block tools
|
|
94
|
+
...mlSimpleSiteHandlers, // ML Simple Site tools
|
|
95
|
+
...mlImageEditorHandlers, // AI image generation
|
|
96
|
+
...mlMediaHubHandlers // Image search & icon import
|
|
93
97
|
},
|
|
94
98
|
fluentcommunity: {
|
|
95
99
|
...fluentCommunityHandlers,
|
package/build/wordpress.js
CHANGED
|
@@ -84,8 +84,10 @@ export function logToFile(message) {
|
|
|
84
84
|
* @returns Response data
|
|
85
85
|
*/
|
|
86
86
|
export async function makeWordPressRequest(method, endpoint, data, options) {
|
|
87
|
+
// Lazy initialization - initialize on first request if not already done
|
|
87
88
|
if (!wpClient) {
|
|
88
|
-
|
|
89
|
+
logToFile('WordPress client not initialized, initializing now...');
|
|
90
|
+
await initWordPress();
|
|
89
91
|
}
|
|
90
92
|
// Log data (skip for FormData which can't be stringified)
|
|
91
93
|
if (!options?.isFormData) {
|
|
@@ -118,29 +120,29 @@ export async function makeWordPressRequest(method, endpoint, data, options) {
|
|
|
118
120
|
else {
|
|
119
121
|
requestConfig.data = data;
|
|
120
122
|
}
|
|
121
|
-
const requestLog = `
|
|
122
|
-
REQUEST:
|
|
123
|
-
URL: ${fullUrl}
|
|
124
|
-
Method: ${method}
|
|
125
|
-
Headers: ${JSON.stringify({ ...wpClient.defaults.headers, ...requestConfig.headers }, null, 2)}
|
|
126
|
-
Data: ${options?.isFormData ? '(FormData not shown)' : JSON.stringify(data, null, 2)}
|
|
123
|
+
const requestLog = `
|
|
124
|
+
REQUEST:
|
|
125
|
+
URL: ${fullUrl}
|
|
126
|
+
Method: ${method}
|
|
127
|
+
Headers: ${JSON.stringify({ ...wpClient.defaults.headers, ...requestConfig.headers }, null, 2)}
|
|
128
|
+
Data: ${options?.isFormData ? '(FormData not shown)' : JSON.stringify(data, null, 2)}
|
|
127
129
|
`;
|
|
128
130
|
logToFile(requestLog);
|
|
129
131
|
const response = await wpClient.request(requestConfig);
|
|
130
|
-
const responseLog = `
|
|
131
|
-
RESPONSE:
|
|
132
|
-
Status: ${response.status}
|
|
133
|
-
Data: ${JSON.stringify(response.data, null, 2)}
|
|
132
|
+
const responseLog = `
|
|
133
|
+
RESPONSE:
|
|
134
|
+
Status: ${response.status}
|
|
135
|
+
Data: ${JSON.stringify(response.data, null, 2)}
|
|
134
136
|
`;
|
|
135
137
|
logToFile(responseLog);
|
|
136
138
|
return options?.rawResponse ? response : response.data;
|
|
137
139
|
}
|
|
138
140
|
catch (error) {
|
|
139
|
-
const errorLog = `
|
|
140
|
-
ERROR:
|
|
141
|
-
Message: ${error.message}
|
|
142
|
-
Status: ${error.response?.status || 'N/A'}
|
|
143
|
-
Data: ${JSON.stringify(error.response?.data || {}, null, 2)}
|
|
141
|
+
const errorLog = `
|
|
142
|
+
ERROR:
|
|
143
|
+
Message: ${error.message}
|
|
144
|
+
Status: ${error.response?.status || 'N/A'}
|
|
145
|
+
Data: ${JSON.stringify(error.response?.data || {}, null, 2)}
|
|
144
146
|
`;
|
|
145
147
|
console.error(errorLog);
|
|
146
148
|
logToFile(errorLog);
|
|
@@ -180,11 +182,11 @@ export async function searchWordPressPluginRepository(searchQuery, page = 1, per
|
|
|
180
182
|
}
|
|
181
183
|
}
|
|
182
184
|
};
|
|
183
|
-
const requestLog = `
|
|
184
|
-
WORDPRESS.ORG PLUGIN API REQUEST:
|
|
185
|
-
URL: ${apiUrl}
|
|
186
|
-
Method: GET
|
|
187
|
-
Params: ${JSON.stringify(requestData, null, 2)}
|
|
185
|
+
const requestLog = `
|
|
186
|
+
WORDPRESS.ORG PLUGIN API REQUEST:
|
|
187
|
+
URL: ${apiUrl}
|
|
188
|
+
Method: GET
|
|
189
|
+
Params: ${JSON.stringify(requestData, null, 2)}
|
|
188
190
|
`;
|
|
189
191
|
logToFile(requestLog);
|
|
190
192
|
// WordPress.org Plugin API requires GET requests with serialized query parameters
|
|
@@ -210,21 +212,21 @@ Params: ${JSON.stringify(requestData, null, 2)}
|
|
|
210
212
|
return flatParams.toString();
|
|
211
213
|
}
|
|
212
214
|
});
|
|
213
|
-
const responseLog = `
|
|
214
|
-
WORDPRESS.ORG PLUGIN API RESPONSE:
|
|
215
|
-
Status: ${response.status}
|
|
216
|
-
Info: ${JSON.stringify(response.data.info, null, 2)}
|
|
217
|
-
Plugins Count: ${response.data.plugins?.length || 0}
|
|
215
|
+
const responseLog = `
|
|
216
|
+
WORDPRESS.ORG PLUGIN API RESPONSE:
|
|
217
|
+
Status: ${response.status}
|
|
218
|
+
Info: ${JSON.stringify(response.data.info, null, 2)}
|
|
219
|
+
Plugins Count: ${response.data.plugins?.length || 0}
|
|
218
220
|
`;
|
|
219
221
|
logToFile(responseLog);
|
|
220
222
|
return response.data;
|
|
221
223
|
}
|
|
222
224
|
catch (error) {
|
|
223
|
-
const errorLog = `
|
|
224
|
-
WORDPRESS.ORG PLUGIN API ERROR:
|
|
225
|
-
Message: ${error.message}
|
|
226
|
-
Status: ${error.response?.status || 'N/A'}
|
|
227
|
-
Data: ${JSON.stringify(error.response?.data || {}, null, 2)}
|
|
225
|
+
const errorLog = `
|
|
226
|
+
WORDPRESS.ORG PLUGIN API ERROR:
|
|
227
|
+
Message: ${error.message}
|
|
228
|
+
Status: ${error.response?.status || 'N/A'}
|
|
229
|
+
Data: ${JSON.stringify(error.response?.data || {}, null, 2)}
|
|
228
230
|
`;
|
|
229
231
|
console.error(errorLog);
|
|
230
232
|
logToFile(errorLog);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wplaunchify/ml-mcp-server",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.3",
|
|
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",
|