@wplaunchify/ml-mcp-server 1.0.6 → 1.0.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/build/server.js +35 -2
- package/package.json +1 -1
package/build/server.js
CHANGED
|
@@ -6,10 +6,43 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
6
6
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
7
7
|
import { allTools, toolHandlers } from './tools/index.js';
|
|
8
8
|
import { z } from 'zod';
|
|
9
|
+
// Generate server name from WordPress URL
|
|
10
|
+
function generateServerName() {
|
|
11
|
+
const apiUrl = process.env.WORDPRESS_API_URL || '';
|
|
12
|
+
const customName = process.env.MCP_SERVER_NAME;
|
|
13
|
+
if (customName) {
|
|
14
|
+
return customName;
|
|
15
|
+
}
|
|
16
|
+
if (!apiUrl) {
|
|
17
|
+
return 'wordpress';
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
const url = new URL(apiUrl);
|
|
21
|
+
const hostname = url.hostname;
|
|
22
|
+
const parts = hostname.split('.');
|
|
23
|
+
if (parts.length >= 3) {
|
|
24
|
+
// e.g., fccmanagermcp.instawp.co
|
|
25
|
+
const subdomain = parts[0];
|
|
26
|
+
const domain = parts[1];
|
|
27
|
+
// Try with domain (no TLD): fccmanagermcp-instawp
|
|
28
|
+
const withDomain = `${subdomain}-${domain}`;
|
|
29
|
+
if (withDomain.length <= 25) {
|
|
30
|
+
return withDomain;
|
|
31
|
+
}
|
|
32
|
+
// Fallback to subdomain only: fccmanagermcp
|
|
33
|
+
return subdomain;
|
|
34
|
+
}
|
|
35
|
+
// Fallback to hostname without TLD
|
|
36
|
+
return parts.slice(0, -1).join('-') || 'wordpress';
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
return 'wordpress';
|
|
40
|
+
}
|
|
41
|
+
}
|
|
9
42
|
// Create MCP server instance
|
|
10
43
|
const server = new McpServer({
|
|
11
|
-
name:
|
|
12
|
-
version: "
|
|
44
|
+
name: generateServerName(),
|
|
45
|
+
version: "1.0.7"
|
|
13
46
|
}, {
|
|
14
47
|
capabilities: {
|
|
15
48
|
tools: allTools.reduce((acc, tool) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wplaunchify/ml-mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Universal MCP Server for WordPress + Fluent Suite (Community, CRM, Cart) + MinuteLaunch Plugins. 146 tools for AI-powered WordPress management via Claude, Cursor, and other MCP clients.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/server.js",
|