@wplaunchify/ml-mcp-server 1.0.0

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.
Files changed (49) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +220 -0
  3. package/build/cli.d.ts +2 -0
  4. package/build/cli.js +52 -0
  5. package/build/server.d.ts +2 -0
  6. package/build/server.js +97 -0
  7. package/build/tools/comments.d.ts +212 -0
  8. package/build/tools/comments.js +181 -0
  9. package/build/tools/fluent-affiliate.d.ts +2 -0
  10. package/build/tools/fluent-affiliate.js +3 -0
  11. package/build/tools/fluent-cart.d.ts +706 -0
  12. package/build/tools/fluent-cart.js +642 -0
  13. package/build/tools/fluent-community-BACKUP.d.ts +364 -0
  14. package/build/tools/fluent-community-BACKUP.js +883 -0
  15. package/build/tools/fluent-community-MINIMAL.d.ts +69 -0
  16. package/build/tools/fluent-community-MINIMAL.js +92 -0
  17. package/build/tools/fluent-community-design.d.ts +3 -0
  18. package/build/tools/fluent-community-design.js +150 -0
  19. package/build/tools/fluent-community-layout.d.ts +119 -0
  20. package/build/tools/fluent-community-layout.js +88 -0
  21. package/build/tools/fluent-community.d.ts +364 -0
  22. package/build/tools/fluent-community.js +528 -0
  23. package/build/tools/fluent-crm.d.ts +3 -0
  24. package/build/tools/fluent-crm.js +392 -0
  25. package/build/tools/index.d.ts +2205 -0
  26. package/build/tools/index.js +54 -0
  27. package/build/tools/media.d.ts +135 -0
  28. package/build/tools/media.js +168 -0
  29. package/build/tools/ml-canvas.d.ts +91 -0
  30. package/build/tools/ml-canvas.js +109 -0
  31. package/build/tools/ml-image-editor.d.ts +230 -0
  32. package/build/tools/ml-image-editor.js +270 -0
  33. package/build/tools/ml-media-hub.d.ts +575 -0
  34. package/build/tools/ml-media-hub.js +714 -0
  35. package/build/tools/plugin-repository.d.ts +62 -0
  36. package/build/tools/plugin-repository.js +149 -0
  37. package/build/tools/plugins.d.ts +129 -0
  38. package/build/tools/plugins.js +148 -0
  39. package/build/tools/unified-content.d.ts +313 -0
  40. package/build/tools/unified-content.js +615 -0
  41. package/build/tools/unified-taxonomies.d.ts +229 -0
  42. package/build/tools/unified-taxonomies.js +479 -0
  43. package/build/tools/users.d.ts +227 -0
  44. package/build/tools/users.js +182 -0
  45. package/build/types/wordpress-types.d.ts +151 -0
  46. package/build/types/wordpress-types.js +2 -0
  47. package/build/wordpress.d.ts +26 -0
  48. package/build/wordpress.js +223 -0
  49. package/package.json +67 -0
