mcp-wordpress 3.1.11 → 3.1.12
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/dist/tools/auth.d.ts +2 -8
- package/dist/tools/auth.d.ts.map +1 -1
- package/dist/tools/auth.js +31 -25
- package/dist/tools/auth.js.map +1 -1
- package/dist/tools/comments.d.ts +2 -8
- package/dist/tools/comments.d.ts.map +1 -1
- package/dist/tools/comments.js +92 -86
- package/dist/tools/comments.js.map +1 -1
- package/dist/tools/media.d.ts +2 -8
- package/dist/tools/media.d.ts.map +1 -1
- package/dist/tools/media.js +98 -100
- package/dist/tools/media.js.map +1 -1
- package/dist/tools/pages.d.ts +2 -8
- package/dist/tools/pages.d.ts.map +1 -1
- package/dist/tools/pages.js +93 -89
- package/dist/tools/pages.js.map +1 -1
- package/dist/tools/site.d.ts +2 -8
- package/dist/tools/site.d.ts.map +1 -1
- package/dist/tools/site.js +69 -63
- package/dist/tools/site.js.map +1 -1
- package/dist/tools/taxonomies.d.ts +2 -8
- package/dist/tools/taxonomies.d.ts.map +1 -1
- package/dist/tools/taxonomies.js +104 -88
- package/dist/tools/taxonomies.js.map +1 -1
- package/dist/tools/users.d.ts +2 -8
- package/dist/tools/users.d.ts.map +1 -1
- package/dist/tools/users.js +78 -74
- package/dist/tools/users.js.map +1 -1
- package/package.json +1 -1
- package/src/tools/auth.ts +33 -33
- package/src/tools/comments.ts +94 -94
- package/src/tools/media.ts +95 -103
- package/src/tools/pages.ts +95 -97
- package/src/tools/site.ts +71 -71
- package/src/tools/taxonomies.ts +106 -96
- package/src/tools/users.ts +80 -82
package/src/tools/users.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { WordPressClient } from "@/client/api.js";
|
|
2
|
+
import type { MCPToolSchema } from "@/types/mcp.js";
|
|
2
3
|
import { CreateUserRequest, UpdateUserRequest, UserQueryParams } from "@/types/wordpress.js";
|
|
3
4
|
import { getErrorMessage } from "@/utils/error.js";
|
|
4
5
|
import { WordPressDataStreamer, StreamingUtils, StreamingResult } from "@/utils/streaming.js";
|
|
@@ -16,14 +17,7 @@ export class UserTools {
|
|
|
16
17
|
public getTools(): Array<{
|
|
17
18
|
name: string;
|
|
18
19
|
description: string;
|
|
19
|
-
|
|
20
|
-
name: string;
|
|
21
|
-
type?: string;
|
|
22
|
-
description?: string;
|
|
23
|
-
required?: boolean;
|
|
24
|
-
enum?: string[];
|
|
25
|
-
items?: unknown;
|
|
26
|
-
}>;
|
|
20
|
+
inputSchema?: MCPToolSchema;
|
|
27
21
|
handler: (client: WordPressClient, params: Record<string, unknown>) => Promise<unknown>;
|
|
28
22
|
}> {
|
|
29
23
|
return [
|
|
@@ -37,32 +31,35 @@ export class UserTools {
|
|
|
37
31
|
'• Filter by role: `wp_list_users --roles=["editor","author"]`\n' +
|
|
38
32
|
'• Find admins: `wp_list_users --roles=["administrator"]`\n' +
|
|
39
33
|
'• Combined search: `wp_list_users --search="smith" --roles=["subscriber"]`',
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
34
|
+
inputSchema: {
|
|
35
|
+
type: "object",
|
|
36
|
+
properties: {
|
|
37
|
+
search: {
|
|
38
|
+
type: "string",
|
|
39
|
+
description: "Limit results to those matching a search term.",
|
|
40
|
+
},
|
|
41
|
+
roles: {
|
|
42
|
+
type: "array",
|
|
43
|
+
items: { type: "string" },
|
|
44
|
+
description: "Limit results to users with specific roles.",
|
|
45
|
+
},
|
|
45
46
|
},
|
|
46
|
-
|
|
47
|
-
name: "roles",
|
|
48
|
-
type: "array",
|
|
49
|
-
items: { type: "string" },
|
|
50
|
-
description: "Limit results to users with specific roles.",
|
|
51
|
-
},
|
|
52
|
-
],
|
|
47
|
+
},
|
|
53
48
|
handler: this.handleListUsers.bind(this),
|
|
54
49
|
},
|
|
55
50
|
{
|
|
56
51
|
name: "wp_get_user",
|
|
57
52
|
description: "Retrieves a single user by their ID.",
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
53
|
+
inputSchema: {
|
|
54
|
+
type: "object",
|
|
55
|
+
properties: {
|
|
56
|
+
id: {
|
|
57
|
+
type: "number",
|
|
58
|
+
description: "The unique identifier for the user.",
|
|
59
|
+
},
|
|
64
60
|
},
|
|
65
|
-
|
|
61
|
+
required: ["id"],
|
|
62
|
+
},
|
|
66
63
|
handler: this.handleGetUser.bind(this),
|
|
67
64
|
},
|
|
68
65
|
{
|
|
@@ -74,79 +71,80 @@ export class UserTools {
|
|
|
74
71
|
"• Check permissions: Use this to verify your current user's capabilities and roles\n" +
|
|
75
72
|
"• Account verification: Confirm you're authenticated with the correct account\n" +
|
|
76
73
|
"• Profile details: View registration date, email, and user metadata",
|
|
77
|
-
|
|
74
|
+
inputSchema: {
|
|
75
|
+
type: "object",
|
|
76
|
+
properties: {},
|
|
77
|
+
},
|
|
78
78
|
handler: this.handleGetCurrentUser.bind(this),
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
name: "wp_create_user",
|
|
82
82
|
description: "Creates a new user.",
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
name: "roles",
|
|
104
|
-
type: "array",
|
|
105
|
-
items: { type: "string" },
|
|
106
|
-
description: "An array of roles to assign to the user.",
|
|
83
|
+
inputSchema: {
|
|
84
|
+
type: "object",
|
|
85
|
+
properties: {
|
|
86
|
+
username: {
|
|
87
|
+
type: "string",
|
|
88
|
+
description: "The username for the new user.",
|
|
89
|
+
},
|
|
90
|
+
email: {
|
|
91
|
+
type: "string",
|
|
92
|
+
description: "The email address for the new user.",
|
|
93
|
+
},
|
|
94
|
+
password: {
|
|
95
|
+
type: "string",
|
|
96
|
+
description: "The password for the new user.",
|
|
97
|
+
},
|
|
98
|
+
roles: {
|
|
99
|
+
type: "array",
|
|
100
|
+
items: { type: "string" },
|
|
101
|
+
description: "An array of roles to assign to the user.",
|
|
102
|
+
},
|
|
107
103
|
},
|
|
108
|
-
|
|
104
|
+
required: ["username", "email", "password"],
|
|
105
|
+
},
|
|
109
106
|
handler: this.handleCreateUser.bind(this),
|
|
110
107
|
},
|
|
111
108
|
{
|
|
112
109
|
name: "wp_update_user",
|
|
113
110
|
description: "Updates an existing user.",
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
description: "The new display name for the user.",
|
|
111
|
+
inputSchema: {
|
|
112
|
+
type: "object",
|
|
113
|
+
properties: {
|
|
114
|
+
id: {
|
|
115
|
+
type: "number",
|
|
116
|
+
description: "The ID of the user to update.",
|
|
117
|
+
},
|
|
118
|
+
email: {
|
|
119
|
+
type: "string",
|
|
120
|
+
description: "The new email address for the user.",
|
|
121
|
+
},
|
|
122
|
+
name: {
|
|
123
|
+
type: "string",
|
|
124
|
+
description: "The new display name for the user.",
|
|
125
|
+
},
|
|
130
126
|
},
|
|
131
|
-
|
|
127
|
+
required: ["id"],
|
|
128
|
+
},
|
|
132
129
|
handler: this.handleUpdateUser.bind(this),
|
|
133
130
|
},
|
|
134
131
|
{
|
|
135
132
|
name: "wp_delete_user",
|
|
136
133
|
description: "Deletes a user.",
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
134
|
+
inputSchema: {
|
|
135
|
+
type: "object",
|
|
136
|
+
properties: {
|
|
137
|
+
id: {
|
|
138
|
+
type: "number",
|
|
139
|
+
description: "The ID of the user to delete.",
|
|
140
|
+
},
|
|
141
|
+
reassign: {
|
|
142
|
+
type: "number",
|
|
143
|
+
description: "The ID of a user to reassign the deleted user's content to.",
|
|
144
|
+
},
|
|
148
145
|
},
|
|
149
|
-
|
|
146
|
+
required: ["id"],
|
|
147
|
+
},
|
|
150
148
|
handler: this.handleDeleteUser.bind(this),
|
|
151
149
|
},
|
|
152
150
|
];
|