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.
Files changed (190) hide show
  1. package/README.md +332 -61
  2. package/dist/cache/CacheInvalidation.d.ts.map +1 -1
  3. package/dist/cache/CacheInvalidation.js +4 -4
  4. package/dist/cache/CacheInvalidation.js.map +1 -1
  5. package/dist/client/MockWordPressClient.d.ts +55 -0
  6. package/dist/client/MockWordPressClient.d.ts.map +1 -0
  7. package/dist/client/MockWordPressClient.js +369 -0
  8. package/dist/client/MockWordPressClient.js.map +1 -0
  9. package/dist/client/api.d.ts +1 -0
  10. package/dist/client/api.d.ts.map +1 -1
  11. package/dist/client/api.js +26 -60
  12. package/dist/client/api.js.map +1 -1
  13. package/dist/client/managers/AuthenticationManager.d.ts.map +1 -1
  14. package/dist/client/managers/AuthenticationManager.js +4 -3
  15. package/dist/client/managers/AuthenticationManager.js.map +1 -1
  16. package/dist/config/ConfigurationSchema.d.ts +3 -3
  17. package/dist/config/ConfigurationSchema.d.ts.map +1 -1
  18. package/dist/config/ConfigurationSchema.js +7 -24
  19. package/dist/config/ConfigurationSchema.js.map +1 -1
  20. package/dist/config/ServerConfiguration.d.ts +8 -0
  21. package/dist/config/ServerConfiguration.d.ts.map +1 -1
  22. package/dist/config/ServerConfiguration.js +80 -31
  23. package/dist/config/ServerConfiguration.js.map +1 -1
  24. package/dist/docs/DocumentationGenerator.d.ts.map +1 -1
  25. package/dist/docs/DocumentationGenerator.js +5 -7
  26. package/dist/docs/DocumentationGenerator.js.map +1 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +33 -29
  29. package/dist/index.js.map +1 -1
  30. package/dist/security/InputValidator.d.ts.map +1 -1
  31. package/dist/security/InputValidator.js +3 -11
  32. package/dist/security/InputValidator.js.map +1 -1
  33. package/dist/server/ToolRegistry.d.ts +4 -0
  34. package/dist/server/ToolRegistry.d.ts.map +1 -1
  35. package/dist/server/ToolRegistry.js +71 -8
  36. package/dist/server/ToolRegistry.js.map +1 -1
  37. package/dist/tools/auth.d.ts.map +1 -1
  38. package/dist/tools/auth.js +8 -3
  39. package/dist/tools/auth.js.map +1 -1
  40. package/dist/tools/posts.d.ts.map +1 -1
  41. package/dist/tools/posts.js +287 -20
  42. package/dist/tools/posts.js.map +1 -1
  43. package/dist/tools/site.d.ts.map +1 -1
  44. package/dist/tools/site.js +47 -9
  45. package/dist/tools/site.js.map +1 -1
  46. package/dist/tools/users.d.ts.map +1 -1
  47. package/dist/tools/users.js +113 -10
  48. package/dist/tools/users.js.map +1 -1
  49. package/dist/utils/enhancedError.d.ts +61 -0
  50. package/dist/utils/enhancedError.d.ts.map +1 -0
  51. package/dist/utils/enhancedError.js +221 -0
  52. package/dist/utils/enhancedError.js.map +1 -0
  53. package/dist/utils/streaming.d.ts +104 -0
  54. package/dist/utils/streaming.d.ts.map +1 -0
  55. package/dist/utils/streaming.js +312 -0
  56. package/dist/utils/streaming.js.map +1 -0
  57. package/dist/utils/validation.d.ts +19 -3
  58. package/dist/utils/validation.d.ts.map +1 -1
  59. package/dist/utils/validation.js +174 -24
  60. package/dist/utils/validation.js.map +1 -1
  61. package/docs/ARCHITECTURE.md +850 -0
  62. package/docs/CACHING.md +20 -17
  63. package/docs/CONFIGURATION.md +660 -0
  64. package/docs/DOCKER.md +61 -60
  65. package/docs/EVALUATION.md +397 -0
  66. package/docs/INSTALLATION.md +423 -0
  67. package/docs/PERFORMANCE_MONITORING.md +17 -15
  68. package/docs/SECURITY.md +621 -0
  69. package/docs/SECURITY_TESTING.md +22 -26
  70. package/docs/TEST_SITE_SETUP.md +136 -0
  71. package/docs/TROUBLESHOOTING.md +578 -0
  72. package/docs/api/README.md +76 -91
  73. package/docs/api/categories/auth.md +0 -2
  74. package/docs/api/categories/cache.md +0 -2
  75. package/docs/api/categories/comment.md +0 -2
  76. package/docs/api/categories/media.md +0 -2
  77. package/docs/api/categories/page.md +0 -2
  78. package/docs/api/categories/performance.md +0 -2
  79. package/docs/api/categories/post.md +0 -2
  80. package/docs/api/categories/site.md +0 -2
  81. package/docs/api/categories/taxonomy.md +0 -2
  82. package/docs/api/categories/user.md +0 -2
  83. package/docs/api/summary.json +1 -1
  84. package/docs/api/tools/wp_approve_comment.md +11 -3
  85. package/docs/api/tools/wp_cache_clear.md +14 -5
  86. package/docs/api/tools/wp_cache_info.md +14 -5
  87. package/docs/api/tools/wp_cache_stats.md +14 -5
  88. package/docs/api/tools/wp_cache_warm.md +14 -5
  89. package/docs/api/tools/wp_create_application_password.md +11 -3
  90. package/docs/api/tools/wp_create_category.md +11 -3
  91. package/docs/api/tools/wp_create_comment.md +14 -5
  92. package/docs/api/tools/wp_create_page.md +13 -5
  93. package/docs/api/tools/wp_create_post.md +14 -7
  94. package/docs/api/tools/wp_create_tag.md +11 -3
  95. package/docs/api/tools/wp_create_user.md +13 -5
  96. package/docs/api/tools/wp_delete_application_password.md +11 -3
  97. package/docs/api/tools/wp_delete_category.md +11 -3
  98. package/docs/api/tools/wp_delete_comment.md +11 -3
  99. package/docs/api/tools/wp_delete_media.md +10 -3
  100. package/docs/api/tools/wp_delete_page.md +10 -3
  101. package/docs/api/tools/wp_delete_post.md +11 -5
  102. package/docs/api/tools/wp_delete_tag.md +11 -3
  103. package/docs/api/tools/wp_delete_user.md +10 -3
  104. package/docs/api/tools/wp_get_application_passwords.md +11 -3
  105. package/docs/api/tools/wp_get_auth_status.md +11 -3
  106. package/docs/api/tools/wp_get_category.md +11 -3
  107. package/docs/api/tools/wp_get_comment.md +11 -3
  108. package/docs/api/tools/wp_get_current_user.md +11 -3
  109. package/docs/api/tools/wp_get_media.md +11 -3
  110. package/docs/api/tools/wp_get_page.md +11 -3
  111. package/docs/api/tools/wp_get_page_revisions.md +11 -3
  112. package/docs/api/tools/wp_get_post.md +12 -5
  113. package/docs/api/tools/wp_get_post_revisions.md +11 -3
  114. package/docs/api/tools/wp_get_site_settings.md +10 -3
  115. package/docs/api/tools/wp_get_tag.md +11 -3
  116. package/docs/api/tools/wp_get_user.md +11 -3
  117. package/docs/api/tools/wp_list_categories.md +11 -3
  118. package/docs/api/tools/wp_list_comments.md +11 -3
  119. package/docs/api/tools/wp_list_media.md +14 -5
  120. package/docs/api/tools/wp_list_pages.md +14 -5
  121. package/docs/api/tools/wp_list_posts.md +15 -7
  122. package/docs/api/tools/wp_list_tags.md +11 -3
  123. package/docs/api/tools/wp_list_users.md +11 -3
  124. package/docs/api/tools/wp_performance_alerts.md +17 -7
  125. package/docs/api/tools/wp_performance_benchmark.md +17 -7
  126. package/docs/api/tools/wp_performance_export.md +17 -7
  127. package/docs/api/tools/wp_performance_history.md +17 -7
  128. package/docs/api/tools/wp_performance_optimize.md +17 -7
  129. package/docs/api/tools/wp_performance_stats.md +17 -7
  130. package/docs/api/tools/wp_search_site.md +11 -3
  131. package/docs/api/tools/wp_spam_comment.md +11 -3
  132. package/docs/api/tools/wp_switch_auth_method.md +14 -5
  133. package/docs/api/tools/wp_test_auth.md +11 -3
  134. package/docs/api/tools/wp_update_category.md +11 -3
  135. package/docs/api/tools/wp_update_comment.md +14 -5
  136. package/docs/api/tools/wp_update_media.md +14 -5
  137. package/docs/api/tools/wp_update_page.md +13 -5
  138. package/docs/api/tools/wp_update_post.md +14 -7
  139. package/docs/api/tools/wp_update_site_settings.md +14 -5
  140. package/docs/api/tools/wp_update_tag.md +11 -3
  141. package/docs/api/tools/wp_update_user.md +13 -5
  142. package/docs/api/tools/wp_upload_media.md +13 -5
  143. package/docs/api/types/WordPressPost.md +2 -0
  144. package/docs/code-improvements.md +40 -0
  145. package/docs/contract-testing.md +1 -1
  146. package/docs/developer/API_REFERENCE.md +19 -59
  147. package/docs/developer/ARCHITECTURE.md +8 -11
  148. package/docs/developer/BUILD_SYSTEM.md +2 -2
  149. package/docs/developer/CONTRIBUTING.md +3 -5
  150. package/docs/developer/GITHUB_ACTIONS_SETUP.md +2 -2
  151. package/docs/developer/MIGRATION_GUIDE.md +5 -6
  152. package/docs/developer/README.md +2 -1
  153. package/docs/developer/REFACTORING.md +9 -15
  154. package/docs/developer/RELEASE_PROCESS.md +4 -3
  155. package/docs/developer/TESTING.md +2 -2
  156. package/docs/examples/claude-desktop-config.md +8 -0
  157. package/docs/integrations/claude-desktop.md +426 -0
  158. package/docs/integrations/cline.md +537 -0
  159. package/docs/integrations/vs-code.md +515 -0
  160. package/docs/releases/COMMUNITY_ANNOUNCEMENT_v1.1.2.md +30 -23
  161. package/docs/releases/RELEASE_NOTES_v1.1.2.md +7 -6
  162. package/docs/testing-configurations.md +11 -0
  163. package/docs/user-guides/DOCKER_NPM_DTX_SETUP.md +3 -2
  164. package/docs/user-guides/DOCKER_SETUP.md +3 -2
  165. package/docs/user-guides/DTX_SETUP.md +6 -5
  166. package/docs/user-guides/DXT_INSTALLATION.md +4 -4
  167. package/docs/user-guides/NPM_SETUP.md +4 -2
  168. package/docs/user-guides/NPX_SETUP.md +4 -2
  169. package/docs/user-guides/SMITHERY_SETUP.md +402 -0
  170. package/docs/wordpress-rest-api-authentication-troubleshooting.md +45 -42
  171. package/package.json +12 -2
  172. package/src/cache/CacheInvalidation.ts +7 -18
  173. package/src/client/MockWordPressClient.ts +398 -0
  174. package/src/client/api.ts +77 -237
  175. package/src/client/managers/AuthenticationManager.ts +19 -56
  176. package/src/config/ConfigurationSchema.ts +14 -45
  177. package/src/config/ServerConfiguration.ts +98 -71
  178. package/src/docs/DocumentationGenerator.ts +39 -123
  179. package/src/dxt-entry.cjs +4 -1
  180. package/src/index.ts +35 -54
  181. package/src/security/InputValidator.ts +15 -57
  182. package/src/server/ToolRegistry.ts +88 -17
  183. package/src/tools/auth.ts +15 -22
  184. package/src/tools/posts.ts +347 -64
  185. package/src/tools/site.ts +69 -46
  186. package/src/tools/users.ts +142 -44
  187. package/src/utils/enhancedError.ts +248 -0
  188. package/src/utils/streaming.ts +428 -0
  189. package/src/utils/validation.ts +253 -92
  190. package/dist/mcp-wordpress-1.5.2.tgz +0 -0