@@ -0,0 +1,227 @@
1
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
2
+ import { z } from 'zod';
3
+ declare const listUsersSchema: z.ZodObject<{
4
+ page: z.ZodOptional<z.ZodNumber>;
5
+ per_page: z.ZodOptional<z.ZodNumber>;
6
+ search: z.ZodOptional<z.ZodString>;
7
+ context: z.ZodOptional<z.ZodEnum<["view", "embed", "edit"]>>;
8
+ orderby: z.ZodOptional<z.ZodEnum<["id", "include", "name", "registered_date", "slug", "email", "url"]>>;
9
+ order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
10
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ page?: number | undefined;
13
+ per_page?: number | undefined;
14
+ search?: string | undefined;
15
+ orderby?: "url" | "slug" | "id" | "name" | "include" | "registered_date" | "email" | undefined;
16
+ order?: "asc" | "desc" | undefined;
17
+ context?: "view" | "embed" | "edit" | undefined;
18
+ roles?: string[] | undefined;
19
+ }, {
20
+ page?: number | undefined;
21
+ per_page?: number | undefined;
22
+ search?: string | undefined;
23
+ orderby?: "url" | "slug" | "id" | "name" | "include" | "registered_date" | "email" | undefined;
24
+ order?: "asc" | "desc" | undefined;
25
+ context?: "view" | "embed" | "edit" | undefined;
26
+ roles?: string[] | undefined;
27
+ }>;
28
+ declare const getUserSchema: z.ZodObject<{
29
+ id: z.ZodNumber;
30
+ context: z.ZodOptional<z.ZodEnum<["view", "embed", "edit"]>>;
31
+ }, "strict", z.ZodTypeAny, {
32
+ id: number;
33
+ context?: "view" | "embed" | "edit" | undefined;
34
+ }, {
35
+ id: number;
36
+ context?: "view" | "embed" | "edit" | undefined;
37
+ }>;
38
+ declare const createUserSchema: z.ZodObject<{
39
+ username: z.ZodString;
40
+ name: z.ZodOptional<z.ZodString>;
41
+ first_name: z.ZodOptional<z.ZodString>;
42
+ last_name: z.ZodOptional<z.ZodString>;
43
+ email: z.ZodString;
44
+ url: z.ZodOptional<z.ZodString>;
45
+ description: z.ZodOptional<z.ZodString>;
46
+ locale: z.ZodOptional<z.ZodString>;
47
+ nickname: z.ZodOptional<z.ZodString>;
48
+ slug: z.ZodOptional<z.ZodString>;
49
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
50
+ password: z.ZodString;
51
+ }, "strict", z.ZodTypeAny, {
52
+ email: string;
53
+ username: string;
54
+ password: string;
55
+ url?: string | undefined;
56
+ slug?: string | undefined;
57
+ name?: string | undefined;
58
+ description?: string | undefined;
59
+ roles?: string[] | undefined;
60
+ first_name?: string | undefined;
61
+ last_name?: string | undefined;
62
+ locale?: string | undefined;
63
+ nickname?: string | undefined;
64
+ }, {
65
+ email: string;
66
+ username: string;
67
+ password: string;
68
+ url?: string | undefined;
69
+ slug?: string | undefined;
70
+ name?: string | undefined;
71
+ description?: string | undefined;
72
+ roles?: string[] | undefined;
73
+ first_name?: string | undefined;
74
+ last_name?: string | undefined;
75
+ locale?: string | undefined;
76
+ nickname?: string | undefined;
77
+ }>;
78
+ declare const updateUserSchema: z.ZodObject<{
79
+ id: z.ZodNumber;
80
+ username: z.ZodOptional<z.ZodString>;
81
+ name: z.ZodOptional<z.ZodString>;
82
+ first_name: z.ZodOptional<z.ZodString>;
83
+ last_name: z.ZodOptional<z.ZodString>;
84
+ email: z.ZodOptional<z.ZodString>;
85
+ url: z.ZodOptional<z.ZodString>;
86
+ description: z.ZodOptional<z.ZodString>;
87
+ locale: z.ZodOptional<z.ZodString>;
88
+ nickname: z.ZodOptional<z.ZodString>;
89
+ slug: z.ZodOptional<z.ZodString>;
90
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
91
+ password: z.ZodOptional<z.ZodString>;
92
+ }, "strict", z.ZodTypeAny, {
93
+ id: number;
94
+ url?: string | undefined;
95
+ slug?: string | undefined;
96
+ name?: string | undefined;
97
+ description?: string | undefined;
98
+ email?: string | undefined;
99
+ roles?: string[] | undefined;
100
+ username?: string | undefined;
101
+ first_name?: string | undefined;
102
+ last_name?: string | undefined;
103
+ locale?: string | undefined;
104
+ nickname?: string | undefined;
105
+ password?: string | undefined;
106
+ }, {
107
+ id: number;
108
+ url?: string | undefined;
109
+ slug?: string | undefined;
110
+ name?: string | undefined;
111
+ description?: string | undefined;
112
+ email?: string | undefined;
113
+ roles?: string[] | undefined;
114
+ username?: string | undefined;
115
+ first_name?: string | undefined;
116
+ last_name?: string | undefined;
117
+ locale?: string | undefined;
118
+ nickname?: string | undefined;
119
+ password?: string | undefined;
120
+ }>;
121
+ declare const deleteUserSchema: z.ZodObject<{
122
+ id: z.ZodNumber;
123
+ force: z.ZodOptional<z.ZodBoolean>;
124
+ reassign: z.ZodOptional<z.ZodNumber>;
125
+ }, "strict", z.ZodTypeAny, {
126
+ id: number;
127
+ force?: boolean | undefined;
128
+ reassign?: number | undefined;
129
+ }, {
130
+ id: number;
131
+ force?: boolean | undefined;
132
+ reassign?: number | undefined;
133
+ }>;
134
+ type ListUsersParams = z.infer<typeof listUsersSchema>;
135
+ type GetUserParams = z.infer<typeof getUserSchema>;
136
+ type CreateUserParams = z.infer<typeof createUserSchema>;
137
+ type UpdateUserParams = z.infer<typeof updateUserSchema>;
138
+ type DeleteUserParams = z.infer<typeof deleteUserSchema>;
139
+ export declare const userTools: Tool[];
140
+ export declare const userHandlers: {
141
+ list_users: (params: ListUsersParams) => Promise<{
142
+ toolResult: {
143
+ content: {
144
+ type: string;
145
+ text: string;
146
+ }[];
147
+ isError?: undefined;
148
+ };
149
+ } | {
150
+ toolResult: {
151
+ isError: boolean;
152
+ content: {
153
+ type: string;
154
+ text: string;
155
+ }[];
156
+ };
157
+ }>;
158
+ get_user: (params: GetUserParams) => Promise<{
159
+ toolResult: {
160
+ content: {
161
+ type: string;
162
+ text: string;
163
+ }[];
164
+ isError?: undefined;
165
+ };
166
+ } | {
167
+ toolResult: {
168
+ isError: boolean;
169
+ content: {
170
+ type: string;
171
+ text: string;
172
+ }[];
173
+ };
174
+ }>;
175
+ create_user: (params: CreateUserParams) => Promise<{
176
+ toolResult: {
177
+ content: {
178
+ type: string;
179
+ text: string;
180
+ }[];
181
+ isError?: undefined;
182
+ };
183
+ } | {
184
+ toolResult: {
185
+ isError: boolean;
186
+ content: {
187
+ type: string;
188
+ text: string;
189
+ }[];
190
+ };
191
+ }>;
192
+ update_user: (params: UpdateUserParams) => Promise<{
193
+ toolResult: {
194
+ content: {
195
+ type: string;
196
+ text: string;
197
+ }[];
198
+ isError?: undefined;
199
+ };
200
+ } | {
201
+ toolResult: {
202
+ isError: boolean;
203
+ content: {
204
+ type: string;
205
+ text: string;
206
+ }[];
207
+ };
208
+ }>;
209
+ delete_user: (params: DeleteUserParams) => Promise<{
210
+ toolResult: {
211
+ content: {
212
+ type: string;
213
+ text: string;
214
+ }[];
215
+ isError?: undefined;
216
+ };
217
+ } | {
218
+ toolResult: {
219
+ isError: boolean;
220
+ content: {
221
+ type: string;
222
+ text: string;
223
+ }[];
224
+ };
225
+ }>;
226
+ };
227
+ export {};
@@ -0,0 +1,182 @@
1
+ import { makeWordPressRequest } from '../wordpress.js';
2
+ import { z } from 'zod';
3
+ const listUsersSchema = z.object({
4
+ page: z.number().optional().describe("Page number (default 1)"),
5
+ per_page: z.number().min(1).max(100).optional().describe("Items per page (default 10, max 100)"),
6
+ search: z.string().optional().describe("Search term for user content or name"),
7
+ context: z.enum(['view', 'embed', 'edit']).optional().describe("Scope under which the request is made"),
8
+ orderby: z.enum(['id', 'include', 'name', 'registered_date', 'slug', 'email', 'url']).optional().describe("Sort users by parameter"),
9
+ order: z.enum(['asc', 'desc']).optional().describe("Order sort attribute ascending or descending"),
10
+ roles: z.array(z.string()).optional().describe("Array of role names to filter by")
11
+ });
12
+ const getUserSchema = z.object({
13
+ id: z.number().describe("User ID"),
14
+ context: z.enum(['view', 'embed', 'edit']).optional().describe("Scope under which the request is made")
15
+ }).strict();
16
+ const createUserSchema = z.object({
17
+ username: z.string().describe("User login name"),
18
+ name: z.string().optional().describe("Display name for the user"),
19
+ first_name: z.string().optional().describe("First name for the user"),
20
+ last_name: z.string().optional().describe("Last name for the user"),
21
+ email: z.string().email().describe("Email address for the user"),
22
+ url: z.string().url().optional().describe("URL of the user"),
23
+ description: z.string().optional().describe("Description of the user"),
24
+ locale: z.string().optional().describe("Locale for the user"),
25
+ nickname: z.string().optional().describe("Nickname for the user"),
26
+ slug: z.string().optional().describe("Slug for the user"),
27
+ roles: z.array(z.string()).optional().describe("Roles assigned to the user"),
28
+ password: z.string().describe("Password for the user")
29
+ }).strict();
30
+ const updateUserSchema = z.object({
31
+ id: z.number().describe("User ID"),
32
+ username: z.string().optional().describe("User login name"),
33
+ name: z.string().optional().describe("Display name for the user"),
34
+ first_name: z.string().optional().describe("First name for the user"),
35
+ last_name: z.string().optional().describe("Last name for the user"),
36
+ email: z.string().email().optional().describe("Email address for the user"),
37
+ url: z.string().url().optional().describe("URL of the user"),
38
+ description: z.string().optional().describe("Description of the user"),
39
+ locale: z.string().optional().describe("Locale for the user"),
40
+ nickname: z.string().optional().describe("Nickname for the user"),
41
+ slug: z.string().optional().describe("Slug for the user"),
42
+ roles: z.array(z.string()).optional().describe("Roles assigned to the user"),
43
+ password: z.string().optional().describe("Password for the user")
44
+ }).strict();
45
+ const deleteUserSchema = z.object({
46
+ id: z.number().describe("User ID"),
47
+ force: z.boolean().optional().describe("Whether to bypass trash and force deletion"),
48
+ reassign: z.number().optional().describe("User ID to reassign posts to")
49
+ }).strict();
50
+ export const userTools = [
51
+ {
52
+ name: "list_users",
53
+ description: "Lists all users with filtering, sorting, and pagination options",
54
+ inputSchema: { type: "object", properties: listUsersSchema.shape }
55
+ },
56
+ {
57
+ name: "get_user",
58
+ description: "Gets a user by ID",
59
+ inputSchema: { type: "object", properties: getUserSchema.shape }
60
+ },
61
+ {
62
+ name: "create_user",
63
+ description: "Creates a new user",
64
+ inputSchema: { type: "object", properties: createUserSchema.shape }
65
+ },
66
+ {
67
+ name: "update_user",
68
+ description: "Updates an existing user",
69
+ inputSchema: { type: "object", properties: updateUserSchema.shape }
70
+ },
71
+ {
72
+ name: "delete_user",
73
+ description: "Deletes a user",
74
+ inputSchema: { type: "object", properties: deleteUserSchema.shape }
75
+ }
76
+ ];
77
+ export const userHandlers = {
78
+ list_users: async (params) => {
79
+ try {
80
+ const response = await makeWordPressRequest('GET', "wp/v2/users", params);
81
+ const users = response;
82
+ return {
83
+ toolResult: {
84
+ content: [{ type: 'text', text: JSON.stringify(users, null, 2) }],
85
+ },
86
+ };
87
+ }
88
+ catch (error) {
89
+ const errorMessage = error.response?.data?.message || error.message;
90
+ return {
91
+ toolResult: {
92
+ isError: true,
93
+ content: [{ type: 'text', text: `Error listing users: ${errorMessage}` }],
94
+ },
95
+ };
96
+ }
97
+ },
98
+ get_user: async (params) => {
99
+ try {
100
+ const response = await makeWordPressRequest('GET', `wp/v2/users/${params.id}`, { context: params.context });
101
+ const user = response;
102
+ return {
103
+ toolResult: {
104
+ content: [{ type: 'text', text: JSON.stringify(user, null, 2) }],
105
+ },
106
+ };
107
+ }
108
+ catch (error) {
109
+ const errorMessage = error.response?.data?.message || error.message;
110
+ return {
111
+ toolResult: {
112
+ isError: true,
113
+ content: [{ type: 'text', text: `Error getting user: ${errorMessage}` }],
114
+ },
115
+ };
116
+ }
117
+ },
118
+ create_user: async (params) => {
119
+ try {
120
+ const response = await makeWordPressRequest('POST', "wp/v2/users", params);
121
+ const user = response;
122
+ return {
123
+ toolResult: {
124
+ content: [{ type: 'text', text: JSON.stringify(user, null, 2) }],
125
+ },
126
+ };
127
+ }
128
+ catch (error) {
129
+ const errorMessage = error.response?.data?.message || error.message;
130
+ return {
131
+ toolResult: {
132
+ isError: true,
133
+ content: [{ type: 'text', text: `Error creating user: ${errorMessage}` }],
134
+ },
135
+ };
136
+ }
137
+ },
138
+ update_user: async (params) => {
139
+ try {
140
+ const { id, ...updateData } = params;
141
+ const response = await makeWordPressRequest('POST', `wp/v2/users/${id}`, updateData);
142
+ const user = response;
143
+ return {
144
+ toolResult: {
145
+ content: [{ type: 'text', text: JSON.stringify(user, null, 2) }],
146
+ },
147
+ };
148
+ }
149
+ catch (error) {
150
+ const errorMessage = error.response?.data?.message || error.message;
151
+ return {
152
+ toolResult: {
153
+ isError: true,
154
+ content: [{ type: 'text', text: `Error updating user: ${errorMessage}` }],
155
+ },
156
+ };
157
+ }
158
+ },
159
+ delete_user: async (params) => {
160
+ try {
161
+ const response = await makeWordPressRequest('DELETE', `wp/v2/users/${params.id}`, {
162
+ force: params.force,
163
+ reassign: params.reassign
164
+ });
165
+ const user = response;
166
+ return {
167
+ toolResult: {
168
+ content: [{ type: 'text', text: JSON.stringify(user, null, 2) }],
169
+ },
170
+ };
171
+ }
172
+ catch (error) {
173
+ const errorMessage = error.response?.data?.message || error.message;
174
+ return {
175
+ toolResult: {
176
+ isError: true,
177
+ content: [{ type: 'text', text: `Error deleting user: ${errorMessage}` }],
178
+ },
179
+ };
180
+ }
181
+ }
182
+ };
@@ -0,0 +1,151 @@
1
+ interface WPContent {
2
+ id: number;
3
+ date: string;
4
+ date_gmt: string;
5
+ guid: {
6
+ rendered: string;
7
+ };
8
+ modified: string;
9
+ modified_gmt: string;
10
+ slug: string;
11
+ status: string;
12
+ type: string;
13
+ link: string;
14
+ title: {
15
+ rendered: string;
16
+ };
17
+ content: {
18
+ rendered: string;
19
+ protected: boolean;
20
+ };
21
+ excerpt: {
22
+ rendered: string;
23
+ protected: boolean;
24
+ };
25
+ author: number;
26
+ featured_media: number;
27
+ comment_status: string;
28
+ ping_status: string;
29
+ template: string;
30
+ meta: Record<string, any>[];
31
+ _links: Record<string, any>;
32
+ }
33
+ export interface WPPost extends WPContent {
34
+ format: string;
35
+ sticky: boolean;
36
+ categories: number[];
37
+ tags: number[];
38
+ }
39
+ export interface WPPage extends WPContent {
40
+ parent: number;
41
+ menu_order: number;
42
+ }
43
+ export interface WPCategory {
44
+ id: number;
45
+ count: number;
46
+ description: string;
47
+ link: string;
48
+ name: string;
49
+ slug: string;
50
+ taxonomy: string;
51
+ parent: number;
52
+ meta: Record<string, any>[];
53
+ _links: Record<string, any>;
54
+ }
55
+ export interface WPUser {
56
+ id: number;
57
+ username: string;
58
+ name: string;
59
+ first_name: string;
60
+ last_name: string;
61
+ email: string;
62
+ url: string;
63
+ description: string;
64
+ link: string;
65
+ locale: string;
66
+ nickname: string;
67
+ slug: string;
68
+ roles: string[];
69
+ registered_date: string;
70
+ capabilities: Record<string, boolean>;
71
+ extra_capabilities: Record<string, boolean>;
72
+ avatar_urls: Record<string, string>;
73
+ meta: Record<string, any>[];
74
+ _links: Record<string, any>;
75
+ }
76
+ export interface WPPlugin {
77
+ plugin: string;
78
+ status: string;
79
+ name: string;
80
+ plugin_uri: string;
81
+ author: string;
82
+ author_uri: string;
83
+ description: {
84
+ raw: string;
85
+ rendered: string;
86
+ };
87
+ version: string;
88
+ network_only: boolean;
89
+ requires_wp: string;
90
+ requires_php: string;
91
+ textdomain: string;
92
+ }
93
+ export interface WPComment {
94
+ id: number;
95
+ post: number;
96
+ parent: number;
97
+ author: number;
98
+ author_name: string;
99
+ author_url: string;
100
+ author_email?: string;
101
+ author_ip?: string;
102
+ author_user_agent?: string;
103
+ date: string;
104
+ date_gmt: string;
105
+ content: {
106
+ rendered: string;
107
+ raw?: string;
108
+ };
109
+ link: string;
110
+ status: string;
111
+ type: string;
112
+ meta: Record<string, any>[];
113
+ _links: Record<string, any>;
114
+ }
115
+ export interface WPCustomPost extends WPContent {
116
+ [key: string]: any;
117
+ }
118
+ export interface WPPostType {
119
+ slug: string;
120
+ name: string;
121
+ description: string;
122
+ hierarchical: boolean;
123
+ rest_base: string;
124
+ supports: string[];
125
+ taxonomies: string[];
126
+ labels: Record<string, string>;
127
+ _links: Record<string, any>;
128
+ }
129
+ export interface WPTaxonomy {
130
+ slug: string;
131
+ name: string;
132
+ description: string;
133
+ types: string[];
134
+ hierarchical: boolean;
135
+ rest_base: string;
136
+ labels: Record<string, string>;
137
+ _links: Record<string, any>;
138
+ }
139
+ export interface WPTerm {
140
+ id: number;
141
+ count: number;
142
+ description: string;
143
+ link: string;
144
+ name: string;
145
+ slug: string;
146
+ taxonomy: string;
147
+ parent: number;
148
+ meta: Record<string, any>[];
149
+ _links: Record<string, any>;
150
+ }
151
+ export {};
@@ -0,0 +1,2 @@
1
+ // src/types/wordpress-types.ts
2
+ export {};
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Initialize the WordPress API client with authentication
3
+ */
4
+ export declare function initWordPress(): Promise<void>;
5
+ export declare function logToFile(message: string): void;
6
+ /**
7
+ * Make a request to the WordPress API
8
+ * @param method HTTP method
9
+ * @param endpoint API endpoint (relative to the baseURL)
10
+ * @param data Request data
11
+ * @param options Additional request options
12
+ * @returns Response data
13
+ */
14
+ export declare function makeWordPressRequest(method: string, endpoint: string, data?: any, options?: {
15
+ headers?: Record<string, string>;
16
+ isFormData?: boolean;
17
+ rawResponse?: boolean;
18
+ }): Promise<any>;
19
+ /**
20
+ * Make a request to the WordPress.org Plugin Repository API
21
+ * @param searchQuery Search query string
22
+ * @param page Page number (1-based)
23
+ * @param perPage Number of results per page
24
+ * @returns Response data from WordPress.org Plugin API
25
+ */
26
+ export declare function searchWordPressPluginRepository(searchQuery: string, page?: number, perPage?: number): Promise<any>;