claude-plugin-wordpress-manager 1.4.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.
- package/.claude-plugin/plugin.json +19 -0
- package/.mcp.json +19 -0
- package/CHANGELOG.md +62 -0
- package/LICENSE +69 -0
- package/README.md +213 -0
- package/agents/wp-content-strategist.md +148 -0
- package/agents/wp-deployment-engineer.md +93 -0
- package/agents/wp-performance-optimizer.md +198 -0
- package/agents/wp-security-auditor.md +161 -0
- package/agents/wp-site-manager.md +109 -0
- package/commands/wp-audit.md +37 -0
- package/commands/wp-backup.md +45 -0
- package/commands/wp-deploy.md +38 -0
- package/commands/wp-setup.md +64 -0
- package/commands/wp-status.md +53 -0
- package/docs/GUIDE.md +1190 -0
- package/hooks/hooks.json +57 -0
- package/hooks/scripts/backup-reminder.sh +29 -0
- package/hooks/scripts/pre-deploy-check.sh +49 -0
- package/package.json +46 -0
- package/scripts/health-check.sh +110 -0
- package/scripts/validate-wp-operation.sh +115 -0
- package/servers/wp-rest-bridge/build/server.d.ts +2 -0
- package/servers/wp-rest-bridge/build/server.js +74 -0
- package/servers/wp-rest-bridge/build/tools/comments.d.ts +227 -0
- package/servers/wp-rest-bridge/build/tools/comments.js +192 -0
- package/servers/wp-rest-bridge/build/tools/index.d.ts +919 -0
- package/servers/wp-rest-bridge/build/tools/index.js +30 -0
- package/servers/wp-rest-bridge/build/tools/media.d.ts +174 -0
- package/servers/wp-rest-bridge/build/tools/media.js +247 -0
- package/servers/wp-rest-bridge/build/tools/plugin-repository.d.ts +62 -0
- package/servers/wp-rest-bridge/build/tools/plugin-repository.js +149 -0
- package/servers/wp-rest-bridge/build/tools/plugins.d.ts +153 -0
- package/servers/wp-rest-bridge/build/tools/plugins.js +175 -0
- package/servers/wp-rest-bridge/build/tools/search.d.ts +44 -0
- package/servers/wp-rest-bridge/build/tools/search.js +44 -0
- package/servers/wp-rest-bridge/build/tools/unified-content.d.ts +328 -0
- package/servers/wp-rest-bridge/build/tools/unified-content.js +628 -0
- package/servers/wp-rest-bridge/build/tools/unified-taxonomies.d.ts +244 -0
- package/servers/wp-rest-bridge/build/tools/unified-taxonomies.js +492 -0
- package/servers/wp-rest-bridge/build/tools/users.d.ts +269 -0
- package/servers/wp-rest-bridge/build/tools/users.js +226 -0
- package/servers/wp-rest-bridge/build/types.d.ts +151 -0
- package/servers/wp-rest-bridge/build/types.js +2 -0
- package/servers/wp-rest-bridge/build/wordpress.d.ts +48 -0
- package/servers/wp-rest-bridge/build/wordpress.js +305 -0
- package/servers/wp-rest-bridge/package.json +27 -0
- package/skills/wordpress-router/SKILL.md +78 -0
- package/skills/wordpress-router/references/decision-tree.md +88 -0
- package/skills/wp-abilities-api/SKILL.md +97 -0
- package/skills/wp-abilities-api/references/php-registration.md +67 -0
- package/skills/wp-abilities-api/references/rest-api.md +13 -0
- package/skills/wp-audit/SKILL.md +114 -0
- package/skills/wp-audit/references/performance-checklist.md +113 -0
- package/skills/wp-audit/references/security-checklist.md +95 -0
- package/skills/wp-audit/references/seo-checklist.md +128 -0
- package/skills/wp-backup/SKILL.md +87 -0
- package/skills/wp-backup/references/backup-strategies.md +116 -0
- package/skills/wp-backup/references/restore-procedures.md +129 -0
- package/skills/wp-block-development/SKILL.md +176 -0
- package/skills/wp-block-development/references/attributes-and-serialization.md +22 -0
- package/skills/wp-block-development/references/block-json.md +49 -0
- package/skills/wp-block-development/references/creating-new-blocks.md +46 -0
- package/skills/wp-block-development/references/debugging.md +36 -0
- package/skills/wp-block-development/references/deprecations.md +24 -0
- package/skills/wp-block-development/references/dynamic-rendering.md +23 -0
- package/skills/wp-block-development/references/inner-blocks.md +25 -0
- package/skills/wp-block-development/references/registration.md +30 -0
- package/skills/wp-block-development/references/supports-and-wrappers.md +18 -0
- package/skills/wp-block-development/references/tooling-and-testing.md +21 -0
- package/skills/wp-block-development/scripts/list_blocks.mjs +121 -0
- package/skills/wp-block-themes/SKILL.md +118 -0
- package/skills/wp-block-themes/references/creating-new-block-theme.md +37 -0
- package/skills/wp-block-themes/references/debugging.md +24 -0
- package/skills/wp-block-themes/references/patterns.md +18 -0
- package/skills/wp-block-themes/references/style-variations.md +14 -0
- package/skills/wp-block-themes/references/templates-and-parts.md +16 -0
- package/skills/wp-block-themes/references/theme-json.md +59 -0
- package/skills/wp-block-themes/scripts/detect_block_themes.mjs +117 -0
- package/skills/wp-content/SKILL.md +103 -0
- package/skills/wp-content/references/content-templates.md +230 -0
- package/skills/wp-content/references/seo-optimization.md +169 -0
- package/skills/wp-deploy/SKILL.md +52 -0
- package/skills/wp-deploy/references/hostinger-deploy.md +51 -0
- package/skills/wp-deploy/references/ssh-deploy.md +63 -0
- package/skills/wp-interactivity-api/SKILL.md +181 -0
- package/skills/wp-interactivity-api/references/debugging.md +29 -0
- package/skills/wp-interactivity-api/references/directives-quickref.md +30 -0
- package/skills/wp-interactivity-api/references/server-side-rendering.md +310 -0
- package/skills/wp-migrate/SKILL.md +100 -0
- package/skills/wp-migrate/references/cross-platform.md +104 -0
- package/skills/wp-migrate/references/hostinger-migration.md +86 -0
- package/skills/wp-performance/SKILL.md +148 -0
- package/skills/wp-performance/references/autoload-options.md +24 -0
- package/skills/wp-performance/references/cron.md +20 -0
- package/skills/wp-performance/references/database.md +20 -0
- package/skills/wp-performance/references/http-api.md +15 -0
- package/skills/wp-performance/references/measurement.md +21 -0
- package/skills/wp-performance/references/object-cache.md +24 -0
- package/skills/wp-performance/references/query-monitor-headless.md +38 -0
- package/skills/wp-performance/references/server-timing.md +22 -0
- package/skills/wp-performance/references/wp-cli-doctor.md +24 -0
- package/skills/wp-performance/references/wp-cli-profile.md +32 -0
- package/skills/wp-performance/scripts/perf_inspect.mjs +128 -0
- package/skills/wp-phpstan/SKILL.md +99 -0
- package/skills/wp-phpstan/references/configuration.md +52 -0
- package/skills/wp-phpstan/references/third-party-classes.md +76 -0
- package/skills/wp-phpstan/references/wordpress-annotations.md +124 -0
- package/skills/wp-phpstan/scripts/phpstan_inspect.mjs +263 -0
- package/skills/wp-playground/SKILL.md +103 -0
- package/skills/wp-playground/references/blueprints.md +36 -0
- package/skills/wp-playground/references/cli-commands.md +39 -0
- package/skills/wp-playground/references/debugging.md +16 -0
- package/skills/wp-plugin-development/SKILL.md +114 -0
- package/skills/wp-plugin-development/references/data-and-cron.md +19 -0
- package/skills/wp-plugin-development/references/debugging.md +19 -0
- package/skills/wp-plugin-development/references/lifecycle.md +33 -0
- package/skills/wp-plugin-development/references/security.md +29 -0
- package/skills/wp-plugin-development/references/settings-api.md +22 -0
- package/skills/wp-plugin-development/references/structure.md +16 -0
- package/skills/wp-plugin-development/scripts/detect_plugins.mjs +122 -0
- package/skills/wp-project-triage/SKILL.md +40 -0
- package/skills/wp-project-triage/references/triage.schema.json +143 -0
- package/skills/wp-project-triage/scripts/detect_wp_project.mjs +592 -0
- package/skills/wp-rest-api/SKILL.md +116 -0
- package/skills/wp-rest-api/references/authentication.md +18 -0
- package/skills/wp-rest-api/references/custom-content-types.md +20 -0
- package/skills/wp-rest-api/references/discovery-and-params.md +20 -0
- package/skills/wp-rest-api/references/responses-and-fields.md +30 -0
- package/skills/wp-rest-api/references/routes-and-endpoints.md +36 -0
- package/skills/wp-rest-api/references/schema.md +22 -0
- package/skills/wp-wpcli-and-ops/SKILL.md +125 -0
- package/skills/wp-wpcli-and-ops/references/automation.md +30 -0
- package/skills/wp-wpcli-and-ops/references/cron-and-cache.md +23 -0
- package/skills/wp-wpcli-and-ops/references/debugging.md +17 -0
- package/skills/wp-wpcli-and-ops/references/multisite.md +22 -0
- package/skills/wp-wpcli-and-ops/references/packages-and-updates.md +22 -0
- package/skills/wp-wpcli-and-ops/references/safety.md +30 -0
- package/skills/wp-wpcli-and-ops/references/search-replace.md +40 -0
- package/skills/wp-wpcli-and-ops/scripts/wpcli_inspect.mjs +90 -0
- package/skills/wpds/SKILL.md +60 -0
- package/skills/wpds/references/wpds-mcp-setup.md +59 -0
|
@@ -0,0 +1,269 @@
|
|
|
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
|
+
_embed: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
_fields: z.ZodOptional<z.ZodString>;
|
|
13
|
+
include_pagination: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
page?: number | undefined;
|
|
16
|
+
per_page?: number | undefined;
|
|
17
|
+
search?: string | undefined;
|
|
18
|
+
orderby?: "url" | "slug" | "id" | "name" | "include" | "registered_date" | "email" | undefined;
|
|
19
|
+
order?: "asc" | "desc" | undefined;
|
|
20
|
+
_embed?: boolean | undefined;
|
|
21
|
+
_fields?: string | undefined;
|
|
22
|
+
include_pagination?: boolean | undefined;
|
|
23
|
+
context?: "view" | "embed" | "edit" | undefined;
|
|
24
|
+
roles?: string[] | undefined;
|
|
25
|
+
}, {
|
|
26
|
+
page?: number | undefined;
|
|
27
|
+
per_page?: number | undefined;
|
|
28
|
+
search?: string | undefined;
|
|
29
|
+
orderby?: "url" | "slug" | "id" | "name" | "include" | "registered_date" | "email" | undefined;
|
|
30
|
+
order?: "asc" | "desc" | undefined;
|
|
31
|
+
_embed?: boolean | undefined;
|
|
32
|
+
_fields?: string | undefined;
|
|
33
|
+
include_pagination?: boolean | undefined;
|
|
34
|
+
context?: "view" | "embed" | "edit" | undefined;
|
|
35
|
+
roles?: string[] | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
declare const getUserSchema: z.ZodObject<{
|
|
38
|
+
id: z.ZodNumber;
|
|
39
|
+
context: z.ZodOptional<z.ZodEnum<["view", "embed", "edit"]>>;
|
|
40
|
+
_embed: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
_fields: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}, "strict", z.ZodTypeAny, {
|
|
43
|
+
id: number;
|
|
44
|
+
_embed?: boolean | undefined;
|
|
45
|
+
_fields?: string | undefined;
|
|
46
|
+
context?: "view" | "embed" | "edit" | undefined;
|
|
47
|
+
}, {
|
|
48
|
+
id: number;
|
|
49
|
+
_embed?: boolean | undefined;
|
|
50
|
+
_fields?: string | undefined;
|
|
51
|
+
context?: "view" | "embed" | "edit" | undefined;
|
|
52
|
+
}>;
|
|
53
|
+
declare const getMeSchema: z.ZodObject<{
|
|
54
|
+
context: z.ZodOptional<z.ZodEnum<["view", "embed", "edit"]>>;
|
|
55
|
+
_fields: z.ZodOptional<z.ZodString>;
|
|
56
|
+
}, "strict", z.ZodTypeAny, {
|
|
57
|
+
_fields?: string | undefined;
|
|
58
|
+
context?: "view" | "embed" | "edit" | undefined;
|
|
59
|
+
}, {
|
|
60
|
+
_fields?: string | undefined;
|
|
61
|
+
context?: "view" | "embed" | "edit" | undefined;
|
|
62
|
+
}>;
|
|
63
|
+
declare const createUserSchema: z.ZodObject<{
|
|
64
|
+
username: z.ZodString;
|
|
65
|
+
name: z.ZodOptional<z.ZodString>;
|
|
66
|
+
first_name: z.ZodOptional<z.ZodString>;
|
|
67
|
+
last_name: z.ZodOptional<z.ZodString>;
|
|
68
|
+
email: z.ZodString;
|
|
69
|
+
url: z.ZodOptional<z.ZodString>;
|
|
70
|
+
description: z.ZodOptional<z.ZodString>;
|
|
71
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
72
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
73
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
74
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
75
|
+
password: z.ZodString;
|
|
76
|
+
}, "strict", z.ZodTypeAny, {
|
|
77
|
+
email: string;
|
|
78
|
+
username: string;
|
|
79
|
+
password: string;
|
|
80
|
+
url?: string | undefined;
|
|
81
|
+
slug?: string | undefined;
|
|
82
|
+
description?: string | undefined;
|
|
83
|
+
name?: string | undefined;
|
|
84
|
+
roles?: string[] | undefined;
|
|
85
|
+
first_name?: string | undefined;
|
|
86
|
+
last_name?: string | undefined;
|
|
87
|
+
locale?: string | undefined;
|
|
88
|
+
nickname?: string | undefined;
|
|
89
|
+
}, {
|
|
90
|
+
email: string;
|
|
91
|
+
username: string;
|
|
92
|
+
password: string;
|
|
93
|
+
url?: string | undefined;
|
|
94
|
+
slug?: string | undefined;
|
|
95
|
+
description?: string | undefined;
|
|
96
|
+
name?: string | undefined;
|
|
97
|
+
roles?: string[] | undefined;
|
|
98
|
+
first_name?: string | undefined;
|
|
99
|
+
last_name?: string | undefined;
|
|
100
|
+
locale?: string | undefined;
|
|
101
|
+
nickname?: string | undefined;
|
|
102
|
+
}>;
|
|
103
|
+
declare const updateUserSchema: z.ZodObject<{
|
|
104
|
+
id: z.ZodNumber;
|
|
105
|
+
username: z.ZodOptional<z.ZodString>;
|
|
106
|
+
name: z.ZodOptional<z.ZodString>;
|
|
107
|
+
first_name: z.ZodOptional<z.ZodString>;
|
|
108
|
+
last_name: z.ZodOptional<z.ZodString>;
|
|
109
|
+
email: z.ZodOptional<z.ZodString>;
|
|
110
|
+
url: z.ZodOptional<z.ZodString>;
|
|
111
|
+
description: z.ZodOptional<z.ZodString>;
|
|
112
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
113
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
114
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
115
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
116
|
+
password: z.ZodOptional<z.ZodString>;
|
|
117
|
+
}, "strict", z.ZodTypeAny, {
|
|
118
|
+
id: number;
|
|
119
|
+
url?: string | undefined;
|
|
120
|
+
slug?: string | undefined;
|
|
121
|
+
description?: string | undefined;
|
|
122
|
+
name?: string | undefined;
|
|
123
|
+
email?: string | undefined;
|
|
124
|
+
roles?: string[] | undefined;
|
|
125
|
+
username?: string | undefined;
|
|
126
|
+
first_name?: string | undefined;
|
|
127
|
+
last_name?: string | undefined;
|
|
128
|
+
locale?: string | undefined;
|
|
129
|
+
nickname?: string | undefined;
|
|
130
|
+
password?: string | undefined;
|
|
131
|
+
}, {
|
|
132
|
+
id: number;
|
|
133
|
+
url?: string | undefined;
|
|
134
|
+
slug?: string | undefined;
|
|
135
|
+
description?: string | undefined;
|
|
136
|
+
name?: string | undefined;
|
|
137
|
+
email?: string | undefined;
|
|
138
|
+
roles?: string[] | undefined;
|
|
139
|
+
username?: string | undefined;
|
|
140
|
+
first_name?: string | undefined;
|
|
141
|
+
last_name?: string | undefined;
|
|
142
|
+
locale?: string | undefined;
|
|
143
|
+
nickname?: string | undefined;
|
|
144
|
+
password?: string | undefined;
|
|
145
|
+
}>;
|
|
146
|
+
declare const deleteUserSchema: z.ZodObject<{
|
|
147
|
+
id: z.ZodNumber;
|
|
148
|
+
force: z.ZodOptional<z.ZodBoolean>;
|
|
149
|
+
reassign: z.ZodOptional<z.ZodNumber>;
|
|
150
|
+
}, "strict", z.ZodTypeAny, {
|
|
151
|
+
id: number;
|
|
152
|
+
force?: boolean | undefined;
|
|
153
|
+
reassign?: number | undefined;
|
|
154
|
+
}, {
|
|
155
|
+
id: number;
|
|
156
|
+
force?: boolean | undefined;
|
|
157
|
+
reassign?: number | undefined;
|
|
158
|
+
}>;
|
|
159
|
+
type ListUsersParams = z.infer<typeof listUsersSchema>;
|
|
160
|
+
type GetUserParams = z.infer<typeof getUserSchema>;
|
|
161
|
+
type CreateUserParams = z.infer<typeof createUserSchema>;
|
|
162
|
+
type UpdateUserParams = z.infer<typeof updateUserSchema>;
|
|
163
|
+
type DeleteUserParams = z.infer<typeof deleteUserSchema>;
|
|
164
|
+
export declare const userTools: Tool[];
|
|
165
|
+
export declare const userHandlers: {
|
|
166
|
+
list_users: (params: ListUsersParams) => Promise<{
|
|
167
|
+
toolResult: {
|
|
168
|
+
content: {
|
|
169
|
+
type: string;
|
|
170
|
+
text: string;
|
|
171
|
+
}[];
|
|
172
|
+
isError?: undefined;
|
|
173
|
+
};
|
|
174
|
+
} | {
|
|
175
|
+
toolResult: {
|
|
176
|
+
isError: boolean;
|
|
177
|
+
content: {
|
|
178
|
+
type: string;
|
|
179
|
+
text: string;
|
|
180
|
+
}[];
|
|
181
|
+
};
|
|
182
|
+
}>;
|
|
183
|
+
get_user: (params: GetUserParams) => Promise<{
|
|
184
|
+
toolResult: {
|
|
185
|
+
content: {
|
|
186
|
+
type: string;
|
|
187
|
+
text: string;
|
|
188
|
+
}[];
|
|
189
|
+
isError?: undefined;
|
|
190
|
+
};
|
|
191
|
+
} | {
|
|
192
|
+
toolResult: {
|
|
193
|
+
isError: boolean;
|
|
194
|
+
content: {
|
|
195
|
+
type: string;
|
|
196
|
+
text: string;
|
|
197
|
+
}[];
|
|
198
|
+
};
|
|
199
|
+
}>;
|
|
200
|
+
get_me: (params: z.infer<typeof getMeSchema>) => Promise<{
|
|
201
|
+
toolResult: {
|
|
202
|
+
content: {
|
|
203
|
+
type: string;
|
|
204
|
+
text: string;
|
|
205
|
+
}[];
|
|
206
|
+
isError?: undefined;
|
|
207
|
+
};
|
|
208
|
+
} | {
|
|
209
|
+
toolResult: {
|
|
210
|
+
isError: boolean;
|
|
211
|
+
content: {
|
|
212
|
+
type: string;
|
|
213
|
+
text: string;
|
|
214
|
+
}[];
|
|
215
|
+
};
|
|
216
|
+
}>;
|
|
217
|
+
create_user: (params: CreateUserParams) => Promise<{
|
|
218
|
+
toolResult: {
|
|
219
|
+
content: {
|
|
220
|
+
type: string;
|
|
221
|
+
text: string;
|
|
222
|
+
}[];
|
|
223
|
+
isError?: undefined;
|
|
224
|
+
};
|
|
225
|
+
} | {
|
|
226
|
+
toolResult: {
|
|
227
|
+
isError: boolean;
|
|
228
|
+
content: {
|
|
229
|
+
type: string;
|
|
230
|
+
text: string;
|
|
231
|
+
}[];
|
|
232
|
+
};
|
|
233
|
+
}>;
|
|
234
|
+
update_user: (params: UpdateUserParams) => Promise<{
|
|
235
|
+
toolResult: {
|
|
236
|
+
content: {
|
|
237
|
+
type: string;
|
|
238
|
+
text: string;
|
|
239
|
+
}[];
|
|
240
|
+
isError?: undefined;
|
|
241
|
+
};
|
|
242
|
+
} | {
|
|
243
|
+
toolResult: {
|
|
244
|
+
isError: boolean;
|
|
245
|
+
content: {
|
|
246
|
+
type: string;
|
|
247
|
+
text: string;
|
|
248
|
+
}[];
|
|
249
|
+
};
|
|
250
|
+
}>;
|
|
251
|
+
delete_user: (params: DeleteUserParams) => Promise<{
|
|
252
|
+
toolResult: {
|
|
253
|
+
content: {
|
|
254
|
+
type: string;
|
|
255
|
+
text: string;
|
|
256
|
+
}[];
|
|
257
|
+
isError?: undefined;
|
|
258
|
+
};
|
|
259
|
+
} | {
|
|
260
|
+
toolResult: {
|
|
261
|
+
isError: boolean;
|
|
262
|
+
content: {
|
|
263
|
+
type: string;
|
|
264
|
+
text: string;
|
|
265
|
+
}[];
|
|
266
|
+
};
|
|
267
|
+
}>;
|
|
268
|
+
};
|
|
269
|
+
export {};
|
|
@@ -0,0 +1,226 @@
|
|
|
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
|
+
_embed: z.boolean().optional().describe("Inline related resources"),
|
|
12
|
+
_fields: z.string().optional().describe("Comma-separated list of fields to return"),
|
|
13
|
+
include_pagination: z.boolean().optional().describe("Include pagination metadata in response")
|
|
14
|
+
});
|
|
15
|
+
const getUserSchema = z.object({
|
|
16
|
+
id: z.number().describe("User ID"),
|
|
17
|
+
context: z.enum(['view', 'embed', 'edit']).optional().describe("Scope under which the request is made"),
|
|
18
|
+
_embed: z.boolean().optional().describe("Inline related resources"),
|
|
19
|
+
_fields: z.string().optional().describe("Comma-separated list of fields to return")
|
|
20
|
+
}).strict();
|
|
21
|
+
const getMeSchema = z.object({
|
|
22
|
+
context: z.enum(['view', 'embed', 'edit']).optional().describe("Scope under which the request is made"),
|
|
23
|
+
_fields: z.string().optional().describe("Comma-separated list of fields to return")
|
|
24
|
+
}).strict();
|
|
25
|
+
const createUserSchema = z.object({
|
|
26
|
+
username: z.string().describe("User login name"),
|
|
27
|
+
name: z.string().optional().describe("Display name for the user"),
|
|
28
|
+
first_name: z.string().optional().describe("First name for the user"),
|
|
29
|
+
last_name: z.string().optional().describe("Last name for the user"),
|
|
30
|
+
email: z.string().email().describe("Email address for the user"),
|
|
31
|
+
url: z.string().url().optional().describe("URL of the user"),
|
|
32
|
+
description: z.string().optional().describe("Description of the user"),
|
|
33
|
+
locale: z.string().optional().describe("Locale for the user"),
|
|
34
|
+
nickname: z.string().optional().describe("Nickname for the user"),
|
|
35
|
+
slug: z.string().optional().describe("Slug for the user"),
|
|
36
|
+
roles: z.array(z.string()).optional().describe("Roles assigned to the user"),
|
|
37
|
+
password: z.string().describe("Password for the user")
|
|
38
|
+
}).strict();
|
|
39
|
+
const updateUserSchema = z.object({
|
|
40
|
+
id: z.number().describe("User ID"),
|
|
41
|
+
username: z.string().optional().describe("User login name"),
|
|
42
|
+
name: z.string().optional().describe("Display name for the user"),
|
|
43
|
+
first_name: z.string().optional().describe("First name for the user"),
|
|
44
|
+
last_name: z.string().optional().describe("Last name for the user"),
|
|
45
|
+
email: z.string().email().optional().describe("Email address for the user"),
|
|
46
|
+
url: z.string().url().optional().describe("URL of the user"),
|
|
47
|
+
description: z.string().optional().describe("Description of the user"),
|
|
48
|
+
locale: z.string().optional().describe("Locale for the user"),
|
|
49
|
+
nickname: z.string().optional().describe("Nickname for the user"),
|
|
50
|
+
slug: z.string().optional().describe("Slug for the user"),
|
|
51
|
+
roles: z.array(z.string()).optional().describe("Roles assigned to the user"),
|
|
52
|
+
password: z.string().optional().describe("Password for the user")
|
|
53
|
+
}).strict();
|
|
54
|
+
const deleteUserSchema = z.object({
|
|
55
|
+
id: z.number().describe("User ID"),
|
|
56
|
+
force: z.boolean().optional().describe("Whether to bypass trash and force deletion"),
|
|
57
|
+
reassign: z.number().optional().describe("User ID to reassign posts to")
|
|
58
|
+
}).strict();
|
|
59
|
+
export const userTools = [
|
|
60
|
+
{
|
|
61
|
+
name: "list_users",
|
|
62
|
+
description: "Lists all users with filtering, sorting, and pagination options",
|
|
63
|
+
inputSchema: { type: "object", properties: listUsersSchema.shape }
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "get_user",
|
|
67
|
+
description: "Gets a user by ID",
|
|
68
|
+
inputSchema: { type: "object", properties: getUserSchema.shape }
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "get_me",
|
|
72
|
+
description: "Gets the currently authenticated user",
|
|
73
|
+
inputSchema: { type: "object", properties: getMeSchema.shape }
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "create_user",
|
|
77
|
+
description: "Creates a new user",
|
|
78
|
+
inputSchema: { type: "object", properties: createUserSchema.shape }
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "update_user",
|
|
82
|
+
description: "Updates an existing user",
|
|
83
|
+
inputSchema: { type: "object", properties: updateUserSchema.shape }
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "delete_user",
|
|
87
|
+
description: "Deletes a user",
|
|
88
|
+
inputSchema: { type: "object", properties: deleteUserSchema.shape }
|
|
89
|
+
}
|
|
90
|
+
];
|
|
91
|
+
export const userHandlers = {
|
|
92
|
+
list_users: async (params) => {
|
|
93
|
+
try {
|
|
94
|
+
const { include_pagination, ...queryParams } = params;
|
|
95
|
+
const response = await makeWordPressRequest('GET', "users", queryParams, {
|
|
96
|
+
includePagination: include_pagination,
|
|
97
|
+
});
|
|
98
|
+
return {
|
|
99
|
+
toolResult: {
|
|
100
|
+
content: [{ type: 'text', text: JSON.stringify(response, null, 2) }],
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
const errorMessage = error.response?.data?.message || error.message;
|
|
106
|
+
return {
|
|
107
|
+
toolResult: {
|
|
108
|
+
isError: true,
|
|
109
|
+
content: [{ type: 'text', text: `Error listing users: ${errorMessage}` }],
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
get_user: async (params) => {
|
|
115
|
+
try {
|
|
116
|
+
const queryParams = { context: params.context };
|
|
117
|
+
if (params._embed)
|
|
118
|
+
queryParams._embed = true;
|
|
119
|
+
if (params._fields)
|
|
120
|
+
queryParams._fields = params._fields;
|
|
121
|
+
const response = await makeWordPressRequest('GET', `users/${params.id}`, queryParams);
|
|
122
|
+
return {
|
|
123
|
+
toolResult: {
|
|
124
|
+
content: [{ type: 'text', text: JSON.stringify(response, 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 getting user: ${errorMessage}` }],
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
get_me: async (params) => {
|
|
139
|
+
try {
|
|
140
|
+
const queryParams = {};
|
|
141
|
+
if (params.context)
|
|
142
|
+
queryParams.context = params.context;
|
|
143
|
+
if (params._fields)
|
|
144
|
+
queryParams._fields = params._fields;
|
|
145
|
+
const response = await makeWordPressRequest('GET', 'users/me', queryParams);
|
|
146
|
+
return {
|
|
147
|
+
toolResult: {
|
|
148
|
+
content: [{ type: 'text', text: JSON.stringify(response, null, 2) }],
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
const errorMessage = error.response?.data?.message || error.message;
|
|
154
|
+
return {
|
|
155
|
+
toolResult: {
|
|
156
|
+
isError: true,
|
|
157
|
+
content: [{ type: 'text', text: `Error getting current user: ${errorMessage}` }],
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
create_user: async (params) => {
|
|
163
|
+
try {
|
|
164
|
+
const response = await makeWordPressRequest('POST', "users", params);
|
|
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 creating user: ${errorMessage}` }],
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
update_user: async (params) => {
|
|
183
|
+
try {
|
|
184
|
+
const { id, ...updateData } = params;
|
|
185
|
+
const response = await makeWordPressRequest('POST', `users/${id}`, updateData);
|
|
186
|
+
const user = response;
|
|
187
|
+
return {
|
|
188
|
+
toolResult: {
|
|
189
|
+
content: [{ type: 'text', text: JSON.stringify(user, null, 2) }],
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
const errorMessage = error.response?.data?.message || error.message;
|
|
195
|
+
return {
|
|
196
|
+
toolResult: {
|
|
197
|
+
isError: true,
|
|
198
|
+
content: [{ type: 'text', text: `Error updating user: ${errorMessage}` }],
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
delete_user: async (params) => {
|
|
204
|
+
try {
|
|
205
|
+
const response = await makeWordPressRequest('DELETE', `users/${params.id}`, {
|
|
206
|
+
force: params.force,
|
|
207
|
+
reassign: params.reassign
|
|
208
|
+
});
|
|
209
|
+
const user = response;
|
|
210
|
+
return {
|
|
211
|
+
toolResult: {
|
|
212
|
+
content: [{ type: 'text', text: JSON.stringify(user, null, 2) }],
|
|
213
|
+
},
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
catch (error) {
|
|
217
|
+
const errorMessage = error.response?.data?.message || error.message;
|
|
218
|
+
return {
|
|
219
|
+
toolResult: {
|
|
220
|
+
isError: true,
|
|
221
|
+
content: [{ type: 'text', text: `Error deleting user: ${errorMessage}` }],
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
};
|
|
@@ -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,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse WP_SITES_CONFIG JSON and initialize all site clients
|
|
3
|
+
*/
|
|
4
|
+
export declare function initWordPress(): Promise<void>;
|
|
5
|
+
/**
|
|
6
|
+
* Switch the active site
|
|
7
|
+
*/
|
|
8
|
+
export declare function switchSite(siteId: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* List all configured sites
|
|
11
|
+
*/
|
|
12
|
+
export declare function listSites(): string[];
|
|
13
|
+
/**
|
|
14
|
+
* Get the active site ID
|
|
15
|
+
*/
|
|
16
|
+
export declare function getActiveSite(): string;
|
|
17
|
+
/**
|
|
18
|
+
* Log to stderr (safe for MCP stdio transport)
|
|
19
|
+
*/
|
|
20
|
+
export declare function logToStderr(message: string): void;
|
|
21
|
+
export declare const logToFile: typeof logToStderr;
|
|
22
|
+
export interface WordPressRequestOptions {
|
|
23
|
+
headers?: Record<string, string>;
|
|
24
|
+
isFormData?: boolean;
|
|
25
|
+
rawResponse?: boolean;
|
|
26
|
+
siteId?: string;
|
|
27
|
+
namespace?: string;
|
|
28
|
+
timeout?: number;
|
|
29
|
+
includePagination?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface PaginatedResponse<T = any> {
|
|
32
|
+
items: T;
|
|
33
|
+
pagination: {
|
|
34
|
+
total: number;
|
|
35
|
+
totalPages: number;
|
|
36
|
+
page: number;
|
|
37
|
+
perPage: number;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Make a request to the WordPress API (active site or specific site).
|
|
42
|
+
* Includes automatic retry with exponential backoff and concurrency limiting.
|
|
43
|
+
*/
|
|
44
|
+
export declare function makeWordPressRequest(method: string, endpoint: string, data?: any, options?: WordPressRequestOptions): Promise<any>;
|
|
45
|
+
/**
|
|
46
|
+
* Search the WordPress.org Plugin Repository
|
|
47
|
+
*/
|
|
48
|
+
export declare function searchWordPressPluginRepository(searchQuery: string, page?: number, perPage?: number): Promise<any>;
|