@wplaunchify/ml-mcp-server 1.0.6 → 1.0.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/server.js +35 -2
- package/build/tools/debug.d.ts +38 -0
- package/build/tools/debug.js +43 -0
- package/build/tools/index.d.ts +34 -0
- package/build/tools/index.js +20 -20
- package/package.json +2 -2
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) => {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
export declare const debugTools: Tool[];
|
|
3
|
+
export declare const debugHandlers: {
|
|
4
|
+
debug_options: (args: any) => Promise<{
|
|
5
|
+
toolResult: {
|
|
6
|
+
content: {
|
|
7
|
+
type: string;
|
|
8
|
+
text: string;
|
|
9
|
+
}[];
|
|
10
|
+
isError?: undefined;
|
|
11
|
+
};
|
|
12
|
+
} | {
|
|
13
|
+
toolResult: {
|
|
14
|
+
isError: boolean;
|
|
15
|
+
content: {
|
|
16
|
+
type: string;
|
|
17
|
+
text: string;
|
|
18
|
+
}[];
|
|
19
|
+
};
|
|
20
|
+
}>;
|
|
21
|
+
debug_fluentcrm: (args: any) => Promise<{
|
|
22
|
+
toolResult: {
|
|
23
|
+
content: {
|
|
24
|
+
type: string;
|
|
25
|
+
text: string;
|
|
26
|
+
}[];
|
|
27
|
+
isError?: undefined;
|
|
28
|
+
};
|
|
29
|
+
} | {
|
|
30
|
+
toolResult: {
|
|
31
|
+
isError: boolean;
|
|
32
|
+
content: {
|
|
33
|
+
type: string;
|
|
34
|
+
text: string;
|
|
35
|
+
}[];
|
|
36
|
+
};
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { makeWordPressRequest } from '../wordpress.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* Debug Tools
|
|
5
|
+
* Provides debugging and diagnostic tools for FluentMCP
|
|
6
|
+
*/
|
|
7
|
+
// Zod Schema Definitions
|
|
8
|
+
const debugOptionsSchema = z.object({});
|
|
9
|
+
const debugFluentCRMSchema = z.object({});
|
|
10
|
+
// Tool Definitions
|
|
11
|
+
export const debugTools = [
|
|
12
|
+
{
|
|
13
|
+
name: 'debug_options',
|
|
14
|
+
description: 'Debug endpoint to find FluentCommunity option names and values',
|
|
15
|
+
inputSchema: { type: 'object', properties: debugOptionsSchema.shape }
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'debug_fluentcrm',
|
|
19
|
+
description: 'Debug endpoint to test FluentCRM API connectivity and configuration',
|
|
20
|
+
inputSchema: { type: 'object', properties: debugFluentCRMSchema.shape }
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
// Tool Handlers
|
|
24
|
+
export const debugHandlers = {
|
|
25
|
+
debug_options: async (args) => {
|
|
26
|
+
try {
|
|
27
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/debug/options');
|
|
28
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
debug_fluentcrm: async (args) => {
|
|
35
|
+
try {
|
|
36
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/debug/fluentcrm');
|
|
37
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
package/build/tools/index.d.ts
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
2
|
export declare const allTools: Tool[];
|
|
3
3
|
export declare const toolHandlers: {
|
|
4
|
+
debug_options: (args: any) => Promise<{
|
|
5
|
+
toolResult: {
|
|
6
|
+
content: {
|
|
7
|
+
type: string;
|
|
8
|
+
text: string;
|
|
9
|
+
}[];
|
|
10
|
+
isError?: undefined;
|
|
11
|
+
};
|
|
12
|
+
} | {
|
|
13
|
+
toolResult: {
|
|
14
|
+
isError: boolean;
|
|
15
|
+
content: {
|
|
16
|
+
type: string;
|
|
17
|
+
text: string;
|
|
18
|
+
}[];
|
|
19
|
+
};
|
|
20
|
+
}>;
|
|
21
|
+
debug_fluentcrm: (args: any) => Promise<{
|
|
22
|
+
toolResult: {
|
|
23
|
+
content: {
|
|
24
|
+
type: string;
|
|
25
|
+
text: string;
|
|
26
|
+
}[];
|
|
27
|
+
isError?: undefined;
|
|
28
|
+
};
|
|
29
|
+
} | {
|
|
30
|
+
toolResult: {
|
|
31
|
+
isError: boolean;
|
|
32
|
+
content: {
|
|
33
|
+
type: string;
|
|
34
|
+
text: string;
|
|
35
|
+
}[];
|
|
36
|
+
};
|
|
37
|
+
}>;
|
|
4
38
|
mlmh_search_images: (args: any) => Promise<{
|
|
5
39
|
toolResult: {
|
|
6
40
|
content: {
|
package/build/tools/index.js
CHANGED
|
@@ -12,26 +12,26 @@ import { fluentCartTools, fluentCartHandlers } from './fluent-cart.js';
|
|
|
12
12
|
import { fluentCRMTools, fluentCRMHandlers } from './fluent-crm.js';
|
|
13
13
|
import { mlCanvasTools, mlCanvasHandlers } from './ml-canvas.js';
|
|
14
14
|
import { mlImageEditorTools, mlImageEditorHandlers } from './ml-image-editor.js';
|
|
15
|
-
import { fluentAffiliateTools, fluentAffiliateHandlers } from './fluent-affiliate.js';
|
|
16
15
|
import { mlMediaHubTools, mlMediaHubHandlers } from './ml-media-hub.js';
|
|
17
|
-
|
|
16
|
+
import { debugTools, debugHandlers } from './debug.js';
|
|
17
|
+
// Combine all tools - WordPress + FluentCommunity + FluentCRM + FluentCart + ML Plugins
|
|
18
18
|
export const allTools = [
|
|
19
|
-
...unifiedContentTools, //
|
|
20
|
-
...unifiedTaxonomyTools, //
|
|
21
|
-
...pluginTools, //
|
|
22
|
-
...mediaTools, //
|
|
23
|
-
...userTools, //
|
|
24
|
-
...pluginRepositoryTools, //
|
|
25
|
-
...commentTools, //
|
|
26
|
-
...fluentCommunityTools, //
|
|
27
|
-
...fluentCommunityDesignTools, //
|
|
28
|
-
...fluentCommunityLayoutTools, //
|
|
29
|
-
...fluentCRMTools, //
|
|
30
|
-
...fluentCartTools, //
|
|
31
|
-
...
|
|
32
|
-
...
|
|
33
|
-
...
|
|
34
|
-
...
|
|
19
|
+
...unifiedContentTools, // WordPress Core: unified content management
|
|
20
|
+
...unifiedTaxonomyTools, // WordPress Core: unified taxonomy management
|
|
21
|
+
...pluginTools, // WordPress Core: plugin management
|
|
22
|
+
...mediaTools, // WordPress Core: media library
|
|
23
|
+
...userTools, // WordPress Core: user management
|
|
24
|
+
...pluginRepositoryTools, // WordPress Core: WordPress.org plugin repository
|
|
25
|
+
...commentTools, // WordPress Core: comments
|
|
26
|
+
...fluentCommunityTools, // FluentCommunity: spaces, posts, members
|
|
27
|
+
...fluentCommunityDesignTools, // FluentCommunity: colors, branding, CSS
|
|
28
|
+
...fluentCommunityLayoutTools, // FluentCommunity: layout control
|
|
29
|
+
...fluentCRMTools, // FluentCRM: contacts, lists, campaigns
|
|
30
|
+
...fluentCartTools, // FluentCart: products, orders, customers, subscriptions
|
|
31
|
+
...mlCanvasTools, // ML Canvas Block: surgical HTML editing
|
|
32
|
+
...mlImageEditorTools, // ML Image Editor: AI generation/editing
|
|
33
|
+
...mlMediaHubTools, // ML Media Hub: image/icon search and filters
|
|
34
|
+
...debugTools // Debug: diagnostic tools
|
|
35
35
|
];
|
|
36
36
|
// Combine all handlers
|
|
37
37
|
export const toolHandlers = {
|
|
@@ -47,8 +47,8 @@ export const toolHandlers = {
|
|
|
47
47
|
...fluentCommunityLayoutHandlers,
|
|
48
48
|
...fluentCRMHandlers,
|
|
49
49
|
...fluentCartHandlers,
|
|
50
|
-
...fluentAffiliateHandlers,
|
|
51
50
|
...mlCanvasHandlers,
|
|
52
51
|
...mlImageEditorHandlers,
|
|
53
|
-
...mlMediaHubHandlers
|
|
52
|
+
...mlMediaHubHandlers,
|
|
53
|
+
...debugHandlers
|
|
54
54
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wplaunchify/ml-mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Universal MCP Server for WordPress + Fluent Suite (Community, CRM, Cart) + MinuteLaunch Plugins.
|
|
3
|
+
"version": "1.0.8",
|
|
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",
|
|
7
7
|
"exports": "./build/server.js",
|