mcp-wordpress 2.3.0 → 2.4.1

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 (36) hide show
  1. package/README.md +511 -0
  2. package/dist/client/api.d.ts +90 -0
  3. package/dist/client/api.d.ts.map +1 -1
  4. package/dist/client/api.js +90 -0
  5. package/dist/client/api.js.map +1 -1
  6. package/dist/tools/media.d.ts +43 -4
  7. package/dist/tools/media.d.ts.map +1 -1
  8. package/dist/tools/media.js +43 -4
  9. package/dist/tools/media.js.map +1 -1
  10. package/dist/tools/posts.d.ts +225 -4
  11. package/dist/tools/posts.d.ts.map +1 -1
  12. package/dist/tools/posts.js +225 -4
  13. package/dist/tools/posts.js.map +1 -1
  14. package/docs/DOCKER_PUBLISHING_TROUBLESHOOTING.md +233 -0
  15. package/docs/PUBLISHING-TROUBLESHOOTING.md +227 -0
  16. package/docs/api/README.md +53 -11
  17. package/docs/api/openapi.json +10 -10
  18. package/docs/api/summary.json +1 -1
  19. package/docs/api/tools/wp_create_post.md +9 -3
  20. package/docs/api/tools/wp_delete_post.md +2 -3
  21. package/docs/api/tools/wp_get_current_user.md +7 -1
  22. package/docs/api/tools/wp_get_post.md +2 -3
  23. package/docs/api/tools/wp_get_post_revisions.md +1 -1
  24. package/docs/api/tools/wp_list_posts.md +10 -3
  25. package/docs/api/tools/wp_list_users.md +8 -1
  26. package/docs/api/tools/wp_search_site.md +8 -1
  27. package/docs/api/tools/wp_test_auth.md +8 -1
  28. package/docs/api/tools/wp_update_post.md +2 -3
  29. package/docs/examples/docker-production.md +801 -0
  30. package/docs/examples/multi-site-setup.md +575 -0
  31. package/docs/examples/single-site-setup.md +390 -0
  32. package/docs/examples/use-case-workflows.md +469 -0
  33. package/package.json +12 -2
  34. package/src/client/api.ts +90 -0
  35. package/src/tools/media.ts +43 -4
  36. package/src/tools/posts.ts +225 -4
