mcp-wordpress 1.5.2 → 2.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.
- package/README.md +332 -61
- package/dist/cache/CacheInvalidation.d.ts.map +1 -1
- package/dist/cache/CacheInvalidation.js +4 -4
- package/dist/cache/CacheInvalidation.js.map +1 -1
- package/dist/client/MockWordPressClient.d.ts +55 -0
- package/dist/client/MockWordPressClient.d.ts.map +1 -0
- package/dist/client/MockWordPressClient.js +369 -0
- package/dist/client/MockWordPressClient.js.map +1 -0
- package/dist/client/api.d.ts +1 -0
- package/dist/client/api.d.ts.map +1 -1
- package/dist/client/api.js +26 -60
- package/dist/client/api.js.map +1 -1
- package/dist/client/managers/AuthenticationManager.d.ts.map +1 -1
- package/dist/client/managers/AuthenticationManager.js +4 -3
- package/dist/client/managers/AuthenticationManager.js.map +1 -1
- package/dist/config/ConfigurationSchema.d.ts +3 -3
- package/dist/config/ConfigurationSchema.d.ts.map +1 -1
- package/dist/config/ConfigurationSchema.js +7 -24
- package/dist/config/ConfigurationSchema.js.map +1 -1
- package/dist/config/ServerConfiguration.d.ts +8 -0
- package/dist/config/ServerConfiguration.d.ts.map +1 -1
- package/dist/config/ServerConfiguration.js +80 -31
- package/dist/config/ServerConfiguration.js.map +1 -1
- package/dist/docs/DocumentationGenerator.d.ts.map +1 -1
- package/dist/docs/DocumentationGenerator.js +5 -7
- package/dist/docs/DocumentationGenerator.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -29
- package/dist/index.js.map +1 -1
- package/dist/security/InputValidator.d.ts.map +1 -1
- package/dist/security/InputValidator.js +3 -11
- package/dist/security/InputValidator.js.map +1 -1
- package/dist/server/ToolRegistry.d.ts +4 -0
- package/dist/server/ToolRegistry.d.ts.map +1 -1
- package/dist/server/ToolRegistry.js +71 -8
- package/dist/server/ToolRegistry.js.map +1 -1
- package/dist/tools/auth.d.ts.map +1 -1
- package/dist/tools/auth.js +8 -3
- package/dist/tools/auth.js.map +1 -1
- package/dist/tools/posts.d.ts.map +1 -1
- package/dist/tools/posts.js +287 -20
- package/dist/tools/posts.js.map +1 -1
- package/dist/tools/site.d.ts.map +1 -1
- package/dist/tools/site.js +47 -9
- package/dist/tools/site.js.map +1 -1
- package/dist/tools/users.d.ts.map +1 -1
- package/dist/tools/users.js +113 -10
- package/dist/tools/users.js.map +1 -1
- package/dist/utils/enhancedError.d.ts +61 -0
- package/dist/utils/enhancedError.d.ts.map +1 -0
- package/dist/utils/enhancedError.js +221 -0
- package/dist/utils/enhancedError.js.map +1 -0
- package/dist/utils/streaming.d.ts +104 -0
- package/dist/utils/streaming.d.ts.map +1 -0
- package/dist/utils/streaming.js +312 -0
- package/dist/utils/streaming.js.map +1 -0
- package/dist/utils/validation.d.ts +19 -3
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +174 -24
- package/dist/utils/validation.js.map +1 -1
- package/docs/ARCHITECTURE.md +850 -0
- package/docs/CACHING.md +20 -17
- package/docs/CONFIGURATION.md +660 -0
- package/docs/DOCKER.md +61 -60
- package/docs/EVALUATION.md +397 -0
- package/docs/INSTALLATION.md +423 -0
- package/docs/PERFORMANCE_MONITORING.md +17 -15
- package/docs/SECURITY.md +621 -0
- package/docs/SECURITY_TESTING.md +22 -26
- package/docs/TEST_SITE_SETUP.md +136 -0
- package/docs/TROUBLESHOOTING.md +578 -0
- package/docs/api/README.md +76 -91
- package/docs/api/categories/auth.md +0 -2
- package/docs/api/categories/cache.md +0 -2
- package/docs/api/categories/comment.md +0 -2
- package/docs/api/categories/media.md +0 -2
- package/docs/api/categories/page.md +0 -2
- package/docs/api/categories/performance.md +0 -2
- package/docs/api/categories/post.md +0 -2
- package/docs/api/categories/site.md +0 -2
- package/docs/api/categories/taxonomy.md +0 -2
- package/docs/api/categories/user.md +0 -2
- package/docs/api/summary.json +1 -1
- package/docs/api/tools/wp_approve_comment.md +11 -3
- package/docs/api/tools/wp_cache_clear.md +14 -5
- package/docs/api/tools/wp_cache_info.md +14 -5
- package/docs/api/tools/wp_cache_stats.md +14 -5
- package/docs/api/tools/wp_cache_warm.md +14 -5
- package/docs/api/tools/wp_create_application_password.md +11 -3
- package/docs/api/tools/wp_create_category.md +11 -3
- package/docs/api/tools/wp_create_comment.md +14 -5
- package/docs/api/tools/wp_create_page.md +13 -5
- package/docs/api/tools/wp_create_post.md +14 -7
- package/docs/api/tools/wp_create_tag.md +11 -3
- package/docs/api/tools/wp_create_user.md +13 -5
- package/docs/api/tools/wp_delete_application_password.md +11 -3
- package/docs/api/tools/wp_delete_category.md +11 -3
- package/docs/api/tools/wp_delete_comment.md +11 -3
- package/docs/api/tools/wp_delete_media.md +10 -3
- package/docs/api/tools/wp_delete_page.md +10 -3
- package/docs/api/tools/wp_delete_post.md +11 -5
- package/docs/api/tools/wp_delete_tag.md +11 -3
- package/docs/api/tools/wp_delete_user.md +10 -3
- package/docs/api/tools/wp_get_application_passwords.md +11 -3
- package/docs/api/tools/wp_get_auth_status.md +11 -3
- package/docs/api/tools/wp_get_category.md +11 -3
- package/docs/api/tools/wp_get_comment.md +11 -3
- package/docs/api/tools/wp_get_current_user.md +11 -3
- package/docs/api/tools/wp_get_media.md +11 -3
- package/docs/api/tools/wp_get_page.md +11 -3
- package/docs/api/tools/wp_get_page_revisions.md +11 -3
- package/docs/api/tools/wp_get_post.md +12 -5
- package/docs/api/tools/wp_get_post_revisions.md +11 -3
- package/docs/api/tools/wp_get_site_settings.md +10 -3
- package/docs/api/tools/wp_get_tag.md +11 -3
- package/docs/api/tools/wp_get_user.md +11 -3
- package/docs/api/tools/wp_list_categories.md +11 -3
- package/docs/api/tools/wp_list_comments.md +11 -3
- package/docs/api/tools/wp_list_media.md +14 -5
- package/docs/api/tools/wp_list_pages.md +14 -5
- package/docs/api/tools/wp_list_posts.md +15 -7
- package/docs/api/tools/wp_list_tags.md +11 -3
- package/docs/api/tools/wp_list_users.md +11 -3
- package/docs/api/tools/wp_performance_alerts.md +17 -7
- package/docs/api/tools/wp_performance_benchmark.md +17 -7
- package/docs/api/tools/wp_performance_export.md +17 -7
- package/docs/api/tools/wp_performance_history.md +17 -7
- package/docs/api/tools/wp_performance_optimize.md +17 -7
- package/docs/api/tools/wp_performance_stats.md +17 -7
- package/docs/api/tools/wp_search_site.md +11 -3
- package/docs/api/tools/wp_spam_comment.md +11 -3
- package/docs/api/tools/wp_switch_auth_method.md +14 -5
- package/docs/api/tools/wp_test_auth.md +11 -3
- package/docs/api/tools/wp_update_category.md +11 -3
- package/docs/api/tools/wp_update_comment.md +14 -5
- package/docs/api/tools/wp_update_media.md +14 -5
- package/docs/api/tools/wp_update_page.md +13 -5
- package/docs/api/tools/wp_update_post.md +14 -7
- package/docs/api/tools/wp_update_site_settings.md +14 -5
- package/docs/api/tools/wp_update_tag.md +11 -3
- package/docs/api/tools/wp_update_user.md +13 -5
- package/docs/api/tools/wp_upload_media.md +13 -5
- package/docs/api/types/WordPressPost.md +2 -0
- package/docs/code-improvements.md +40 -0
- package/docs/contract-testing.md +1 -1
- package/docs/developer/API_REFERENCE.md +19 -59
- package/docs/developer/ARCHITECTURE.md +8 -11
- package/docs/developer/BUILD_SYSTEM.md +2 -2
- package/docs/developer/CONTRIBUTING.md +3 -5
- package/docs/developer/GITHUB_ACTIONS_SETUP.md +2 -2
- package/docs/developer/MIGRATION_GUIDE.md +5 -6
- package/docs/developer/README.md +2 -1
- package/docs/developer/REFACTORING.md +9 -15
- package/docs/developer/RELEASE_PROCESS.md +4 -3
- package/docs/developer/TESTING.md +2 -2
- package/docs/examples/claude-desktop-config.md +8 -0
- package/docs/integrations/claude-desktop.md +426 -0
- package/docs/integrations/cline.md +537 -0
- package/docs/integrations/vs-code.md +515 -0
- package/docs/releases/COMMUNITY_ANNOUNCEMENT_v1.1.2.md +30 -23
- package/docs/releases/RELEASE_NOTES_v1.1.2.md +7 -6
- package/docs/testing-configurations.md +11 -0
- package/docs/user-guides/DOCKER_NPM_DTX_SETUP.md +3 -2
- package/docs/user-guides/DOCKER_SETUP.md +3 -2
- package/docs/user-guides/DTX_SETUP.md +6 -5
- package/docs/user-guides/DXT_INSTALLATION.md +4 -4
- package/docs/user-guides/NPM_SETUP.md +4 -2
- package/docs/user-guides/NPX_SETUP.md +4 -2
- package/docs/user-guides/SMITHERY_SETUP.md +402 -0
- package/docs/wordpress-rest-api-authentication-troubleshooting.md +45 -42
- package/package.json +12 -2
- package/src/cache/CacheInvalidation.ts +7 -18
- package/src/client/MockWordPressClient.ts +398 -0
- package/src/client/api.ts +77 -237
- package/src/client/managers/AuthenticationManager.ts +19 -56
- package/src/config/ConfigurationSchema.ts +14 -45
- package/src/config/ServerConfiguration.ts +98 -71
- package/src/docs/DocumentationGenerator.ts +39 -123
- package/src/dxt-entry.cjs +4 -1
- package/src/index.ts +35 -54
- package/src/security/InputValidator.ts +15 -57
- package/src/server/ToolRegistry.ts +88 -17
- package/src/tools/auth.ts +15 -22
- package/src/tools/posts.ts +347 -64
- package/src/tools/site.ts +69 -46
- package/src/tools/users.ts +142 -44
- package/src/utils/enhancedError.ts +248 -0
- package/src/utils/streaming.ts +428 -0
- package/src/utils/validation.ts +253 -92
- package/dist/mcp-wordpress-1.5.2.tgz +0 -0
|
@@ -19,13 +19,11 @@ Updates one or more general settings for a WordPress site.
|
|
|
19
19
|
Simple example of using wp_update_site_settings
|
|
20
20
|
|
|
21
21
|
**Command:**
|
|
22
|
-
|
|
23
22
|
```bash
|
|
24
23
|
wp_update_site_settings
|
|
25
24
|
```
|
|
26
25
|
|
|
27
26
|
**Response:**
|
|
28
|
-
|
|
29
27
|
```json
|
|
30
28
|
{
|
|
31
29
|
"success": true,
|
|
@@ -38,7 +36,6 @@ wp_update_site_settings
|
|
|
38
36
|
```
|
|
39
37
|
|
|
40
38
|
**Error Example (Authentication failure):**
|
|
41
|
-
|
|
42
39
|
```json
|
|
43
40
|
{
|
|
44
41
|
"error": "Authentication failed",
|
|
@@ -46,18 +43,17 @@ wp_update_site_settings
|
|
|
46
43
|
}
|
|
47
44
|
```
|
|
48
45
|
|
|
46
|
+
|
|
49
47
|
### Advanced site Configuration
|
|
50
48
|
|
|
51
49
|
Comprehensive example using all available parameters
|
|
52
50
|
|
|
53
51
|
**Command:**
|
|
54
|
-
|
|
55
52
|
```bash
|
|
56
53
|
wp_update_site_settings --title="Example Post Title" --description="example_value" --timezone="example_value"
|
|
57
54
|
```
|
|
58
55
|
|
|
59
56
|
**Response:**
|
|
60
|
-
|
|
61
57
|
```json
|
|
62
58
|
{
|
|
63
59
|
"success": true,
|
|
@@ -69,6 +65,13 @@ wp_update_site_settings --title="Example Post Title" --description="example_valu
|
|
|
69
65
|
}
|
|
70
66
|
```
|
|
71
67
|
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
72
75
|
## Response Format
|
|
73
76
|
|
|
74
77
|
**Return Type:** `site`
|
|
@@ -95,24 +98,30 @@ wp_update_site_settings --title="Example Post Title" --description="example_valu
|
|
|
95
98
|
**Description:** Invalid credentials or insufficient permissions
|
|
96
99
|
**Resolution:** Check your authentication credentials and user permissions
|
|
97
100
|
|
|
101
|
+
|
|
98
102
|
### VALIDATION_ERROR
|
|
99
103
|
|
|
100
104
|
**Message:** Parameter validation failed
|
|
101
105
|
**Description:** One or more required parameters are missing or invalid
|
|
102
106
|
**Resolution:** Review the required parameters and their formats
|
|
103
107
|
|
|
108
|
+
|
|
104
109
|
### NOT_FOUND
|
|
105
110
|
|
|
106
111
|
**Message:** Resource not found
|
|
107
112
|
**Description:** The requested resource does not exist
|
|
108
113
|
**Resolution:** Verify the resource ID and ensure it exists
|
|
109
114
|
|
|
115
|
+
|
|
110
116
|
### PERMISSION_DENIED
|
|
111
117
|
|
|
112
118
|
**Message:** Insufficient permissions
|
|
113
119
|
**Description:** The user does not have permission to perform this action
|
|
114
120
|
**Resolution:** Contact an administrator to grant the necessary permissions
|
|
115
121
|
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
116
125
|
---
|
|
117
126
|
|
|
118
127
|
*Generated automatically from tool definitions - Do not edit manually*
|
|
@@ -18,13 +18,11 @@ Updates an existing tag.
|
|
|
18
18
|
Simple example of using wp_update_tag
|
|
19
19
|
|
|
20
20
|
**Command:**
|
|
21
|
-
|
|
22
21
|
```bash
|
|
23
22
|
wp_update_tag --id="123"
|
|
24
23
|
```
|
|
25
24
|
|
|
26
25
|
**Response:**
|
|
27
|
-
|
|
28
26
|
```json
|
|
29
27
|
{
|
|
30
28
|
"success": true,
|
|
@@ -37,7 +35,6 @@ wp_update_tag --id="123"
|
|
|
37
35
|
```
|
|
38
36
|
|
|
39
37
|
**Error Example (Authentication failure):**
|
|
40
|
-
|
|
41
38
|
```json
|
|
42
39
|
{
|
|
43
40
|
"error": "Authentication failed",
|
|
@@ -45,6 +42,11 @@ wp_update_tag --id="123"
|
|
|
45
42
|
}
|
|
46
43
|
```
|
|
47
44
|
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
48
50
|
## Response Format
|
|
49
51
|
|
|
50
52
|
**Return Type:** `taxonomy`
|
|
@@ -71,24 +73,30 @@ wp_update_tag --id="123"
|
|
|
71
73
|
**Description:** Invalid credentials or insufficient permissions
|
|
72
74
|
**Resolution:** Check your authentication credentials and user permissions
|
|
73
75
|
|
|
76
|
+
|
|
74
77
|
### VALIDATION_ERROR
|
|
75
78
|
|
|
76
79
|
**Message:** Parameter validation failed
|
|
77
80
|
**Description:** One or more required parameters are missing or invalid
|
|
78
81
|
**Resolution:** Review the required parameters and their formats
|
|
79
82
|
|
|
83
|
+
|
|
80
84
|
### NOT_FOUND
|
|
81
85
|
|
|
82
86
|
**Message:** Resource not found
|
|
83
87
|
**Description:** The requested resource does not exist
|
|
84
88
|
**Resolution:** Verify the resource ID and ensure it exists
|
|
85
89
|
|
|
90
|
+
|
|
86
91
|
### PERMISSION_DENIED
|
|
87
92
|
|
|
88
93
|
**Message:** Insufficient permissions
|
|
89
94
|
**Description:** The user does not have permission to perform this action
|
|
90
95
|
**Resolution:** Contact an administrator to grant the necessary permissions
|
|
91
96
|
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
92
100
|
---
|
|
93
101
|
|
|
94
102
|
*Generated automatically from tool definitions - Do not edit manually*
|
|
@@ -19,13 +19,11 @@ Updates an existing user.
|
|
|
19
19
|
Simple example of using wp_update_user
|
|
20
20
|
|
|
21
21
|
**Command:**
|
|
22
|
-
|
|
23
22
|
```bash
|
|
24
23
|
wp_update_user --id="123"
|
|
25
24
|
```
|
|
26
25
|
|
|
27
26
|
**Response:**
|
|
28
|
-
|
|
29
27
|
```json
|
|
30
28
|
{
|
|
31
29
|
"success": true,
|
|
@@ -38,7 +36,6 @@ wp_update_user --id="123"
|
|
|
38
36
|
```
|
|
39
37
|
|
|
40
38
|
**Error Example (Authentication failure):**
|
|
41
|
-
|
|
42
39
|
```json
|
|
43
40
|
{
|
|
44
41
|
"error": "Authentication failed",
|
|
@@ -46,18 +43,17 @@ wp_update_user --id="123"
|
|
|
46
43
|
}
|
|
47
44
|
```
|
|
48
45
|
|
|
46
|
+
|
|
49
47
|
### Advanced user Configuration
|
|
50
48
|
|
|
51
49
|
Comprehensive example using all available parameters
|
|
52
50
|
|
|
53
51
|
**Command:**
|
|
54
|
-
|
|
55
52
|
```bash
|
|
56
53
|
wp_update_user --id="123" --email="user@example.com" --name="example_value"
|
|
57
54
|
```
|
|
58
55
|
|
|
59
56
|
**Response:**
|
|
60
|
-
|
|
61
57
|
```json
|
|
62
58
|
{
|
|
63
59
|
"success": true,
|
|
@@ -69,6 +65,11 @@ wp_update_user --id="123" --email="user@example.com" --name="example_value"
|
|
|
69
65
|
}
|
|
70
66
|
```
|
|
71
67
|
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
72
73
|
## Required Permissions
|
|
73
74
|
|
|
74
75
|
This tool requires the following WordPress user capabilities:
|
|
@@ -77,6 +78,7 @@ This tool requires the following WordPress user capabilities:
|
|
|
77
78
|
|
|
78
79
|
**Note:** The authenticated user must have these capabilities to successfully execute this tool.
|
|
79
80
|
|
|
81
|
+
|
|
80
82
|
## Response Format
|
|
81
83
|
|
|
82
84
|
**Return Type:** `user`
|
|
@@ -103,24 +105,30 @@ This tool requires the following WordPress user capabilities:
|
|
|
103
105
|
**Description:** Invalid credentials or insufficient permissions
|
|
104
106
|
**Resolution:** Check your authentication credentials and user permissions
|
|
105
107
|
|
|
108
|
+
|
|
106
109
|
### VALIDATION_ERROR
|
|
107
110
|
|
|
108
111
|
**Message:** Parameter validation failed
|
|
109
112
|
**Description:** One or more required parameters are missing or invalid
|
|
110
113
|
**Resolution:** Review the required parameters and their formats
|
|
111
114
|
|
|
115
|
+
|
|
112
116
|
### NOT_FOUND
|
|
113
117
|
|
|
114
118
|
**Message:** Resource not found
|
|
115
119
|
**Description:** The requested resource does not exist
|
|
116
120
|
**Resolution:** Verify the resource ID and ensure it exists
|
|
117
121
|
|
|
122
|
+
|
|
118
123
|
### PERMISSION_DENIED
|
|
119
124
|
|
|
120
125
|
**Message:** Insufficient permissions
|
|
121
126
|
**Description:** The user does not have permission to perform this action
|
|
122
127
|
**Resolution:** Contact an administrator to grant the necessary permissions
|
|
123
128
|
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
124
132
|
---
|
|
125
133
|
|
|
126
134
|
*Generated automatically from tool definitions - Do not edit manually*
|
|
@@ -22,13 +22,11 @@ Uploads a file to the WordPress media library.
|
|
|
22
22
|
Simple example of using wp_upload_media
|
|
23
23
|
|
|
24
24
|
**Command:**
|
|
25
|
-
|
|
26
25
|
```bash
|
|
27
26
|
wp_upload_media --file_path="example_value"
|
|
28
27
|
```
|
|
29
28
|
|
|
30
29
|
**Response:**
|
|
31
|
-
|
|
32
30
|
```json
|
|
33
31
|
{
|
|
34
32
|
"success": true,
|
|
@@ -38,7 +36,6 @@ wp_upload_media --file_path="example_value"
|
|
|
38
36
|
```
|
|
39
37
|
|
|
40
38
|
**Error Example (Authentication failure):**
|
|
41
|
-
|
|
42
39
|
```json
|
|
43
40
|
{
|
|
44
41
|
"error": "Authentication failed",
|
|
@@ -46,18 +43,17 @@ wp_upload_media --file_path="example_value"
|
|
|
46
43
|
}
|
|
47
44
|
```
|
|
48
45
|
|
|
46
|
+
|
|
49
47
|
### Advanced media Configuration
|
|
50
48
|
|
|
51
49
|
Comprehensive example using all available parameters
|
|
52
50
|
|
|
53
51
|
**Command:**
|
|
54
|
-
|
|
55
52
|
```bash
|
|
56
53
|
wp_upload_media --file_path="example_value" --title="Example Post Title" --alt_text="example_value" --caption="example_value" --description="example_value" --post="example_value"
|
|
57
54
|
```
|
|
58
55
|
|
|
59
56
|
**Response:**
|
|
60
|
-
|
|
61
57
|
```json
|
|
62
58
|
{
|
|
63
59
|
"success": true,
|
|
@@ -66,6 +62,11 @@ wp_upload_media --file_path="example_value" --title="Example Post Title" --alt_t
|
|
|
66
62
|
}
|
|
67
63
|
```
|
|
68
64
|
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
69
70
|
## Required Permissions
|
|
70
71
|
|
|
71
72
|
This tool requires the following WordPress user capabilities:
|
|
@@ -74,6 +75,7 @@ This tool requires the following WordPress user capabilities:
|
|
|
74
75
|
|
|
75
76
|
**Note:** The authenticated user must have these capabilities to successfully execute this tool.
|
|
76
77
|
|
|
78
|
+
|
|
77
79
|
## Response Format
|
|
78
80
|
|
|
79
81
|
**Return Type:** `object`
|
|
@@ -100,24 +102,30 @@ This tool requires the following WordPress user capabilities:
|
|
|
100
102
|
**Description:** Invalid credentials or insufficient permissions
|
|
101
103
|
**Resolution:** Check your authentication credentials and user permissions
|
|
102
104
|
|
|
105
|
+
|
|
103
106
|
### VALIDATION_ERROR
|
|
104
107
|
|
|
105
108
|
**Message:** Parameter validation failed
|
|
106
109
|
**Description:** One or more required parameters are missing or invalid
|
|
107
110
|
**Resolution:** Review the required parameters and their formats
|
|
108
111
|
|
|
112
|
+
|
|
109
113
|
### NOT_FOUND
|
|
110
114
|
|
|
111
115
|
**Message:** Resource not found
|
|
112
116
|
**Description:** The requested resource does not exist
|
|
113
117
|
**Resolution:** Verify the resource ID and ensure it exists
|
|
114
118
|
|
|
119
|
+
|
|
115
120
|
### PERMISSION_DENIED
|
|
116
121
|
|
|
117
122
|
**Message:** Insufficient permissions
|
|
118
123
|
**Description:** The user does not have permission to perform this action
|
|
119
124
|
**Resolution:** Contact an administrator to grant the necessary permissions
|
|
120
125
|
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
121
129
|
---
|
|
122
130
|
|
|
123
131
|
*Generated automatically from tool definitions - Do not edit manually*
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Code Improvements TODO
|
|
2
|
+
|
|
3
|
+
## Test Coverage Improvements Needed
|
|
4
|
+
|
|
5
|
+
Based on coverage analysis, the following areas need attention:
|
|
6
|
+
|
|
7
|
+
### Critical Areas (0% coverage)
|
|
8
|
+
|
|
9
|
+
1. **Tool Implementations** (`src/tools/`):
|
|
10
|
+
- site.ts (0% coverage)
|
|
11
|
+
- taxonomies.ts (0% coverage)
|
|
12
|
+
- users.ts (0% coverage)
|
|
13
|
+
- media.ts (0.78% coverage)
|
|
14
|
+
- posts.ts (0.58% coverage)
|
|
15
|
+
|
|
16
|
+
2. **Utility Functions** (`src/utils/`):
|
|
17
|
+
- enhancedError.ts (0% coverage)
|
|
18
|
+
- error.ts (0% coverage)
|
|
19
|
+
- streaming.ts (0% coverage)
|
|
20
|
+
- toolWrapper.ts (3.12% coverage)
|
|
21
|
+
- validation.ts (2.56% coverage)
|
|
22
|
+
|
|
23
|
+
### Recommendations
|
|
24
|
+
|
|
25
|
+
1. Add unit tests for all tool implementations
|
|
26
|
+
2. Create test cases for error handling utilities
|
|
27
|
+
3. Test streaming functionality with mock data
|
|
28
|
+
4. Improve validation test coverage
|
|
29
|
+
|
|
30
|
+
## Performance Optimizations
|
|
31
|
+
|
|
32
|
+
1. Consider lazy loading for tool implementations
|
|
33
|
+
2. Implement connection pooling for multi-site setups
|
|
34
|
+
3. Add request batching for bulk operations
|
|
35
|
+
|
|
36
|
+
## Documentation Improvements
|
|
37
|
+
|
|
38
|
+
1. Add API documentation for each tool
|
|
39
|
+
2. Create troubleshooting guide
|
|
40
|
+
3. Add performance tuning guide
|
package/docs/contract-testing.md
CHANGED
|
@@ -55,18 +55,9 @@ Handles multiple WordPress authentication methods.
|
|
|
55
55
|
```typescript
|
|
56
56
|
class AuthenticationManager {
|
|
57
57
|
// Authentication methods
|
|
58
|
-
async authenticateWithAppPassword(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
): Promise<AuthResult>;
|
|
62
|
-
async authenticateWithJWT(
|
|
63
|
-
username: string,
|
|
64
|
-
password: string,
|
|
65
|
-
): Promise<AuthResult>;
|
|
66
|
-
async authenticateWithBasic(
|
|
67
|
-
username: string,
|
|
68
|
-
password: string,
|
|
69
|
-
): Promise<AuthResult>;
|
|
58
|
+
async authenticateWithAppPassword(username: string, password: string): Promise<AuthResult>;
|
|
59
|
+
async authenticateWithJWT(username: string, password: string): Promise<AuthResult>;
|
|
60
|
+
async authenticateWithBasic(username: string, password: string): Promise<AuthResult>;
|
|
70
61
|
async authenticateWithApiKey(apiKey: string): Promise<AuthResult>;
|
|
71
62
|
|
|
72
63
|
// Token management
|
|
@@ -119,9 +110,7 @@ class PostTools {
|
|
|
119
110
|
async deletePost(params: DeletePostParams): Promise<DeleteResult>;
|
|
120
111
|
async getPost(params: GetPostParams): Promise<PostResult>;
|
|
121
112
|
async listPosts(params: ListPostsParams): Promise<PostListResult>;
|
|
122
|
-
async getPostRevisions(
|
|
123
|
-
params: GetPostRevisionsParams,
|
|
124
|
-
): Promise<PostRevisionsResult>;
|
|
113
|
+
async getPostRevisions(params: GetPostRevisionsParams): Promise<PostRevisionsResult>;
|
|
125
114
|
}
|
|
126
115
|
```
|
|
127
116
|
|
|
@@ -168,9 +157,7 @@ class PageTools {
|
|
|
168
157
|
async deletePage(params: DeletePageParams): Promise<DeleteResult>;
|
|
169
158
|
async getPage(params: GetPageParams): Promise<PageResult>;
|
|
170
159
|
async listPages(params: ListPagesParams): Promise<PageListResult>;
|
|
171
|
-
async getPageRevisions(
|
|
172
|
-
params: GetPageRevisionsParams,
|
|
173
|
-
): Promise<PageRevisionsResult>;
|
|
160
|
+
async getPageRevisions(params: GetPageRevisionsParams): Promise<PageRevisionsResult>;
|
|
174
161
|
}
|
|
175
162
|
```
|
|
176
163
|
|
|
@@ -224,9 +211,7 @@ class CommentTools {
|
|
|
224
211
|
async getComment(params: GetCommentParams): Promise<CommentResult>;
|
|
225
212
|
async listComments(params: ListCommentsParams): Promise<CommentListResult>;
|
|
226
213
|
async moderateComment(params: ModerateCommentParams): Promise<CommentResult>;
|
|
227
|
-
async bulkModerateComments(
|
|
228
|
-
params: BulkModerateCommentsParams,
|
|
229
|
-
): Promise<BulkResult>;
|
|
214
|
+
async bulkModerateComments(params: BulkModerateCommentsParams): Promise<BulkResult>;
|
|
230
215
|
}
|
|
231
216
|
```
|
|
232
217
|
|
|
@@ -239,9 +224,7 @@ class TaxonomyTools {
|
|
|
239
224
|
async updateCategory(params: UpdateCategoryParams): Promise<CategoryResult>;
|
|
240
225
|
async deleteCategory(params: DeleteCategoryParams): Promise<DeleteResult>;
|
|
241
226
|
async getCategory(params: GetCategoryParams): Promise<CategoryResult>;
|
|
242
|
-
async listCategories(
|
|
243
|
-
params: ListCategoriesParams,
|
|
244
|
-
): Promise<CategoryListResult>;
|
|
227
|
+
async listCategories(params: ListCategoriesParams): Promise<CategoryListResult>;
|
|
245
228
|
|
|
246
229
|
// Tags
|
|
247
230
|
async createTag(params: CreateTagParams): Promise<TagResult>;
|
|
@@ -257,9 +240,7 @@ class TaxonomyTools {
|
|
|
257
240
|
```typescript
|
|
258
241
|
class SiteTools {
|
|
259
242
|
async getSiteInfo(params: GetSiteInfoParams): Promise<SiteInfoResult>;
|
|
260
|
-
async updateSiteSettings(
|
|
261
|
-
params: UpdateSiteSettingsParams,
|
|
262
|
-
): Promise<SiteSettingsResult>;
|
|
243
|
+
async updateSiteSettings(params: UpdateSiteSettingsParams): Promise<SiteSettingsResult>;
|
|
263
244
|
async getSiteStats(params: GetSiteStatsParams): Promise<SiteStatsResult>;
|
|
264
245
|
async getPlugins(params: GetPluginsParams): Promise<PluginsResult>;
|
|
265
246
|
async getThemes(params: GetThemesParams): Promise<ThemesResult>;
|
|
@@ -273,9 +254,7 @@ class SiteTools {
|
|
|
273
254
|
class AuthTools {
|
|
274
255
|
async testAuth(params: TestAuthParams): Promise<AuthTestResult>;
|
|
275
256
|
async refreshToken(params: RefreshTokenParams): Promise<TokenResult>;
|
|
276
|
-
async validatePermissions(
|
|
277
|
-
params: ValidatePermissionsParams,
|
|
278
|
-
): Promise<PermissionsResult>;
|
|
257
|
+
async validatePermissions(params: ValidatePermissionsParams): Promise<PermissionsResult>;
|
|
279
258
|
}
|
|
280
259
|
```
|
|
281
260
|
|
|
@@ -286,9 +265,7 @@ class CacheTools {
|
|
|
286
265
|
async getCacheStats(params: GetCacheStatsParams): Promise<CacheStatsResult>;
|
|
287
266
|
async clearCache(params: ClearCacheParams): Promise<ClearCacheResult>;
|
|
288
267
|
async warmCache(params: WarmCacheParams): Promise<WarmCacheResult>;
|
|
289
|
-
async setCacheConfig(
|
|
290
|
-
params: SetCacheConfigParams,
|
|
291
|
-
): Promise<CacheConfigResult>;
|
|
268
|
+
async setCacheConfig(params: SetCacheConfigParams): Promise<CacheConfigResult>;
|
|
292
269
|
}
|
|
293
270
|
```
|
|
294
271
|
|
|
@@ -296,24 +273,12 @@ class CacheTools {
|
|
|
296
273
|
|
|
297
274
|
```typescript
|
|
298
275
|
class PerformanceTools {
|
|
299
|
-
async getPerformanceMetrics(
|
|
300
|
-
|
|
301
|
-
): Promise<
|
|
302
|
-
async
|
|
303
|
-
|
|
304
|
-
): Promise<
|
|
305
|
-
async getSystemHealth(
|
|
306
|
-
params: GetSystemHealthParams,
|
|
307
|
-
): Promise<SystemHealthResult>;
|
|
308
|
-
async benchmarkOperations(
|
|
309
|
-
params: BenchmarkOperationsParams,
|
|
310
|
-
): Promise<BenchmarkResult>;
|
|
311
|
-
async getOptimizationSuggestions(
|
|
312
|
-
params: GetOptimizationSuggestionsParams,
|
|
313
|
-
): Promise<OptimizationResult>;
|
|
314
|
-
async monitorRealTimeMetrics(
|
|
315
|
-
params: MonitorRealTimeMetricsParams,
|
|
316
|
-
): Promise<RealTimeMetricsResult>;
|
|
276
|
+
async getPerformanceMetrics(params: GetPerformanceMetricsParams): Promise<PerformanceMetricsResult>;
|
|
277
|
+
async runPerformanceTest(params: RunPerformanceTestParams): Promise<PerformanceTestResult>;
|
|
278
|
+
async getSystemHealth(params: GetSystemHealthParams): Promise<SystemHealthResult>;
|
|
279
|
+
async benchmarkOperations(params: BenchmarkOperationsParams): Promise<BenchmarkResult>;
|
|
280
|
+
async getOptimizationSuggestions(params: GetOptimizationSuggestionsParams): Promise<OptimizationResult>;
|
|
281
|
+
async monitorRealTimeMetrics(params: MonitorRealTimeMetricsParams): Promise<RealTimeMetricsResult>;
|
|
317
282
|
}
|
|
318
283
|
```
|
|
319
284
|
|
|
@@ -573,12 +538,7 @@ class DebugLogger {
|
|
|
573
538
|
static log(level: LogLevel, message: string, context?: any): void;
|
|
574
539
|
static error(error: Error, context?: any): void;
|
|
575
540
|
static performance(operation: string, duration: number): void;
|
|
576
|
-
static http(
|
|
577
|
-
method: string,
|
|
578
|
-
url: string,
|
|
579
|
-
status: number,
|
|
580
|
-
duration: number,
|
|
581
|
-
): void;
|
|
541
|
+
static http(method: string, url: string, status: number, duration: number): void;
|
|
582
542
|
}
|
|
583
543
|
```
|
|
584
544
|
|
|
@@ -664,5 +624,5 @@ const server = new MCPWordPressServer({
|
|
|
664
624
|
|
|
665
625
|
---
|
|
666
626
|
|
|
667
|
-
**Need more details?** This API reference covers the complete technical interface. For implementation
|
|
668
|
-
|
|
627
|
+
**Need more details?** This API reference covers the complete technical interface. For implementation examples, see the
|
|
628
|
+
source code in `src/` directory.
|
|
@@ -4,7 +4,8 @@ This guide explains the system architecture and design patterns used in the MCP
|
|
|
4
4
|
|
|
5
5
|
## 🏗️ Overall Architecture
|
|
6
6
|
|
|
7
|
-
The MCP WordPress Server follows a modular, layered architecture designed for scalability, maintainability, and
|
|
7
|
+
The MCP WordPress Server follows a modular, layered architecture designed for scalability, maintainability, and
|
|
8
|
+
extensibility.
|
|
8
9
|
|
|
9
10
|
```text
|
|
10
11
|
┌─────────────────────────────────────────────────────────────┐
|
|
@@ -309,10 +310,8 @@ Commit → CI/CD Pipeline → Tests → Security Scan → Publishing
|
|
|
309
310
|
|
|
310
311
|
### Request Optimization
|
|
311
312
|
|
|
312
|
-
**Batching**: Group related requests
|
|
313
|
-
**
|
|
314
|
-
**Connection Pooling**: Reuse HTTP connections
|
|
315
|
-
**Compression**: Reduce payload size
|
|
313
|
+
**Batching**: Group related requests **Deduplication**: Eliminate duplicate requests **Connection Pooling**: Reuse HTTP
|
|
314
|
+
connections **Compression**: Reduce payload size
|
|
316
315
|
|
|
317
316
|
## 🔮 Extensibility
|
|
318
317
|
|
|
@@ -356,10 +355,8 @@ Commit → CI/CD Pipeline → Tests → Security Scan → Publishing
|
|
|
356
355
|
|
|
357
356
|
### Logging Strategy
|
|
358
357
|
|
|
359
|
-
**Structured Logging**: JSON format for parsing
|
|
360
|
-
**
|
|
361
|
-
**Contextual Information**: Request IDs, user context
|
|
362
|
-
**Security Logging**: Authentication events, suspicious activity
|
|
358
|
+
**Structured Logging**: JSON format for parsing **Log Levels**: DEBUG, INFO, WARN, ERROR **Contextual Information**:
|
|
359
|
+
Request IDs, user context **Security Logging**: Authentication events, suspicious activity
|
|
363
360
|
|
|
364
361
|
## 📚 Further Reading
|
|
365
362
|
|
|
@@ -370,5 +367,5 @@ Commit → CI/CD Pipeline → Tests → Security Scan → Publishing
|
|
|
370
367
|
|
|
371
368
|
---
|
|
372
369
|
|
|
373
|
-
**Understanding the architecture?** This foundation enables the system's reliability, performance,
|
|
374
|
-
|
|
370
|
+
**Understanding the architecture?** This foundation enables the system's reliability, performance, and extensibility.
|
|
371
|
+
Each component is designed to be testable, maintainable, and scalable.
|
|
@@ -456,5 +456,5 @@ npm install -g webpack-bundle-analyzer
|
|
|
456
456
|
|
|
457
457
|
---
|
|
458
458
|
|
|
459
|
-
**Optimizing your build?** This build system is designed for both development speed and
|
|
460
|
-
|
|
459
|
+
**Optimizing your build?** This build system is designed for both development speed and production efficiency. Each
|
|
460
|
+
configuration option is tuned for optimal performance.
|
|
@@ -215,9 +215,7 @@ describe("PostTools", () => {
|
|
|
215
215
|
test("should handle API errors gracefully", async () => {
|
|
216
216
|
mockClient.posts.create.mockRejectedValue(new Error("API Error"));
|
|
217
217
|
|
|
218
|
-
await expect(postTools.createPost(validParams)).rejects.toThrow(
|
|
219
|
-
"API Error",
|
|
220
|
-
);
|
|
218
|
+
await expect(postTools.createPost(validParams)).rejects.toThrow("API Error");
|
|
221
219
|
});
|
|
222
220
|
});
|
|
223
221
|
});
|
|
@@ -465,5 +463,5 @@ Please read it to understand the expected behavior in our community.
|
|
|
465
463
|
|
|
466
464
|
---
|
|
467
465
|
|
|
468
|
-
**Ready to contribute?** Thank you for your interest in improving the MCP WordPress Server! Every
|
|
469
|
-
|
|
466
|
+
**Ready to contribute?** Thank you for your interest in improving the MCP WordPress Server! Every contribution, no
|
|
467
|
+
matter how small, helps make this project better for everyone. 🚀
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
The MCP WordPress project includes comprehensive GitHub Actions workflows for automated testing, quality
|
|
6
|
-
|
|
5
|
+
The MCP WordPress project includes comprehensive GitHub Actions workflows for automated testing, quality assurance, and
|
|
6
|
+
NPM publishing.
|
|
7
7
|
|
|
8
8
|
## Workflows
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Migration Guide: Single-Site to Multi-Site Configuration
|
|
2
2
|
|
|
3
|
-
This guide helps you migrate from the previous single-site configuration to the new multi-site
|
|
4
|
-
|
|
3
|
+
This guide helps you migrate from the previous single-site configuration to the new multi-site configuration introduced
|
|
4
|
+
in v2.0.0.
|
|
5
5
|
|
|
6
6
|
## Breaking Changes
|
|
7
7
|
|
|
@@ -15,8 +15,7 @@ WORDPRESS_USERNAME=admin
|
|
|
15
15
|
WORDPRESS_APP_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
**New Method (Configuration File):**
|
|
19
|
-
Create a `mcp-wordpress.config.json` file:
|
|
18
|
+
**New Method (Configuration File):** Create a `mcp-wordpress.config.json` file:
|
|
20
19
|
|
|
21
20
|
```json
|
|
22
21
|
{
|
|
@@ -162,8 +161,8 @@ wp_create_post --site="site2" --title="New Blog Post"
|
|
|
162
161
|
|
|
163
162
|
## Backward Compatibility
|
|
164
163
|
|
|
165
|
-
The server maintains backward compatibility with environment variables. If no `mcp-wordpress.config.json`
|
|
166
|
-
|
|
164
|
+
The server maintains backward compatibility with environment variables. If no `mcp-wordpress.config.json` file is found,
|
|
165
|
+
it will fall back to using environment variables as before.
|
|
167
166
|
|
|
168
167
|
## Troubleshooting
|
|
169
168
|
|
package/docs/developer/README.md
CHANGED
|
@@ -239,4 +239,5 @@ npm run status # Check connection status
|
|
|
239
239
|
|
|
240
240
|
---
|
|
241
241
|
|
|
242
|
-
**Ready to contribute?** Start with the [Development Setup](DEVELOPMENT_SETUP.md) guide and join our community of
|
|
242
|
+
**Ready to contribute?** Start with the [Development Setup](DEVELOPMENT_SETUP.md) guide and join our community of
|
|
243
|
+
contributors!
|