@wplaunchify/ml-mcp-server 1.0.8 → 1.0.9
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/tools/fluent-cart-admin.d.ts +3 -0
- package/build/tools/fluent-cart-admin.js +180 -0
- package/build/tools/fluent-cart-analytics.d.ts +3 -0
- package/build/tools/fluent-cart-analytics.js +149 -0
- package/build/tools/fluent-cart-licensing.d.ts +3 -0
- package/build/tools/fluent-cart-licensing.js +66 -0
- package/build/tools/fluent-community-admin.d.ts +3 -0
- package/build/tools/fluent-community-admin.js +52 -0
- package/build/tools/fluent-community-chat.d.ts +3 -0
- package/build/tools/fluent-community-chat.js +56 -0
- package/build/tools/index.js +15 -0
- package/package.json +1 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { makeWordPressRequest } from '../wordpress.js';
|
|
3
|
+
// ==================== ZOD SCHEMA DEFINITIONS ====================
|
|
4
|
+
const listFilesSchema = z.object({
|
|
5
|
+
per_page: z.number().optional().describe('Number of files per page (default: 20)'),
|
|
6
|
+
page: z.number().optional().describe('Page number (default: 1)')
|
|
7
|
+
});
|
|
8
|
+
const getPermissionsSchema = z.object({
|
|
9
|
+
// No parameters - returns current user permissions
|
|
10
|
+
});
|
|
11
|
+
const listIntegrationAddonsSchema = z.object({
|
|
12
|
+
// No parameters - returns all integration addons
|
|
13
|
+
});
|
|
14
|
+
const getGlobalSettingsSchema = z.object({
|
|
15
|
+
// No parameters - returns global integration settings
|
|
16
|
+
});
|
|
17
|
+
const getGlobalFeedsSchema = z.object({
|
|
18
|
+
// No parameters - returns global feeds
|
|
19
|
+
});
|
|
20
|
+
const listNotificationsSchema = z.object({
|
|
21
|
+
per_page: z.number().optional().describe('Number of notifications per page (default: 20)'),
|
|
22
|
+
page: z.number().optional().describe('Page number (default: 1)')
|
|
23
|
+
});
|
|
24
|
+
const getNotificationSchema = z.object({
|
|
25
|
+
id: z.number().describe('Notification ID')
|
|
26
|
+
});
|
|
27
|
+
const listCategoriesSchema = z.object({
|
|
28
|
+
per_page: z.number().optional().describe('Number of categories per page (default: 100)'),
|
|
29
|
+
page: z.number().optional().describe('Page number (default: 1)')
|
|
30
|
+
});
|
|
31
|
+
const getCategorySchema = z.object({
|
|
32
|
+
id: z.number().describe('Category ID')
|
|
33
|
+
});
|
|
34
|
+
// ==================== TOOL DEFINITIONS ====================
|
|
35
|
+
export const fluentCartAdminTools = [
|
|
36
|
+
{
|
|
37
|
+
name: 'fcart_list_files',
|
|
38
|
+
description: 'List FluentCart digital product files',
|
|
39
|
+
inputSchema: { type: 'object', properties: listFilesSchema.shape }
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'fcart_get_permissions',
|
|
43
|
+
description: 'Get current user FluentCart permissions and capabilities',
|
|
44
|
+
inputSchema: { type: 'object', properties: getPermissionsSchema.shape }
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'fcart_list_integration_addons',
|
|
48
|
+
description: 'List available FluentCart integration addons',
|
|
49
|
+
inputSchema: { type: 'object', properties: listIntegrationAddonsSchema.shape }
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'fcart_get_global_settings',
|
|
53
|
+
description: 'Get FluentCart global integration settings',
|
|
54
|
+
inputSchema: { type: 'object', properties: getGlobalSettingsSchema.shape }
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'fcart_get_global_feeds',
|
|
58
|
+
description: 'Get FluentCart global feeds configuration',
|
|
59
|
+
inputSchema: { type: 'object', properties: getGlobalFeedsSchema.shape }
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'fcart_list_notifications',
|
|
63
|
+
description: 'List FluentCart notifications',
|
|
64
|
+
inputSchema: { type: 'object', properties: listNotificationsSchema.shape }
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'fcart_get_notification',
|
|
68
|
+
description: 'Get a specific FluentCart notification by ID',
|
|
69
|
+
inputSchema: { type: 'object', properties: getNotificationSchema.shape }
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'fcart_list_categories',
|
|
73
|
+
description: 'List FluentCart product categories',
|
|
74
|
+
inputSchema: { type: 'object', properties: listCategoriesSchema.shape }
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'fcart_get_category',
|
|
78
|
+
description: 'Get a specific FluentCart product category by ID',
|
|
79
|
+
inputSchema: { type: 'object', properties: getCategorySchema.shape }
|
|
80
|
+
}
|
|
81
|
+
];
|
|
82
|
+
// ==================== TOOL HANDLERS ====================
|
|
83
|
+
export const fluentCartAdminHandlers = {
|
|
84
|
+
fcart_list_files: async (args) => {
|
|
85
|
+
try {
|
|
86
|
+
const params = {};
|
|
87
|
+
if (args.per_page)
|
|
88
|
+
params.per_page = args.per_page;
|
|
89
|
+
if (args.page)
|
|
90
|
+
params.page = args.page;
|
|
91
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/files', params);
|
|
92
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
fcart_get_permissions: async (args) => {
|
|
99
|
+
try {
|
|
100
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/permissions');
|
|
101
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
fcart_list_integration_addons: async (args) => {
|
|
108
|
+
try {
|
|
109
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/integration/addons');
|
|
110
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
fcart_get_global_settings: async (args) => {
|
|
117
|
+
try {
|
|
118
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/integration/global-settings');
|
|
119
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
fcart_get_global_feeds: async (args) => {
|
|
126
|
+
try {
|
|
127
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/integration/global-feeds');
|
|
128
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
fcart_list_notifications: async (args) => {
|
|
135
|
+
try {
|
|
136
|
+
const params = {};
|
|
137
|
+
if (args.per_page)
|
|
138
|
+
params.per_page = args.per_page;
|
|
139
|
+
if (args.page)
|
|
140
|
+
params.page = args.page;
|
|
141
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/notifications', params);
|
|
142
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
fcart_get_notification: async (args) => {
|
|
149
|
+
try {
|
|
150
|
+
const response = await makeWordPressRequest('GET', `fc-manager/v1/fluentcart/notifications/${args.id}`);
|
|
151
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
fcart_list_categories: async (args) => {
|
|
158
|
+
try {
|
|
159
|
+
const params = {};
|
|
160
|
+
if (args.per_page)
|
|
161
|
+
params.per_page = args.per_page;
|
|
162
|
+
if (args.page)
|
|
163
|
+
params.page = args.page;
|
|
164
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/fcart/categories', params);
|
|
165
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
fcart_get_category: async (args) => {
|
|
172
|
+
try {
|
|
173
|
+
const response = await makeWordPressRequest('GET', `fc-manager/v1/fcart/categories/${args.id}`);
|
|
174
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { makeWordPressRequest } from '../wordpress.js';
|
|
3
|
+
// ==================== ZOD SCHEMA DEFINITIONS ====================
|
|
4
|
+
const getReportsOverviewSchema = z.object({
|
|
5
|
+
date_from: z.string().optional().describe('Start date (YYYY-MM-DD)'),
|
|
6
|
+
date_to: z.string().optional().describe('End date (YYYY-MM-DD)')
|
|
7
|
+
});
|
|
8
|
+
const getQuickStatsSchema = z.object({
|
|
9
|
+
// No parameters - returns current quick stats
|
|
10
|
+
});
|
|
11
|
+
const getDashboardStatsSchema = z.object({
|
|
12
|
+
// No parameters - returns dashboard statistics
|
|
13
|
+
});
|
|
14
|
+
const getAnalyticsSchema = z.object({
|
|
15
|
+
date_from: z.string().optional().describe('Start date (YYYY-MM-DD)'),
|
|
16
|
+
date_to: z.string().optional().describe('End date (YYYY-MM-DD)'),
|
|
17
|
+
type: z.enum(['revenue', 'orders', 'products', 'customers']).optional().describe('Analytics type')
|
|
18
|
+
});
|
|
19
|
+
const getSettingsSchema = z.object({
|
|
20
|
+
// No parameters - returns all FluentCart settings
|
|
21
|
+
});
|
|
22
|
+
const listTaxClassesSchema = z.object({
|
|
23
|
+
per_page: z.number().optional().describe('Number of tax classes per page (default: 100)'),
|
|
24
|
+
page: z.number().optional().describe('Page number (default: 1)')
|
|
25
|
+
});
|
|
26
|
+
const listShippingZonesSchema = z.object({
|
|
27
|
+
// No parameters - returns all shipping zones
|
|
28
|
+
});
|
|
29
|
+
// ==================== TOOL DEFINITIONS ====================
|
|
30
|
+
export const fluentCartAnalyticsTools = [
|
|
31
|
+
{
|
|
32
|
+
name: 'fcart_get_reports_overview',
|
|
33
|
+
description: 'Get FluentCart reports overview with sales, revenue, and order statistics for a date range',
|
|
34
|
+
inputSchema: { type: 'object', properties: getReportsOverviewSchema.shape }
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'fcart_get_quick_stats',
|
|
38
|
+
description: 'Get FluentCart quick statistics (today\'s sales, pending orders, low stock items, etc.)',
|
|
39
|
+
inputSchema: { type: 'object', properties: getQuickStatsSchema.shape }
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'fcart_get_dashboard_stats',
|
|
43
|
+
description: 'Get FluentCart dashboard statistics and metrics overview',
|
|
44
|
+
inputSchema: { type: 'object', properties: getDashboardStatsSchema.shape }
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'fcart_get_analytics',
|
|
48
|
+
description: 'Get detailed FluentCart analytics (already exists but kept for compatibility)',
|
|
49
|
+
inputSchema: { type: 'object', properties: getAnalyticsSchema.shape }
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'fcart_get_settings',
|
|
53
|
+
description: 'Get FluentCart global settings and configuration',
|
|
54
|
+
inputSchema: { type: 'object', properties: getSettingsSchema.shape }
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'fcart_list_tax_classes',
|
|
58
|
+
description: 'List all FluentCart tax classes',
|
|
59
|
+
inputSchema: { type: 'object', properties: listTaxClassesSchema.shape }
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'fcart_list_shipping_zones',
|
|
63
|
+
description: 'List all FluentCart shipping zones and methods',
|
|
64
|
+
inputSchema: { type: 'object', properties: listShippingZonesSchema.shape }
|
|
65
|
+
}
|
|
66
|
+
];
|
|
67
|
+
// ==================== TOOL HANDLERS ====================
|
|
68
|
+
export const fluentCartAnalyticsHandlers = {
|
|
69
|
+
fcart_get_reports_overview: async (args) => {
|
|
70
|
+
try {
|
|
71
|
+
const params = {};
|
|
72
|
+
if (args.date_from)
|
|
73
|
+
params.date_from = args.date_from;
|
|
74
|
+
if (args.date_to)
|
|
75
|
+
params.date_to = args.date_to;
|
|
76
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/reports/overview', params);
|
|
77
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
fcart_get_quick_stats: async (args) => {
|
|
84
|
+
try {
|
|
85
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/reports/quick-stats');
|
|
86
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
fcart_get_dashboard_stats: async (args) => {
|
|
93
|
+
try {
|
|
94
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/dashboard/stats');
|
|
95
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
fcart_get_analytics: async (args) => {
|
|
102
|
+
try {
|
|
103
|
+
const params = {};
|
|
104
|
+
if (args.date_from)
|
|
105
|
+
params.date_from = args.date_from;
|
|
106
|
+
if (args.date_to)
|
|
107
|
+
params.date_to = args.date_to;
|
|
108
|
+
if (args.type)
|
|
109
|
+
params.type = args.type;
|
|
110
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/analytics', params);
|
|
111
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
fcart_get_settings: async (args) => {
|
|
118
|
+
try {
|
|
119
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/settings');
|
|
120
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
fcart_list_tax_classes: async (args) => {
|
|
127
|
+
try {
|
|
128
|
+
const params = {};
|
|
129
|
+
if (args.per_page)
|
|
130
|
+
params.per_page = args.per_page;
|
|
131
|
+
if (args.page)
|
|
132
|
+
params.page = args.page;
|
|
133
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/tax/classes', params);
|
|
134
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
fcart_list_shipping_zones: async (args) => {
|
|
141
|
+
try {
|
|
142
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/shipping/zones');
|
|
143
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { makeWordPressRequest } from '../wordpress.js';
|
|
3
|
+
// ==================== ZOD SCHEMA DEFINITIONS ====================
|
|
4
|
+
const getLicensingLineChartSchema = z.object({
|
|
5
|
+
date_from: z.string().optional().describe('Start date (YYYY-MM-DD)'),
|
|
6
|
+
date_to: z.string().optional().describe('End date (YYYY-MM-DD)')
|
|
7
|
+
});
|
|
8
|
+
const getLicensingPieChartSchema = z.object({
|
|
9
|
+
// No parameters - returns license distribution
|
|
10
|
+
});
|
|
11
|
+
const getLicensingSummarySchema = z.object({
|
|
12
|
+
// No parameters - returns licensing summary stats
|
|
13
|
+
});
|
|
14
|
+
// ==================== TOOL DEFINITIONS ====================
|
|
15
|
+
export const fluentCartLicensingTools = [
|
|
16
|
+
{
|
|
17
|
+
name: 'fcart_get_licensing_line_chart',
|
|
18
|
+
description: 'Get FluentCart licensing line chart data showing license activations over time',
|
|
19
|
+
inputSchema: { type: 'object', properties: getLicensingLineChartSchema.shape }
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'fcart_get_licensing_pie_chart',
|
|
23
|
+
description: 'Get FluentCart licensing pie chart data showing license distribution by status',
|
|
24
|
+
inputSchema: { type: 'object', properties: getLicensingPieChartSchema.shape }
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'fcart_get_licensing_summary',
|
|
28
|
+
description: 'Get FluentCart licensing summary with total licenses, active, expired, and revenue',
|
|
29
|
+
inputSchema: { type: 'object', properties: getLicensingSummarySchema.shape }
|
|
30
|
+
}
|
|
31
|
+
];
|
|
32
|
+
// ==================== TOOL HANDLERS ====================
|
|
33
|
+
export const fluentCartLicensingHandlers = {
|
|
34
|
+
fcart_get_licensing_line_chart: async (args) => {
|
|
35
|
+
try {
|
|
36
|
+
const params = {};
|
|
37
|
+
if (args.date_from)
|
|
38
|
+
params.date_from = args.date_from;
|
|
39
|
+
if (args.date_to)
|
|
40
|
+
params.date_to = args.date_to;
|
|
41
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/licensing/line-chart', params);
|
|
42
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
fcart_get_licensing_pie_chart: async (args) => {
|
|
49
|
+
try {
|
|
50
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/licensing/pie-chart');
|
|
51
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
fcart_get_licensing_summary: async (args) => {
|
|
58
|
+
try {
|
|
59
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/fluentcart/licensing/summary');
|
|
60
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { makeWordPressRequest } from '../wordpress.js';
|
|
3
|
+
// ==================== ZOD SCHEMA DEFINITIONS ====================
|
|
4
|
+
const cleanupMembersSchema = z.object({
|
|
5
|
+
// No parameters - cleans up orphaned member records
|
|
6
|
+
});
|
|
7
|
+
const listTermsSchema = z.object({
|
|
8
|
+
taxonomy: z.string().describe('Taxonomy slug (e.g., category, post_tag, or custom taxonomy)'),
|
|
9
|
+
per_page: z.number().optional().describe('Number of terms per page (default: 100)'),
|
|
10
|
+
page: z.number().optional().describe('Page number (default: 1)')
|
|
11
|
+
});
|
|
12
|
+
// ==================== TOOL DEFINITIONS ====================
|
|
13
|
+
export const fluentCommunityAdminTools = [
|
|
14
|
+
{
|
|
15
|
+
name: 'fc_cleanup_members',
|
|
16
|
+
description: 'Cleanup orphaned FluentCommunity member records (maintenance tool)',
|
|
17
|
+
inputSchema: { type: 'object', properties: cleanupMembersSchema.shape }
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'fc_list_terms',
|
|
21
|
+
description: 'List FluentCommunity taxonomy terms (categories, tags, or custom taxonomies)',
|
|
22
|
+
inputSchema: { type: 'object', properties: listTermsSchema.shape }
|
|
23
|
+
}
|
|
24
|
+
];
|
|
25
|
+
// ==================== TOOL HANDLERS ====================
|
|
26
|
+
export const fluentCommunityAdminHandlers = {
|
|
27
|
+
fc_cleanup_members: async (args) => {
|
|
28
|
+
try {
|
|
29
|
+
const response = await makeWordPressRequest('POST', 'fc-manager/v1/members/cleanup');
|
|
30
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
fc_list_terms: async (args) => {
|
|
37
|
+
try {
|
|
38
|
+
const params = {
|
|
39
|
+
taxonomy: args.taxonomy
|
|
40
|
+
};
|
|
41
|
+
if (args.per_page)
|
|
42
|
+
params.per_page = args.per_page;
|
|
43
|
+
if (args.page)
|
|
44
|
+
params.page = args.page;
|
|
45
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/terms', params);
|
|
46
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { makeWordPressRequest } from '../wordpress.js';
|
|
3
|
+
// ==================== ZOD SCHEMA DEFINITIONS ====================
|
|
4
|
+
const listChatThreadsSchema = z.object({
|
|
5
|
+
per_page: z.number().optional().describe('Number of threads per page (default: 20)'),
|
|
6
|
+
page: z.number().optional().describe('Page number (default: 1)')
|
|
7
|
+
});
|
|
8
|
+
const listChatMessagesSchema = z.object({
|
|
9
|
+
id: z.number().describe('Thread ID'),
|
|
10
|
+
per_page: z.number().optional().describe('Number of messages per page (default: 50)'),
|
|
11
|
+
page: z.number().optional().describe('Page number (default: 1)')
|
|
12
|
+
});
|
|
13
|
+
// ==================== TOOL DEFINITIONS ====================
|
|
14
|
+
export const fluentCommunityChatTools = [
|
|
15
|
+
{
|
|
16
|
+
name: 'fc_list_chat_threads',
|
|
17
|
+
description: 'List FluentCommunity chat threads',
|
|
18
|
+
inputSchema: { type: 'object', properties: listChatThreadsSchema.shape }
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'fc_list_chat_messages',
|
|
22
|
+
description: 'List messages in a specific FluentCommunity chat thread',
|
|
23
|
+
inputSchema: { type: 'object', properties: listChatMessagesSchema.shape }
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
// ==================== TOOL HANDLERS ====================
|
|
27
|
+
export const fluentCommunityChatHandlers = {
|
|
28
|
+
fc_list_chat_threads: async (args) => {
|
|
29
|
+
try {
|
|
30
|
+
const params = {};
|
|
31
|
+
if (args.per_page)
|
|
32
|
+
params.per_page = args.per_page;
|
|
33
|
+
if (args.page)
|
|
34
|
+
params.page = args.page;
|
|
35
|
+
const response = await makeWordPressRequest('GET', 'fc-manager/v1/chat/threads', params);
|
|
36
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
fc_list_chat_messages: async (args) => {
|
|
43
|
+
try {
|
|
44
|
+
const params = {};
|
|
45
|
+
if (args.per_page)
|
|
46
|
+
params.per_page = args.per_page;
|
|
47
|
+
if (args.page)
|
|
48
|
+
params.page = args.page;
|
|
49
|
+
const response = await makeWordPressRequest('GET', `fc-manager/v1/chat/threads/${args.id}/messages`, params);
|
|
50
|
+
return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } };
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
package/build/tools/index.js
CHANGED
|
@@ -14,6 +14,11 @@ import { mlCanvasTools, mlCanvasHandlers } from './ml-canvas.js';
|
|
|
14
14
|
import { mlImageEditorTools, mlImageEditorHandlers } from './ml-image-editor.js';
|
|
15
15
|
import { mlMediaHubTools, mlMediaHubHandlers } from './ml-media-hub.js';
|
|
16
16
|
import { debugTools, debugHandlers } from './debug.js';
|
|
17
|
+
import { fluentCartAnalyticsTools, fluentCartAnalyticsHandlers } from './fluent-cart-analytics.js';
|
|
18
|
+
import { fluentCartLicensingTools, fluentCartLicensingHandlers } from './fluent-cart-licensing.js';
|
|
19
|
+
import { fluentCartAdminTools, fluentCartAdminHandlers } from './fluent-cart-admin.js';
|
|
20
|
+
import { fluentCommunityChatTools, fluentCommunityChatHandlers } from './fluent-community-chat.js';
|
|
21
|
+
import { fluentCommunityAdminTools, fluentCommunityAdminHandlers } from './fluent-community-admin.js';
|
|
17
22
|
// Combine all tools - WordPress + FluentCommunity + FluentCRM + FluentCart + ML Plugins
|
|
18
23
|
export const allTools = [
|
|
19
24
|
...unifiedContentTools, // WordPress Core: unified content management
|
|
@@ -26,8 +31,13 @@ export const allTools = [
|
|
|
26
31
|
...fluentCommunityTools, // FluentCommunity: spaces, posts, members
|
|
27
32
|
...fluentCommunityDesignTools, // FluentCommunity: colors, branding, CSS
|
|
28
33
|
...fluentCommunityLayoutTools, // FluentCommunity: layout control
|
|
34
|
+
...fluentCommunityChatTools, // FluentCommunity: chat threads, messages
|
|
35
|
+
...fluentCommunityAdminTools, // FluentCommunity: cleanup, terms
|
|
29
36
|
...fluentCRMTools, // FluentCRM: contacts, lists, campaigns
|
|
30
37
|
...fluentCartTools, // FluentCart: products, orders, customers, subscriptions
|
|
38
|
+
...fluentCartAnalyticsTools, // FluentCart: reports, stats, analytics
|
|
39
|
+
...fluentCartLicensingTools, // FluentCart: licensing charts, summary
|
|
40
|
+
...fluentCartAdminTools, // FluentCart: files, categories, notifications, settings
|
|
31
41
|
...mlCanvasTools, // ML Canvas Block: surgical HTML editing
|
|
32
42
|
...mlImageEditorTools, // ML Image Editor: AI generation/editing
|
|
33
43
|
...mlMediaHubTools, // ML Media Hub: image/icon search and filters
|
|
@@ -45,8 +55,13 @@ export const toolHandlers = {
|
|
|
45
55
|
...fluentCommunityHandlers,
|
|
46
56
|
...fluentCommunityDesignHandlers,
|
|
47
57
|
...fluentCommunityLayoutHandlers,
|
|
58
|
+
...fluentCommunityChatHandlers,
|
|
59
|
+
...fluentCommunityAdminHandlers,
|
|
48
60
|
...fluentCRMHandlers,
|
|
49
61
|
...fluentCartHandlers,
|
|
62
|
+
...fluentCartAnalyticsHandlers,
|
|
63
|
+
...fluentCartLicensingHandlers,
|
|
64
|
+
...fluentCartAdminHandlers,
|
|
50
65
|
...mlCanvasHandlers,
|
|
51
66
|
...mlImageEditorHandlers,
|
|
52
67
|
...mlMediaHubHandlers,
|
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.9",
|
|
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",
|