@@ -0,0 +1,390 @@
1
+ # Single Site Configuration Examples
2
+
3
+ This guide provides complete configuration examples for managing a single WordPress site with the MCP WordPress server.
4
+
5
+ ## Basic Single Site Setup
6
+
7
+ ### Environment Variables (.env)
8
+
9
+ ```bash
10
+ # WordPress Site Configuration
11
+ WORDPRESS_SITE_URL=https://myblog.com
12
+ WORDPRESS_USERNAME=admin
13
+ WORDPRESS_APP_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx
14
+ WORDPRESS_AUTH_METHOD=app-password
15
+
16
+ # Optional Performance Settings
17
+ CACHE_ENABLED=true
18
+ CACHE_TTL=300
19
+ DEBUG=false
20
+ ```
21
+
22
+ ### Claude Desktop Configuration
23
+
24
+ ```json
25
+ {
26
+ "mcpServers": {
27
+ "mcp-wordpress": {
28
+ "command": "npx",
29
+ "args": ["-y", "mcp-wordpress"],
30
+ "env": {
31
+ "WORDPRESS_SITE_URL": "https://myblog.com",
32
+ "WORDPRESS_USERNAME": "admin",
33
+ "WORDPRESS_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
34
+ }
35
+ }
36
+ }
37
+ }
38
+ ```
39
+
40
+ ## Authentication Method Examples
41
+
42
+ ### Application Password (Recommended)
43
+
44
+ **Step 1: Generate Application Password**
45
+
46
+ 1. WordPress Admin → Users → Your Profile
47
+ 2. Scroll to "Application Passwords"
48
+ 3. Enter name: "MCP WordPress Server"
49
+ 4. Click "Add New Application Password"
50
+ 5. Copy the generated password (includes spaces)
51
+
52
+ **Step 2: Configuration**
53
+
54
+ ```json
55
+ {
56
+ "mcpServers": {
57
+ "mcp-wordpress": {
58
+ "command": "npx",
59
+ "args": ["-y", "mcp-wordpress"],
60
+ "env": {
61
+ "WORDPRESS_SITE_URL": "https://yoursite.com",
62
+ "WORDPRESS_USERNAME": "your-username",
63
+ "WORDPRESS_APP_PASSWORD": "abcd efgh ijkl mnop qrst uvwx",
64
+ "WORDPRESS_AUTH_METHOD": "app-password"
65
+ }
66
+ }
67
+ }
68
+ }
69
+ ```
70
+
71
+ ### JWT Authentication
72
+
73
+ **Prerequisites**: Install JWT Authentication plugin
74
+
75
+ - Plugin: "JWT Authentication for WP-API"
76
+
77
+ **WordPress Configuration (wp-config.php)**
78
+
79
+ ```php
80
+ define('JWT_AUTH_SECRET_KEY', 'your-secret-key-here');
81
+ define('JWT_AUTH_CORS_ENABLE', true);
82
+ ```
83
+
84
+ **MCP Configuration**
85
+
86
+ ```json
87
+ {
88
+ "mcpServers": {
89
+ "mcp-wordpress": {
90
+ "command": "npx",
91
+ "args": ["-y", "mcp-wordpress"],
92
+ "env": {
93
+ "WORDPRESS_SITE_URL": "https://yoursite.com",
94
+ "WORDPRESS_USERNAME": "your-username",
95
+ "WORDPRESS_PASSWORD": "your-password",
96
+ "WORDPRESS_AUTH_METHOD": "jwt"
97
+ }
98
+ }
99
+ }
100
+ }
101
+ ```
102
+
103
+ ### Basic Authentication (Development Only)
104
+
105
+ **⚠️ Warning**: Only use for local development - not secure for production!
106
+
107
+ ```json
108
+ {
109
+ "mcpServers": {
110
+ "mcp-wordpress": {
111
+ "command": "npx",
112
+ "args": ["-y", "mcp-wordpress"],
113
+ "env": {
114
+ "WORDPRESS_SITE_URL": "http://localhost:8080",
115
+ "WORDPRESS_USERNAME": "admin",
116
+ "WORDPRESS_PASSWORD": "admin",
117
+ "WORDPRESS_AUTH_METHOD": "basic"
118
+ }
119
+ }
120
+ }
121
+ }
122
+ ```
123
+
124
+ ## Performance-Optimized Configuration
125
+
126
+ ### High-Performance Setup
127
+
128
+ ```json
129
+ {
130
+ "mcpServers": {
131
+ "mcp-wordpress": {
132
+ "command": "npx",
133
+ "args": ["-y", "mcp-wordpress"],
134
+ "env": {
135
+ "WORDPRESS_SITE_URL": "https://yoursite.com",
136
+ "WORDPRESS_USERNAME": "admin",
137
+ "WORDPRESS_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx",
138
+ "CACHE_ENABLED": "true",
139
+ "CACHE_TTL": "600",
140
+ "CACHE_MAX_ITEMS": "1000",
141
+ "RATE_LIMIT_ENABLED": "true",
142
+ "PERFORMANCE_MONITORING": "true"
143
+ }
144
+ }
145
+ }
146
+ }
147
+ ```
148
+
149
+ ### Memory-Constrained Setup
150
+
151
+ ```json
152
+ {
153
+ "mcpServers": {
154
+ "mcp-wordpress": {
155
+ "command": "npx",
156
+ "args": ["-y", "mcp-wordpress"],
157
+ "env": {
158
+ "WORDPRESS_SITE_URL": "https://yoursite.com",
159
+ "WORDPRESS_USERNAME": "admin",
160
+ "WORDPRESS_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx",
161
+ "CACHE_ENABLED": "true",
162
+ "CACHE_TTL": "300",
163
+ "CACHE_MAX_ITEMS": "200",
164
+ "CACHE_MAX_MEMORY_MB": "50"
165
+ }
166
+ }
167
+ }
168
+ }
169
+ ```
170
+
171
+ ## Debugging Configuration
172
+
173
+ ### Development Debug Mode
174
+
175
+ ```json
176
+ {
177
+ "mcpServers": {
178
+ "mcp-wordpress": {
179
+ "command": "npx",
180
+ "args": ["-y", "mcp-wordpress"],
181
+ "env": {
182
+ "WORDPRESS_SITE_URL": "https://yoursite.com",
183
+ "WORDPRESS_USERNAME": "admin",
184
+ "WORDPRESS_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx",
185
+ "DEBUG": "true",
186
+ "NODE_ENV": "development",
187
+ "LOG_LEVEL": "debug"
188
+ }
189
+ }
190
+ }
191
+ }
192
+ ```
193
+
194
+ ### Security Debug Mode
195
+
196
+ ```json
197
+ {
198
+ "mcpServers": {
199
+ "mcp-wordpress": {
200
+ "command": "npx",
201
+ "args": ["-y", "mcp-wordpress"],
202
+ "env": {
203
+ "WORDPRESS_SITE_URL": "https://yoursite.com",
204
+ "WORDPRESS_USERNAME": "admin",
205
+ "WORDPRESS_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx",
206
+ "DEBUG": "security",
207
+ "SECURITY_MONITORING": "true",
208
+ "AUTH_DEBUG": "true"
209
+ }
210
+ }
211
+ }
212
+ }
213
+ ```
214
+
215
+ ## Use Case Specific Configurations
216
+
217
+ ### Content Creator Setup
218
+
219
+ **Focus**: Post management, media uploads, SEO optimization
220
+
221
+ ```json
222
+ {
223
+ "mcpServers": {
224
+ "mcp-wordpress": {
225
+ "command": "npx",
226
+ "args": ["-y", "mcp-wordpress"],
227
+ "env": {
228
+ "WORDPRESS_SITE_URL": "https://myblog.com",
229
+ "WORDPRESS_USERNAME": "editor",
230
+ "WORDPRESS_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx",
231
+ "CACHE_ENABLED": "true",
232
+ "MEDIA_UPLOAD_TIMEOUT": "60000",
233
+ "PERFORMANCE_MONITORING": "true"
234
+ }
235
+ }
236
+ }
237
+ }
238
+ ```
239
+
240
+ ### Site Administrator Setup
241
+
242
+ **Focus**: User management, settings, security monitoring
243
+
244
+ ```json
245
+ {
246
+ "mcpServers": {
247
+ "mcp-wordpress": {
248
+ "command": "npx",
249
+ "args": ["-y", "mcp-wordpress"],
250
+ "env": {
251
+ "WORDPRESS_SITE_URL": "https://company-website.com",
252
+ "WORDPRESS_USERNAME": "admin",
253
+ "WORDPRESS_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx",
254
+ "SECURITY_MONITORING": "true",
255
+ "RATE_LIMIT_ENABLED": "true",
256
+ "CACHE_ENABLED": "true",
257
+ "DEBUG": "false"
258
+ }
259
+ }
260
+ }
261
+ }
262
+ ```
263
+
264
+ ### Developer Setup
265
+
266
+ **Focus**: API testing, development features, detailed logging
267
+
268
+ ```json
269
+ {
270
+ "mcpServers": {
271
+ "mcp-wordpress": {
272
+ "command": "npx",
273
+ "args": ["-y", "mcp-wordpress"],
274
+ "env": {
275
+ "WORDPRESS_SITE_URL": "http://localhost:8080",
276
+ "WORDPRESS_USERNAME": "dev-user",
277
+ "WORDPRESS_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx",
278
+ "DEBUG": "true",
279
+ "NODE_ENV": "development",
280
+ "CACHE_ENABLED": "false",
281
+ "LOG_LEVEL": "debug",
282
+ "API_TIMEOUT": "30000"
283
+ }
284
+ }
285
+ }
286
+ }
287
+ ```
288
+
289
+ ## Local Development with Docker
290
+
291
+ ### Docker Compose WordPress Setup
292
+
293
+ ```yaml
294
+ # docker-compose.yml
295
+ version: '3.8'
296
+ services:
297
+ wordpress:
298
+ image: wordpress:latest
299
+ ports:
300
+ - "8080:80"
301
+ environment:
302
+ WORDPRESS_DB_HOST: db
303
+ WORDPRESS_DB_USER: wordpress
304
+ WORDPRESS_DB_PASSWORD: wordpress
305
+ WORDPRESS_DB_NAME: wordpress
306
+ volumes:
307
+ - wordpress_data:/var/www/html
308
+
309
+ db:
310
+ image: mysql:8.0
311
+ environment:
312
+ MYSQL_DATABASE: wordpress
313
+ MYSQL_USER: wordpress
314
+ MYSQL_PASSWORD: wordpress
315
+ MYSQL_ROOT_PASSWORD: rootpassword
316
+ volumes:
317
+ - db_data:/var/lib/mysql
318
+
319
+ volumes:
320
+ wordpress_data:
321
+ db_data:
322
+ ```
323
+
324
+ ### Corresponding MCP Configuration
325
+
326
+ ```json
327
+ {
328
+ "mcpServers": {
329
+ "mcp-wordpress": {
330
+ "command": "npx",
331
+ "args": ["-y", "mcp-wordpress"],
332
+ "env": {
333
+ "WORDPRESS_SITE_URL": "http://localhost:8080",
334
+ "WORDPRESS_USERNAME": "admin",
335
+ "WORDPRESS_APP_PASSWORD": "your-generated-password",
336
+ "DEBUG": "true",
337
+ "NODE_ENV": "development"
338
+ }
339
+ }
340
+ }
341
+ }
342
+ ```
343
+
344
+ ## Testing Your Configuration
345
+
346
+ ### Quick Connection Test
347
+
348
+ ```bash
349
+ # Test if the configuration works
350
+ npx mcp-wordpress --help
351
+
352
+ # Test WordPress connection
353
+ curl -u username:password http://localhost:8080/wp-json/wp/v2/users/me
354
+ ```
355
+
356
+ ### Claude Desktop Test
357
+
358
+ 1. Save your configuration to Claude Desktop config file
359
+ 2. Restart Claude Desktop
360
+ 3. Open a new conversation
361
+ 4. Type: "Test my WordPress connection"
362
+ 5. Expected response: "✅ Authentication successful! Connected to: [Your Site Name]"
363
+
364
+ ## Troubleshooting Common Issues
365
+
366
+ ### Configuration File Location
367
+
368
+ **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
369
+ **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
370
+ **Linux**: `~/.config/Claude/claude_desktop_config.json`
371
+
372
+ ### Common Fixes
373
+
374
+ 1. **Tools not appearing**: Restart Claude Desktop after configuration changes
375
+ 2. **Authentication errors**: Regenerate application password
376
+ 3. **Connection timeouts**: Check `WORDPRESS_SITE_URL` format
377
+ 4. **Permission errors**: Ensure user has appropriate WordPress role
378
+
379
+ ### Validation Commands
380
+
381
+ ```bash
382
+ # Validate JSON syntax
383
+ cat claude_desktop_config.json | jq .
384
+
385
+ # Test WordPress REST API
386
+ curl https://yoursite.com/wp-json/wp/v2/
387
+
388
+ # Test authentication
389
+ curl -u username:password https://yoursite.com/wp-json/wp/v2/users/me
390
+ ```