@wplaunchify/ml-mcp-server 2.4.9 → 2.4.10
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 -4
- package/package.json +1 -1
package/build/server.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// src/server.ts
|
|
3
3
|
import * as dotenv from 'dotenv';
|
|
4
|
-
|
|
4
|
+
// Load environment variables from .env file if it exists (optional for npx usage)
|
|
5
|
+
dotenv.config({ path: '.env' });
|
|
5
6
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
6
7
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
7
8
|
import { allTools, toolHandlers } from './tools/index.js';
|
|
@@ -88,9 +89,10 @@ console.error(`✅ Registered ${registeredCount} of ${allTools.length} tools`);
|
|
|
88
89
|
async function main() {
|
|
89
90
|
const { logToFile } = await import('./wordpress.js');
|
|
90
91
|
logToFile('Starting WordPress MCP server...');
|
|
92
|
+
// Environment variables are passed by MCP client (Claude Desktop, Cursor, etc.)
|
|
93
|
+
// Don't exit here - let initWordPress() handle the validation
|
|
91
94
|
if (!process.env.WORDPRESS_API_URL) {
|
|
92
|
-
logToFile('
|
|
93
|
-
process.exit(1);
|
|
95
|
+
logToFile('Warning: WORDPRESS_API_URL not set. Will fail on first tool call if not provided by MCP client.');
|
|
94
96
|
}
|
|
95
97
|
try {
|
|
96
98
|
logToFile('Initializing WordPress client...');
|
|
@@ -104,7 +106,8 @@ async function main() {
|
|
|
104
106
|
}
|
|
105
107
|
catch (error) {
|
|
106
108
|
logToFile(`Failed to initialize server: ${error}`);
|
|
107
|
-
|
|
109
|
+
// Don't exit immediately - let the MCP client handle the error
|
|
110
|
+
throw error;
|
|
108
111
|
}
|
|
109
112
|
}
|
|
110
113
|
// Handle process signals and errors
|
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.10",
|
|
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",
|