@@ -0,0 +1,578 @@
1
+ # Troubleshooting Guide
2
+
3
+ Comprehensive troubleshooting guide for common issues with MCP WordPress Server.
4
+
5
+ ## 🔍 Quick Diagnosis
6
+
7
+ ### Health Check Commands
8
+
9
+ Before diving into specific issues, run these diagnostic commands:
10
+
11
+ ```bash
12
+ # Overall system health
13
+ npm run health
14
+
15
+ # Connection status
16
+ npm run status
17
+
18
+ # Test authentication
19
+ npm run test:auth
20
+
21
+ # Quick tool validation
22
+ npm run test:tools
23
+
24
+ # Performance check
25
+ npm run test:performance
26
+ ```
27
+
28
+ ### Common Issue Categories
29
+
30
+ | Issue Type | Symptoms | Quick Fix |
31
+ |------------|----------|-----------|
32
+ | **[Connection](#-connection-issues)** | Can't reach WordPress | Check URL and network |
33
+ | **[Authentication](#-authentication-issues)** | Login failures | Verify credentials |
34
+ | **[Tools](#️-tool-issues)** | Commands not working | Check permissions |
35
+ | **[Performance](#-performance-issues)** | Slow responses | Enable caching |
36
+ | **[Claude Desktop](#️-claude-desktop-issues)** | Not appearing in Claude | Restart and reconfigure |
37
+
38
+ ## 🌐 Connection Issues
39
+
40
+ ### Issue: "Cannot connect to WordPress"
41
+
42
+ **Symptoms:**
43
+ - Connection timeout errors
44
+ - "Site not reachable" messages
45
+ - Network-related failures
46
+
47
+ **Diagnosis:**
48
+ ```bash
49
+ # Test WordPress REST API manually
50
+ curl -i https://your-site.com/wp-json/wp/v2/
51
+
52
+ # Should return HTTP 200 with JSON data
53
+ # If not, WordPress REST API may be disabled
54
+ ```
55
+
56
+ **Solutions:**
57
+
58
+ 1. **Verify WordPress URL Format**
59
+ ```bash
60
+ # ✅ Correct formats
61
+ https://yoursite.com
62
+ https://www.yoursite.com
63
+ https://blog.yoursite.com
64
+
65
+ # ❌ Incorrect formats
66
+ yoursite.com # Missing protocol
67
+ https://yoursite.com/ # Trailing slash
68
+ ```
69
+
70
+ 2. **Check WordPress REST API**
71
+ - Go to **Settings** → **Permalinks** in WordPress admin
72
+ - Click "Save Changes" to refresh rewrite rules
73
+ - Verify REST API is not disabled by plugins
74
+
75
+ 3. **Network and Firewall**
76
+ ```bash
77
+ # Test connectivity
78
+ ping yoursite.com
79
+
80
+ # Test HTTPS
81
+ curl -I https://yoursite.com
82
+
83
+ # Test specific port if needed
84
+ telnet yoursite.com 443
85
+ ```
86
+
87
+ 4. **WordPress Configuration**
88
+ ```php
89
+ // In wp-config.php, ensure REST API is enabled
90
+ // Remove or comment out if present:
91
+ // add_filter('rest_enabled', '__return_false');
92
+ ```
93
+
94
+ ### Issue: "SSL Certificate Error"
95
+
96
+ **Symptoms:**
97
+ - SSL verification failures
98
+ - Certificate warnings
99
+
100
+ **Solutions:**
101
+ ```bash
102
+ # For development only - disable SSL verification
103
+ export NODE_TLS_REJECT_UNAUTHORIZED=0
104
+
105
+ # Better solution: Fix SSL certificate
106
+ # Contact your hosting provider or use Let's Encrypt
107
+ ```
108
+
109
+ ## 🔐 Authentication Issues
110
+
111
+ ### Issue: "Authentication failed"
112
+
113
+ **Symptoms:**
114
+ - 401 Unauthorized errors
115
+ - "Invalid credentials" messages
116
+ - Login repeatedly fails
117
+
118
+ **Diagnosis:**
119
+ ```bash
120
+ # Test authentication manually
121
+ curl -u "username:app-password" https://your-site.com/wp-json/wp/v2/users/me
122
+
123
+ # Should return user information
124
+ # If 401, credentials are wrong
125
+ ```
126
+
127
+ **Solutions:**
128
+
129
+ 1. **Application Password Format**
130
+ ```bash
131
+ # ✅ Correct format (with spaces)
132
+ WORDPRESS_APP_PASSWORD="AbCd EfGh IjKl MnOp QrSt UvWx"
133
+
134
+ # ❌ Incorrect formats
135
+ WORDPRESS_APP_PASSWORD=AbCdEfGhIjKlMnOpQrStUvWx # No spaces
136
+ WORDPRESS_APP_PASSWORD='AbCd EfGh...' # Single quotes
137
+ WORDPRESS_APP_PASSWORD="AbCd-EfGh-IjKl..." # Hyphens instead of spaces
138
+ ```
139
+
140
+ 2. **Regenerate Application Password**
141
+ - WordPress Admin → Users → Profile
142
+ - Delete old application password
143
+ - Create new one: "MCP WordPress Server"
144
+ - Copy the exact password shown (with spaces)
145
+
146
+ 3. **Check WordPress User Permissions**
147
+ ```text
148
+ # Minimum role requirements:
149
+ - Read operations: Subscriber
150
+ - Create/edit posts: Author
151
+ - Manage comments: Editor
152
+ - Site settings: Administrator
153
+ ```
154
+
155
+ 4. **Verify Application Passwords are Enabled**
156
+ ```php
157
+ // In functions.php or plugin
158
+ // Ensure this is NOT present:
159
+ // add_filter('wp_is_application_passwords_available', '__return_false');
160
+ ```
161
+
162
+ ### Issue: "Permission denied for operation"
163
+
164
+ **Symptoms:**
165
+ - Some tools work, others fail
166
+ - "Insufficient permissions" errors
167
+
168
+ **Solutions:**
169
+
170
+ 1. **Check User Role Requirements**
171
+ ```bash
172
+ # Test user capabilities
173
+ curl -u "username:app-password" \
174
+ https://your-site.com/wp-json/wp/v2/users/me | \
175
+ jq '.capabilities'
176
+ ```
177
+
178
+ 2. **Role-Based Access Matrix**
179
+ | Operation | Subscriber | Author | Editor | Admin |
180
+ |-----------|------------|--------|--------|-------|
181
+ | Read posts | ✅ | ✅ | ✅ | ✅ |
182
+ | Create posts | ❌ | ✅ | ✅ | ✅ |
183
+ | Edit others' posts | ❌ | ❌ | ✅ | ✅ |
184
+ | Manage users | ❌ | ❌ | ❌ | ✅ |
185
+ | Site settings | ❌ | ❌ | ❌ | ✅ |
186
+
187
+ ## 🛠️ Tool Issues
188
+
189
+ ### Issue: "Tool not found" or "Command failed"
190
+
191
+ **Symptoms:**
192
+ - Specific WordPress tools don't work
193
+ - "Unknown tool" errors
194
+ - Tools missing from Claude
195
+
196
+ **Diagnosis:**
197
+ ```bash
198
+ # List available tools
199
+ npm run test:tools
200
+
201
+ # Test specific tool
202
+ DEBUG=true npm run dev
203
+ # Then try the failing tool
204
+ ```
205
+
206
+ **Solutions:**
207
+
208
+ 1. **Verify Tool Registration**
209
+ ```bash
210
+ # Check all tools are loaded
211
+ npm run status | grep "tools available"
212
+ # Should show "59 tools available"
213
+ ```
214
+
215
+ 2. **Test Individual Tool Categories**
216
+ ```text
217
+ # In Claude, test each category:
218
+ "List my WordPress posts" # Posts tools
219
+ "Show my WordPress users" # User tools
220
+ "Check WordPress site settings" # Site tools
221
+ "Show cache statistics" # Cache tools
222
+ ```
223
+
224
+ 3. **Check Multi-Site Configuration**
225
+ ```bash
226
+ # If using multi-site, always specify site parameter
227
+ # ✅ Correct
228
+ wp_list_posts --site="main-site"
229
+
230
+ # ❌ Incorrect (will fail with multiple sites)
231
+ wp_list_posts
232
+ ```
233
+
234
+ ### Issue: "Invalid parameters" errors
235
+
236
+ **Symptoms:**
237
+ - Tools reject valid-looking parameters
238
+ - Type validation errors
239
+
240
+ **Solutions:**
241
+
242
+ 1. **Check Parameter Types**
243
+ ```text
244
+ # ✅ Correct parameter types
245
+ wp_create_post --title="My Post" --content="Content here"
246
+
247
+ # ❌ Incorrect (missing quotes for strings)
248
+ wp_create_post --title=My Post --content=Content here
249
+ ```
250
+
251
+ 2. **Required vs Optional Parameters**
252
+ ```bash
253
+ # Check tool documentation
254
+ # Each tool specifies required parameters
255
+ # See docs/api/tools/[tool-name].md
256
+ ```
257
+
258
+ ## ⚡ Performance Issues
259
+
260
+ ### Issue: Slow response times
261
+
262
+ **Symptoms:**
263
+ - Tools take a long time to respond
264
+ - Timeout errors
265
+ - Claude appears to hang
266
+
267
+ **Diagnosis:**
268
+ ```bash
269
+ # Check performance metrics
270
+ npm run test:performance
271
+
272
+ # Test with caching disabled
273
+ DISABLE_CACHE=true npm run dev
274
+
275
+ # Monitor cache statistics
276
+ npm run cache:stats
277
+ ```
278
+
279
+ **Solutions:**
280
+
281
+ 1. **Enable Caching**
282
+ ```bash
283
+ # Ensure caching is enabled (default)
284
+ # Remove this line if present:
285
+ # DISABLE_CACHE=true
286
+
287
+ # Check cache performance
288
+ npm run cache:stats
289
+ ```
290
+
291
+ 2. **WordPress Optimization**
292
+ - Install caching plugin (W3 Total Cache, WP Rocket)
293
+ - Optimize database and images
294
+ - Use CDN for media files
295
+ - Upgrade hosting if necessary
296
+
297
+ 3. **Network Optimization**
298
+ ```bash
299
+ # Test network latency
300
+ ping your-site.com
301
+
302
+ # Test WordPress response time
303
+ time curl -s https://your-site.com/wp-json/wp/v2/ > /dev/null
304
+ ```
305
+
306
+ ### Issue: Memory or CPU high usage
307
+
308
+ **Symptoms:**
309
+ - System becomes slow
310
+ - High resource usage
311
+ - Crashes or restarts
312
+
313
+ **Solutions:**
314
+
315
+ 1. **Monitor Resource Usage**
316
+ ```bash
317
+ # Check memory usage
318
+ npm run test:performance | grep memory
319
+
320
+ # Monitor during operation
321
+ top -p $(pgrep node)
322
+ ```
323
+
324
+ 2. **Optimize Configuration**
325
+ ```bash
326
+ # Reduce cache size if memory is limited
327
+ # Edit configuration:
328
+ CACHE_MAX_SIZE=100 # Reduce from default 1000
329
+
330
+ # Disable performance monitoring in production
331
+ DISABLE_PERFORMANCE_MONITORING=true
332
+ ```
333
+
334
+ ## 🖥️ Claude Desktop Issues
335
+
336
+ ### Issue: "WordPress tools not appearing in Claude"
337
+
338
+ **Symptoms:**
339
+ - Claude doesn't recognize WordPress commands
340
+ - No WordPress functionality available
341
+ - "I don't have access to WordPress" responses
342
+
343
+ **Solutions:**
344
+
345
+ 1. **Restart Claude Desktop**
346
+ ```bash
347
+ # Always restart Claude Desktop after configuration changes
348
+ # This ensures MCP server connections are refreshed
349
+ ```
350
+
351
+ 2. **Check Configuration File**
352
+
353
+ **For DXT Extension:**
354
+ - Verify extension is enabled in Claude Desktop
355
+ - Check configuration in Extensions settings
356
+ - Reinstall DXT if necessary
357
+
358
+ **For NPX/NPM Method:**
359
+ ```json
360
+ // Verify Claude Desktop config file format
361
+ {
362
+ "mcpServers": {
363
+ "mcp-wordpress": {
364
+ "command": "npx",
365
+ "args": ["-y", "mcp-wordpress"],
366
+ "env": {
367
+ "WORDPRESS_SITE_URL": "https://your-site.com",
368
+ "WORDPRESS_USERNAME": "your-username",
369
+ "WORDPRESS_APP_PASSWORD": "your-app-password"
370
+ }
371
+ }
372
+ }
373
+ }
374
+ ```
375
+
376
+ 3. **Verify Configuration File Location**
377
+
378
+ **macOS:**
379
+ ```bash
380
+ ~/Library/Application Support/Claude/claude_desktop_config.json
381
+ ```
382
+
383
+ **Windows:**
384
+ ```bash
385
+ %APPDATA%\Claude\claude_desktop_config.json
386
+ ```
387
+
388
+ **Linux:**
389
+ ```bash
390
+ ~/.config/claude_desktop_config.json
391
+ ```
392
+
393
+ ### Issue: "Server connection failed"
394
+
395
+ **Symptoms:**
396
+ - Claude shows "MCP server connection failed"
397
+ - Server appears to start but then disconnects
398
+
399
+ **Solutions:**
400
+
401
+ 1. **Check Server Logs**
402
+ ```bash
403
+ # Run server manually to see errors
404
+ DEBUG=true npx -y mcp-wordpress
405
+
406
+ # Look for specific error messages
407
+ # Common issues: missing dependencies, port conflicts
408
+ ```
409
+
410
+ 2. **JSON-RPC Protocol Issues**
411
+ ```bash
412
+ # Recent fix for DXT: JSON parsing errors
413
+ # Update to latest version
414
+ curl -L -o mcp-wordpress.dxt \
415
+ https://github.com/docdyhr/mcp-wordpress/raw/main/mcp-wordpress.dxt
416
+
417
+ # Reinstall DXT extension
418
+ ```
419
+
420
+ 3. **Environment Issues**
421
+ ```bash
422
+ # Test Node.js version
423
+ node --version # Should be 16+
424
+
425
+ # Test npm access
426
+ npm --version
427
+
428
+ # Clear npm cache if needed
429
+ npm cache clean --force
430
+ ```
431
+
432
+ ## 🐳 Docker Issues
433
+
434
+ ### Issue: Container won't start
435
+
436
+ **Symptoms:**
437
+ - Docker container exits immediately
438
+ - "Configuration missing" errors
439
+
440
+ **Solutions:**
441
+
442
+ 1. **Check Environment Variables**
443
+ ```bash
444
+ # Verify all required variables are set
445
+ docker run --rm docdyhr/mcp-wordpress:latest env | grep WORDPRESS
446
+
447
+ # Should show:
448
+ # WORDPRESS_SITE_URL=...
449
+ # WORDPRESS_USERNAME=...
450
+ # WORDPRESS_APP_PASSWORD=...
451
+ ```
452
+
453
+ 2. **Check Container Logs**
454
+ ```bash
455
+ # View container logs
456
+ docker logs mcp-wordpress
457
+
458
+ # Follow logs in real-time
459
+ docker logs -f mcp-wordpress
460
+ ```
461
+
462
+ 3. **Test Configuration**
463
+ ```bash
464
+ # Test with environment file
465
+ docker run --rm --env-file .env docdyhr/mcp-wordpress:latest npm run status
466
+ ```
467
+
468
+ ## 🔧 Advanced Debugging
469
+
470
+ ### Enable Debug Mode
471
+
472
+ 1. **Environment Variable**
473
+ ```bash
474
+ DEBUG=true npm run dev
475
+ ```
476
+
477
+ 2. **For Claude Desktop DXT**
478
+ - Enable "Debug Mode" in extension settings
479
+ - Check Claude Desktop console for detailed logs
480
+
481
+ 3. **Comprehensive Debugging**
482
+ ```bash
483
+ # Maximum debug output
484
+ NODE_ENV=development DEBUG=true LOG_LEVEL=debug npm run dev
485
+ ```
486
+
487
+ ### Debug Specific Components
488
+
489
+ ```bash
490
+ # Test individual components
491
+ npm run test:auth # Authentication only
492
+ npm run test:tools # Tool registration
493
+ npm run test:integration # WordPress API integration
494
+ npm run test:cache # Cache functionality
495
+ npm run test:performance # Performance monitoring
496
+ ```
497
+
498
+ ### Network Debugging
499
+
500
+ ```bash
501
+ # Capture network traffic
502
+ tcpdump -i any -w capture.pcap host your-site.com
503
+
504
+ # Analyze with Wireshark or:
505
+ tcpdump -r capture.pcap -A | grep -i wordpress
506
+ ```
507
+
508
+ ### WordPress Debug Mode
509
+
510
+ ```php
511
+ // Add to wp-config.php for WordPress debugging
512
+ define('WP_DEBUG', true);
513
+ define('WP_DEBUG_LOG', true);
514
+ define('WP_DEBUG_DISPLAY', false);
515
+
516
+ // Check WordPress debug log
517
+ tail -f /path/to/wordpress/wp-content/debug.log
518
+ ```
519
+
520
+ ## 📋 Issue Reporting Template
521
+
522
+ When reporting issues, include this information:
523
+
524
+ ```markdown
525
+ ### Environment
526
+ - **Installation Method**: DXT/NPX/NPM/Docker
527
+ - **Version**: [Check with npm list mcp-wordpress]
528
+ - **Node.js Version**: [node --version]
529
+ - **Operating System**: [OS and version]
530
+ - **Claude Desktop Version**: [If applicable]
531
+
532
+ ### WordPress Details
533
+ - **WordPress Version**: [Check in WP admin]
534
+ - **User Role**: [Administrator/Editor/etc.]
535
+ - **Authentication Method**: [app-password/jwt/basic]
536
+ - **REST API URL**: [https://site.com/wp-json/wp/v2/]
537
+
538
+ ### Issue Description
539
+ - **What you were trying to do**:
540
+ - **What happened instead**:
541
+ - **Error messages** (exact text):
542
+ - **Steps to reproduce**:
543
+
544
+ ### Debug Information
545
+ ```bash
546
+ # Output of diagnostic commands
547
+ npm run health
548
+ npm run status
549
+ DEBUG=true [command that failed]
550
+ ```
551
+
552
+ ### Configuration
553
+ [Include relevant configuration, redacting sensitive information]
554
+ ```text
555
+
556
+ ## 🆘 Getting Help
557
+
558
+ ### Self-Help Resources
559
+
560
+ 1. **[Documentation Hub](README.md)** - Complete documentation
561
+ 2. **[API Reference](api/README.md)** - Tool documentation
562
+ 3. **[GitHub Issues](https://github.com/docdyhr/mcp-wordpress/issues)** - Known issues and solutions
563
+
564
+ ### Community Support
565
+
566
+ 1. **[GitHub Discussions](https://github.com/docdyhr/mcp-wordpress/discussions)** - Community Q&A
567
+ 2. **[Issue Tracker](https://github.com/docdyhr/mcp-wordpress/issues/new)** - Bug reports
568
+
569
+ ### Professional Support
570
+
571
+ For enterprise users or complex integrations:
572
+ - Priority support available
573
+ - Custom configuration assistance
574
+ - Integration consulting
575
+
576
+ ---
577
+
578
+ **Still having issues?** [Open a GitHub issue](https://github.com/docdyhr/mcp-wordpress/issues/new) with the debugging information above, and we'll help you resolve it!