mcp-wordpress 1.3.1 → 1.5.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 +151 -772
- package/dist/cache/CacheInvalidation.d.ts.map +1 -1
- package/dist/client/CachedWordPressClient.d.ts.map +1 -1
- package/dist/client/CachedWordPressClient.js.map +1 -1
- package/dist/client/api.d.ts.map +1 -1
- package/dist/client/api.js +11 -3
- package/dist/client/api.js.map +1 -1
- package/dist/client/auth.js.map +1 -1
- package/dist/client/managers/AuthenticationManager.js.map +1 -1
- package/dist/client/managers/RequestManager.js +0 -1
- package/dist/client/managers/RequestManager.js.map +1 -1
- package/dist/config/ServerConfiguration.d.ts.map +1 -1
- package/dist/config/ServerConfiguration.js +18 -0
- package/dist/config/ServerConfiguration.js.map +1 -1
- package/dist/docs/MarkdownFormatter.js.map +1 -1
- package/dist/dxt-entry.d.ts +6 -0
- package/dist/dxt-entry.d.ts.map +1 -0
- package/dist/dxt-entry.js +38 -0
- package/dist/dxt-entry.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp-wordpress-1.5.0.tgz +0 -0
- package/dist/performance/MetricsCollector.d.ts.map +1 -1
- package/dist/performance/PerformanceAnalytics.d.ts.map +1 -1
- package/dist/performance/PerformanceAnalytics.js.map +1 -1
- package/dist/performance/PerformanceMonitor.d.ts.map +1 -1
- package/dist/security/InputValidator.js.map +1 -1
- package/dist/security/SecurityConfig.d.ts.map +1 -1
- package/dist/server/ToolRegistry.js.map +1 -1
- package/dist/tools/cache.js +1 -1
- package/dist/tools/cache.js.map +1 -1
- package/dist/tools/performance.js.map +1 -1
- package/docs/DOCKER.md +8 -1
- package/docs/api/README.md +82 -75
- package/docs/api/categories/site.md +2 -0
- package/docs/api/tools/wp_approve_comment.md +0 -6
- package/docs/api/tools/wp_cache_clear.md +5 -14
- package/docs/api/tools/wp_cache_info.md +5 -14
- package/docs/api/tools/wp_cache_stats.md +5 -14
- package/docs/api/tools/wp_cache_warm.md +5 -14
- package/docs/api/tools/wp_create_application_password.md +3 -11
- package/docs/api/tools/wp_create_category.md +3 -11
- package/docs/api/tools/wp_create_comment.md +5 -14
- package/docs/api/tools/wp_create_page.md +5 -13
- package/docs/api/tools/wp_create_post.md +6 -12
- package/docs/api/tools/wp_create_tag.md +3 -11
- package/docs/api/tools/wp_create_user.md +5 -13
- package/docs/api/tools/wp_delete_application_password.md +3 -11
- package/docs/api/tools/wp_delete_category.md +3 -11
- package/docs/api/tools/wp_delete_comment.md +3 -11
- package/docs/api/tools/wp_delete_media.md +3 -10
- package/docs/api/tools/wp_delete_page.md +3 -10
- package/docs/api/tools/wp_delete_post.md +4 -9
- package/docs/api/tools/wp_delete_tag.md +3 -11
- package/docs/api/tools/wp_delete_user.md +3 -10
- package/docs/api/tools/wp_get_application_passwords.md +3 -11
- package/docs/api/tools/wp_get_auth_status.md +3 -11
- package/docs/api/tools/wp_get_category.md +3 -11
- package/docs/api/tools/wp_get_comment.md +3 -11
- package/docs/api/tools/wp_get_current_user.md +3 -11
- package/docs/api/tools/wp_get_media.md +3 -11
- package/docs/api/tools/wp_get_page.md +3 -11
- package/docs/api/tools/wp_get_page_revisions.md +3 -11
- package/docs/api/tools/wp_get_post.md +4 -10
- package/docs/api/tools/wp_get_post_revisions.md +3 -11
- package/docs/api/tools/wp_get_site_settings.md +3 -10
- package/docs/api/tools/wp_get_tag.md +3 -11
- package/docs/api/tools/wp_get_user.md +3 -11
- package/docs/api/tools/wp_list_categories.md +3 -11
- package/docs/api/tools/wp_list_comments.md +3 -11
- package/docs/api/tools/wp_list_media.md +5 -14
- package/docs/api/tools/wp_list_pages.md +5 -14
- package/docs/api/tools/wp_list_posts.md +6 -13
- package/docs/api/tools/wp_list_tags.md +3 -11
- package/docs/api/tools/wp_list_users.md +3 -11
- package/docs/api/tools/wp_performance_alerts.md +7 -17
- package/docs/api/tools/wp_performance_benchmark.md +7 -17
- package/docs/api/tools/wp_performance_export.md +7 -17
- package/docs/api/tools/wp_performance_history.md +7 -17
- package/docs/api/tools/wp_performance_optimize.md +7 -17
- package/docs/api/tools/wp_performance_stats.md +7 -17
- package/docs/api/tools/wp_search_site.md +3 -11
- package/docs/api/tools/wp_spam_comment.md +3 -11
- package/docs/api/tools/wp_switch_auth_method.md +5 -14
- package/docs/api/tools/wp_test_auth.md +3 -11
- package/docs/api/tools/wp_update_category.md +3 -11
- package/docs/api/tools/wp_update_comment.md +5 -14
- package/docs/api/tools/wp_update_media.md +5 -14
- package/docs/api/tools/wp_update_page.md +5 -13
- package/docs/api/tools/wp_update_post.md +6 -12
- package/docs/api/tools/wp_update_site_settings.md +5 -14
- package/docs/api/tools/wp_update_tag.md +3 -11
- package/docs/api/tools/wp_update_user.md +5 -13
- package/docs/api/tools/wp_upload_media.md +5 -13
- package/docs/api/types/WordPressPost.md +0 -2
- package/docs/developer/API_REFERENCE.md +668 -0
- package/docs/developer/ARCHITECTURE.md +374 -0
- package/docs/developer/BUILD_SYSTEM.md +460 -0
- package/docs/developer/CONTRIBUTING.md +469 -0
- package/docs/developer/DEVELOPMENT_SETUP.md +463 -0
- package/docs/developer/DXT-DEBUG-BEST-PRACTICES.md +212 -0
- package/docs/developer/GITHUB_ACTIONS_SETUP.md +2 -1
- package/docs/developer/MAINTENANCE.md +5 -5
- package/docs/developer/MIGRATION_GUIDE.md +7 -5
- package/docs/developer/NPM_AUTH_SETUP.md +4 -4
- package/docs/developer/README.md +242 -0
- package/docs/developer/REFACTORING.md +15 -10
- package/docs/developer/RELEASE_PROCESS.md +528 -0
- package/docs/developer/TESTING.md +734 -0
- package/docs/releases/COMMUNITY_ANNOUNCEMENT_v1.1.2.md +9 -3
- package/docs/releases/RELEASE_NOTES_v1.1.2.md +4 -4
- package/docs/user-guides/DOCKER_SETUP.md +2 -2
- package/docs/user-guides/DTX_SETUP.md +3 -3
- package/docs/user-guides/DXT_INSTALLATION.md +149 -0
- package/docs/user-guides/NPX_SETUP.md +2 -2
- package/package.json +5 -4
- package/src/cache/CacheInvalidation.ts +1 -1
- package/src/client/CachedWordPressClient.ts +15 -15
- package/src/client/api.ts +54 -47
- package/src/client/auth.ts +88 -88
- package/src/client/managers/AuthenticationManager.ts +112 -112
- package/src/client/managers/RequestManager.ts +1 -1
- package/src/config/ServerConfiguration.ts +39 -0
- package/src/docs/MarkdownFormatter.ts +4 -4
- package/src/dxt-entry.cjs +55 -0
- package/src/dxt-entry.ts +55 -0
- package/src/index.ts +55 -2
- package/src/performance/MetricsCollector.ts +3 -3
- package/src/performance/PerformanceAnalytics.ts +16 -16
- package/src/performance/PerformanceMonitor.ts +1 -1
- package/src/security/InputValidator.ts +4 -4
- package/src/security/SecurityConfig.ts +1 -1
- package/src/server/ToolRegistry.ts +12 -12
- package/src/tools/cache.ts +1 -1
- package/src/tools/performance.ts +17 -17
- package/dist/mcp-wordpress-1.3.1.tgz +0 -0
package/README.md
CHANGED
|
@@ -4,236 +4,64 @@
|
|
|
4
4
|
<img src="images/wordpress-mcp-logo.png" width="50%" alt="WordPress MCP Logo">
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
|
-
A comprehensive Model Context Protocol (MCP) server for WordPress management through
|
|
7
|
+
A comprehensive Model Context Protocol (MCP) server for WordPress management through Claude Desktop. Manage your WordPress sites with natural language through 59 powerful tools.
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/mcp-wordpress)
|
|
10
10
|
[](https://github.com/docdyhr/mcp-wordpress)
|
|
11
11
|
[](https://github.com/docdyhr/mcp-wordpress)
|
|
12
|
-
[](https://github.com/docdyhr/mcp-wordpress/blob/main/REFACTORING.md)
|
|
13
|
-
|
|
14
|
-
## 🚀 Features
|
|
15
|
-
|
|
16
|
-
- **59 WordPress Management Tools** across 10 categories
|
|
17
|
-
- **⚡ Intelligent Caching System** - Multi-layer response caching with 50-70% performance improvement
|
|
18
|
-
- **📊 Real-Time Performance Monitoring** - Comprehensive metrics, analytics, and optimization insights
|
|
19
|
-
- **📚 Auto-Generated API Documentation** - Complete tool documentation with OpenAPI specification
|
|
20
|
-
- **🐳 Docker Support** - Containerized deployment for production environments
|
|
21
|
-
- **🏗 Modular Architecture** - Manager-based composition pattern (94% code reduction)
|
|
22
|
-
- **Multi-Site Support** - Manage multiple WordPress sites from one configuration
|
|
23
|
-
- **100% TypeScript** - Complete type safety and IntelliSense
|
|
24
|
-
- **🎯 95%+ Test Coverage** - All critical functionality verified and tested
|
|
25
|
-
- **⚡ Performance Optimized** - Intelligent rate limiting and memory management
|
|
26
|
-
- **🔒 Flexible Authentication** - Supports App Passwords, JWT, Basic Auth, API Key
|
|
27
|
-
- **📊 Comprehensive Monitoring** - Structured logging and error tracking
|
|
28
|
-
- **🛠 Production Ready** - Security-reviewed and battle-tested
|
|
29
|
-
- **🔄 100% Backward Compatible** - Zero breaking changes during refactoring
|
|
30
12
|
|
|
31
13
|
## ⚡ Quick Start
|
|
32
14
|
|
|
33
|
-
Choose your
|
|
15
|
+
**Choose your setup method:**
|
|
34
16
|
|
|
35
|
-
- 🚀 **[NPX Setup](docs/user-guides/NPX_SETUP.md)** - Zero installation, always latest
|
|
36
|
-
- 💻 **[NPM Setup](docs/user-guides/NPM_SETUP.md)** - Local development
|
|
17
|
+
- 🚀 **[NPX Setup](docs/user-guides/NPX_SETUP.md)** - Zero installation, always latest (Recommended)
|
|
18
|
+
- 💻 **[NPM Setup](docs/user-guides/NPM_SETUP.md)** - Local development
|
|
37
19
|
- 🐳 **[Docker Setup](docs/user-guides/DOCKER_SETUP.md)** - Containerized deployment
|
|
38
|
-
- 📦 **[DTX Setup](docs/user-guides/DTX_SETUP.md)** - Claude Desktop Extension
|
|
20
|
+
- 📦 **[DTX Setup](docs/user-guides/DTX_SETUP.md)** - Claude Desktop Extension
|
|
39
21
|
|
|
40
|
-
### Ultra-Quick NPX
|
|
22
|
+
### Ultra-Quick Start (NPX)
|
|
41
23
|
|
|
42
24
|
```bash
|
|
43
25
|
# Run directly with NPX (recommended)
|
|
44
26
|
npx -y mcp-wordpress
|
|
45
27
|
|
|
46
|
-
#
|
|
47
|
-
npm install -g mcp-wordpress
|
|
48
|
-
mcp-wordpress
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Setup Wizard
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
# For any installation method
|
|
28
|
+
# Follow the setup wizard
|
|
55
29
|
npm run setup
|
|
56
30
|
```
|
|
57
31
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
Building on v1.2.0's performance monitoring and documentation features, v1.2.1 delivers **100% test reliability**, **enhanced multi-site support**, and **production-ready repository organization**:
|
|
61
|
-
|
|
62
|
-
### ✅ Test Infrastructure Overhaul (v1.2.1)
|
|
63
|
-
|
|
64
|
-
- **🔧 100% Test Success Rate**: Fixed all failing integration and tool tests
|
|
65
|
-
- **🌐 Multi-Site Testing**: Comprehensive test suite for multi-site WordPress configurations
|
|
66
|
-
- **🛡️ Enhanced Security**: Improved .gitignore and credential protection
|
|
67
|
-
- **📋 Test Organization**: Streamlined test scripts and better error reporting
|
|
68
|
-
- **⚡ Quick Validation**: New `npm run test:multisite` command for rapid configuration testing
|
|
69
|
-
|
|
70
|
-
### 🌐 Multi-Site Configuration Enhancements (v1.2.1)
|
|
71
|
-
|
|
72
|
-
- **📝 Complete Documentation**: Comprehensive Claude Desktop setup guide for multi-site usage
|
|
73
|
-
- **🔧 Fixed Configuration**: Resolved JWT authentication validation issues
|
|
74
|
-
- **✅ Site Validation**: Enhanced uniqueness checks for site URLs and IDs
|
|
75
|
-
- **🚀 Quick Testing**: Instant validation of all configured WordPress sites
|
|
76
|
-
- **📊 Status Reporting**: Clear success/failure reporting for each site configuration
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
## 🏆 Previous Achievement: v1.2.0 - Performance & Documentation Revolution
|
|
81
|
-
|
|
82
|
-
We've implemented a **comprehensive performance monitoring system**, **intelligent caching**, **auto-generated documentation**, and **Docker containerization** - all while maintaining complete backward compatibility:
|
|
83
|
-
|
|
84
|
-
### ⚡ Performance Monitoring System
|
|
85
|
-
|
|
86
|
-
- **📊 Real-Time Metrics**: Response times, cache hit rates, error tracking, system resources
|
|
87
|
-
- **📈 Historical Analytics**: Trend analysis, anomaly detection, predictive insights
|
|
88
|
-
- **🎯 Industry Benchmarks**: Compare against performance standards with optimization recommendations
|
|
89
|
-
- **🚨 Smart Alerts**: Automated performance alerts and threshold monitoring
|
|
90
|
-
- **📋 Comprehensive Reports**: Export detailed performance data in multiple formats
|
|
91
|
-
- **⚙️ Optimization Engine**: AI-powered recommendations for performance improvements
|
|
92
|
-
|
|
93
|
-
### 🏗️ Intelligent Caching System
|
|
94
|
-
|
|
95
|
-
- **🚀 50-70% Performance Improvement**: Reduced API calls for taxonomy and authentication operations
|
|
96
|
-
- **📊 Multi-Layer Architecture**: HTTP response caching + in-memory application cache + intelligent invalidation
|
|
97
|
-
- **🎯 Site-Specific Isolation**: Complete cache separation for multi-site WordPress installations
|
|
98
|
-
- **🔧 Cache Management Tools**: 4 new MCP tools for monitoring and managing cache performance
|
|
99
|
-
- **⏱️ Sub-Millisecond Operations**: Cache hits deliver responses in under 1ms
|
|
100
|
-
|
|
101
|
-
### 📚 Auto-Generated Documentation
|
|
102
|
-
|
|
103
|
-
- **📖 Complete API Documentation**: All 59 tools with examples, parameters, and usage guides
|
|
104
|
-
- **🔧 OpenAPI Specification**: Machine-readable API spec for integration
|
|
105
|
-
- **🔄 Automated CI/CD Pipeline**: Documentation updates automatically on code changes
|
|
106
|
-
- **✅ Quality Validation**: Comprehensive documentation quality checks
|
|
107
|
-
- **🌐 Multi-Format Output**: Markdown, JSON, and OpenAPI formats
|
|
108
|
-
|
|
109
|
-
### 🐳 Docker Containerization
|
|
110
|
-
|
|
111
|
-
- **📦 Production-Ready Images**: Optimized Docker containers for deployment
|
|
112
|
-
- **🔧 Development Environment**: Docker Compose for local development
|
|
113
|
-
- **⚙️ Environment Configuration**: Flexible configuration via environment variables
|
|
114
|
-
- **🚀 Easy Deployment**: One-command deployment to any Docker environment
|
|
115
|
-
|
|
116
|
-
**📚 Complete Documentation**:
|
|
117
|
-
|
|
118
|
-
- [Performance Monitoring Guide](./docs/PERFORMANCE.md)
|
|
119
|
-
- [Caching System Guide](./docs/CACHING.md)
|
|
120
|
-
- [API Documentation](./docs/api/README.md)
|
|
121
|
-
- [Docker Deployment Guide](./docs/DOCKER.md)
|
|
122
|
-
|
|
123
|
-
## 🔐 Authentication & Testing Status (v1.2.4+)
|
|
124
|
-
|
|
125
|
-
✅ **Application Passwords** - Tested and working perfectly
|
|
126
|
-
✅ **JWT Authentication** - Supported with plugin
|
|
127
|
-
✅ **Basic Authentication** - Development ready
|
|
128
|
-
✅ **API Key Authentication** - Plugin-based support
|
|
129
|
-
✅ **Main Test Suite** - 100% success rate (144/144 tests passing)
|
|
130
|
-
✅ **Security Tests** - 100% success rate (40/40 tests passing)
|
|
131
|
-
✅ **Performance Tests** - 100% success rate (8/8 tests passing)
|
|
132
|
-
✅ **Tool Tests** - 100% success rate (14/14 tools working)
|
|
133
|
-
✅ **CI/CD Pipeline** - Fully functional with automated publishing
|
|
134
|
-
|
|
135
|
-
The setup wizard guides you through:
|
|
136
|
-
|
|
137
|
-
- WordPress site configuration
|
|
138
|
-
- Authentication method selection
|
|
139
|
-
- Connection testing
|
|
140
|
-
- Claude Desktop configuration
|
|
141
|
-
|
|
142
|
-
## 🚀 Claude Desktop Integration
|
|
143
|
-
|
|
144
|
-
### 📖 Complete Setup Guides
|
|
145
|
-
|
|
146
|
-
For detailed setup instructions, see our comprehensive guides:
|
|
147
|
-
|
|
148
|
-
- **[NPX Setup Guide](docs/user-guides/NPX_SETUP.md)** - Zero installation method
|
|
149
|
-
- **[NPM Setup Guide](docs/user-guides/NPM_SETUP.md)** - Local development
|
|
150
|
-
- **[Docker Setup Guide](docs/user-guides/DOCKER_SETUP.md)** - Containerized deployment
|
|
151
|
-
- **[DTX Setup Guide](docs/user-guides/DTX_SETUP.md)** - Desktop Extension package
|
|
152
|
-
|
|
153
|
-
### 🤖 Claude Desktop Quick Prompts
|
|
154
|
-
|
|
155
|
-
**For NPX Users (Easiest):**
|
|
156
|
-
```text
|
|
157
|
-
Set up MCP WordPress using NPX. My site: [YOUR_SITE_URL], username: [YOUR_USERNAME]. Help with application password creation and Claude Desktop configuration.
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
**For Local Development:**
|
|
161
|
-
```text
|
|
162
|
-
Set up MCP WordPress locally from GitHub. Clone, install, configure for my site: [YOUR_SITE_URL], username: [YOUR_USERNAME]. Include Claude Desktop setup.
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
**Replace placeholders with your actual WordPress details - Claude will handle the rest!**
|
|
166
|
-
|
|
167
|
-
## 🔧 Configuration
|
|
168
|
-
|
|
169
|
-
The MCP WordPress server supports multiple configuration methods to fit different needs.
|
|
32
|
+
**Setup takes 2 minutes** - the wizard guides you through WordPress connection and Claude Desktop configuration.
|
|
170
33
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
| Method | Best For | Configuration File |
|
|
174
|
-
|--------|----------|---------------------|
|
|
175
|
-
| **NPX** | Quick start, always latest | Claude Desktop config only |
|
|
176
|
-
| **NPM** | Local development | `.env` or Claude Desktop config |
|
|
177
|
-
| **Docker** | Production deployment | Environment variables or mounted config |
|
|
178
|
-
| **DTX** | Simple GUI setup | DTX config + optional multi-site file |
|
|
179
|
-
|
|
180
|
-
### Environment Variables
|
|
34
|
+
## 🚀 Features
|
|
181
35
|
|
|
182
|
-
|
|
183
|
-
```env
|
|
184
|
-
WORDPRESS_SITE_URL=https://your-wordpress-site.com
|
|
185
|
-
WORDPRESS_USERNAME=your-username
|
|
186
|
-
WORDPRESS_APP_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx
|
|
187
|
-
WORDPRESS_AUTH_METHOD=app-password
|
|
188
|
-
DEBUG=false
|
|
189
|
-
```
|
|
36
|
+
### WordPress Management
|
|
190
37
|
|
|
191
|
-
|
|
192
|
-
- **
|
|
193
|
-
- **
|
|
194
|
-
- **[Docker Configuration](docs/user-guides/DOCKER_SETUP.md#configuration)** - Container environment setup
|
|
195
|
-
- **[DTX Configuration](docs/user-guides/DTX_SETUP.md#configuration)** - Extension package setup
|
|
38
|
+
- **59 WordPress Tools** - Posts, pages, media, users, comments, categories, tags, site settings
|
|
39
|
+
- **Multi-Site Support** - Manage multiple WordPress sites from one configuration
|
|
40
|
+
- **Flexible Authentication** - App Passwords (recommended), JWT, Basic Auth, API Key
|
|
196
41
|
|
|
197
|
-
###
|
|
42
|
+
### Performance & Monitoring
|
|
198
43
|
|
|
199
|
-
**
|
|
200
|
-
- **
|
|
201
|
-
- **
|
|
202
|
-
- **Linux**: `~/.config/Claude/claude_desktop_config.json`
|
|
44
|
+
- **⚡ Intelligent Caching** - 50-70% performance improvement with multi-layer caching
|
|
45
|
+
- **📊 Real-Time Monitoring** - Performance metrics, analytics, and optimization insights
|
|
46
|
+
- **🔒 Production Ready** - Security-reviewed, 95%+ test coverage, battle-tested
|
|
203
47
|
|
|
204
|
-
|
|
205
|
-
```json
|
|
206
|
-
{
|
|
207
|
-
"mcpServers": {
|
|
208
|
-
"mcp-wordpress": {
|
|
209
|
-
"command": "npx",
|
|
210
|
-
"args": ["-y", "mcp-wordpress"],
|
|
211
|
-
"env": {
|
|
212
|
-
"WORDPRESS_SITE_URL": "https://your-site.com",
|
|
213
|
-
"WORDPRESS_USERNAME": "your-username",
|
|
214
|
-
"WORDPRESS_APP_PASSWORD": "your-app-password"
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
```
|
|
48
|
+
### Developer Experience
|
|
220
49
|
|
|
221
|
-
|
|
50
|
+
- **100% TypeScript** - Complete type safety and IntelliSense
|
|
51
|
+
- **🐳 Docker Support** - Containerized deployment for production
|
|
52
|
+
- **📚 Auto-Generated Docs** - Complete API documentation with examples
|
|
53
|
+
- **🔄 100% Backward Compatible** - Zero breaking changes
|
|
222
54
|
|
|
223
55
|
## 🌐 Multi-Site Configuration
|
|
224
56
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
### Setting Up Multi-Site Configuration
|
|
228
|
-
|
|
229
|
-
1. **Create a `mcp-wordpress.config.json` file** in your project root:
|
|
57
|
+
Perfect for agencies and developers managing multiple WordPress sites:
|
|
230
58
|
|
|
231
59
|
```json
|
|
232
60
|
{
|
|
233
61
|
"sites": [
|
|
234
62
|
{
|
|
235
|
-
"id": "
|
|
236
|
-
"name": "
|
|
63
|
+
"id": "main-site",
|
|
64
|
+
"name": "Main WordPress Site",
|
|
237
65
|
"config": {
|
|
238
66
|
"WORDPRESS_SITE_URL": "https://site1.com",
|
|
239
67
|
"WORDPRESS_USERNAME": "admin",
|
|
@@ -241,678 +69,229 @@ MCP WordPress Server supports managing multiple WordPress sites from a single co
|
|
|
241
69
|
}
|
|
242
70
|
},
|
|
243
71
|
{
|
|
244
|
-
"id": "
|
|
245
|
-
"name": "
|
|
72
|
+
"id": "client-blog",
|
|
73
|
+
"name": "Client Blog",
|
|
246
74
|
"config": {
|
|
247
|
-
"WORDPRESS_SITE_URL": "https://blog.
|
|
75
|
+
"WORDPRESS_SITE_URL": "https://client-blog.com",
|
|
248
76
|
"WORDPRESS_USERNAME": "editor",
|
|
249
|
-
"WORDPRESS_APP_PASSWORD": "yyyy yyyy yyyy yyyy yyyy yyyy"
|
|
250
|
-
"WORDPRESS_AUTH_METHOD": "app-password"
|
|
251
|
-
}
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
"id": "dev",
|
|
255
|
-
"name": "Development Site",
|
|
256
|
-
"config": {
|
|
257
|
-
"WORDPRESS_SITE_URL": "http://localhost:8080",
|
|
258
|
-
"WORDPRESS_USERNAME": "dev_user",
|
|
259
|
-
"WORDPRESS_APP_PASSWORD": "zzzz zzzz zzzz zzzz zzzz zzzz"
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
]
|
|
263
|
-
}
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
1. **Configure Claude Desktop for Multi-Site**:
|
|
267
|
-
|
|
268
|
-
```json
|
|
269
|
-
{
|
|
270
|
-
"mcpServers": {
|
|
271
|
-
"mcp-wordpress": {
|
|
272
|
-
"command": "npx",
|
|
273
|
-
"args": ["mcp-wordpress"]
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
Note: When using multi-site configuration, you don't need to specify environment variables in Claude Desktop. The server will read from your `mcp-wordpress.config.json` file.
|
|
280
|
-
|
|
281
|
-
### Using Multi-Site Tools
|
|
282
|
-
|
|
283
|
-
When you have multiple sites configured, all tools require a `site` parameter:
|
|
284
|
-
|
|
285
|
-
```text
|
|
286
|
-
# List posts from site1
|
|
287
|
-
wp_list_posts --site="site1"
|
|
288
|
-
|
|
289
|
-
# Create a post on the blog site
|
|
290
|
-
wp_create_post --site="site2" --title="New Blog Post" --content="Content here"
|
|
291
|
-
|
|
292
|
-
# Get user info from development site
|
|
293
|
-
wp_get_current_user --site="dev"
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
### Important Multi-Site Notes
|
|
297
|
-
|
|
298
|
-
- **Site IDs must be unique** - Each site needs a unique identifier
|
|
299
|
-
- **Security**: The `mcp-wordpress.config.json` file contains sensitive credentials and should NEVER be committed to version control
|
|
300
|
-
- **Default Site**: If only one site is configured, it will be used by default without needing the `--site` parameter
|
|
301
|
-
- **Authentication**: Each site can use different authentication methods (app-password, jwt, basic, api-key)
|
|
302
|
-
|
|
303
|
-
### Example: Managing Multiple Client Sites
|
|
304
|
-
|
|
305
|
-
```json
|
|
306
|
-
{
|
|
307
|
-
"sites": [
|
|
308
|
-
{
|
|
309
|
-
"id": "client-acme",
|
|
310
|
-
"name": "ACME Corporation",
|
|
311
|
-
"config": {
|
|
312
|
-
"WORDPRESS_SITE_URL": "https://acme-corp.com",
|
|
313
|
-
"WORDPRESS_USERNAME": "mcp_admin",
|
|
314
|
-
"WORDPRESS_APP_PASSWORD": "aaaa bbbb cccc dddd eeee ffff"
|
|
315
|
-
}
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
"id": "client-tech",
|
|
319
|
-
"name": "TechStartup Blog",
|
|
320
|
-
"config": {
|
|
321
|
-
"WORDPRESS_SITE_URL": "https://blog.techstartup.io",
|
|
322
|
-
"WORDPRESS_USERNAME": "content_manager",
|
|
323
|
-
"WORDPRESS_APP_PASSWORD": "gggg hhhh iiii jjjj kkkk llll"
|
|
324
|
-
}
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
"id": "client-shop",
|
|
328
|
-
"name": "Online Shop",
|
|
329
|
-
"config": {
|
|
330
|
-
"WORDPRESS_SITE_URL": "https://shop.example.com",
|
|
331
|
-
"WORDPRESS_USERNAME": "shop_admin",
|
|
332
|
-
"WORDPRESS_APP_PASSWORD": "mmmm nnnn oooo pppp qqqq rrrr",
|
|
333
|
-
"WORDPRESS_AUTH_METHOD": "jwt",
|
|
334
|
-
"WORDPRESS_JWT_SECRET": "your-jwt-secret-here"
|
|
77
|
+
"WORDPRESS_APP_PASSWORD": "yyyy yyyy yyyy yyyy yyyy yyyy"
|
|
335
78
|
}
|
|
336
79
|
}
|
|
337
80
|
]
|
|
338
81
|
}
|
|
339
82
|
```
|
|
340
83
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
```text
|
|
344
|
-
# Check posts across all client sites
|
|
345
|
-
wp_list_posts --site="client-acme" --per_page=5
|
|
346
|
-
wp_list_posts --site="client-tech" --per_page=5
|
|
347
|
-
wp_list_posts --site="client-shop" --per_page=5
|
|
348
|
-
|
|
349
|
-
# Update content on specific sites
|
|
350
|
-
wp_update_post --site="client-acme" --id=123 --title="Updated Title"
|
|
351
|
-
|
|
352
|
-
# Manage media across sites
|
|
353
|
-
wp_list_media --site="client-shop" --media_type="image"
|
|
354
|
-
```
|
|
355
|
-
|
|
356
|
-
## 🛠 Build System
|
|
357
|
-
|
|
358
|
-
### TypeScript Build
|
|
359
|
-
|
|
360
|
-
```bash
|
|
361
|
-
# Compile
|
|
362
|
-
npm run build
|
|
363
|
-
|
|
364
|
-
# Watch mode
|
|
365
|
-
npm run build:watch
|
|
366
|
-
|
|
367
|
-
# Type checking
|
|
368
|
-
npm run typecheck
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
### Development
|
|
372
|
-
|
|
373
|
-
```bash
|
|
374
|
-
# Development mode with debug output
|
|
375
|
-
npm run dev
|
|
376
|
-
|
|
377
|
-
# Check status
|
|
378
|
-
npm run status
|
|
84
|
+
Use with site parameter: `wp_list_posts --site="main-site"`
|
|
379
85
|
|
|
380
|
-
|
|
381
|
-
npm run setup
|
|
382
|
-
```
|
|
86
|
+
📖 **[Complete Multi-Site Setup Guide](docs/user-guides/NPM_SETUP.md#multi-site-configuration)**
|
|
383
87
|
|
|
384
|
-
## 🔐 Authentication
|
|
88
|
+
## 🔐 Authentication Setup
|
|
385
89
|
|
|
386
90
|
### WordPress Application Passwords (Recommended)
|
|
387
91
|
|
|
388
92
|
1. **WordPress Admin** → **Users** → **Profile**
|
|
389
93
|
2. Scroll to **Application Passwords**
|
|
390
|
-
3. Enter name
|
|
94
|
+
3. Enter name: "MCP WordPress Server"
|
|
391
95
|
4. Click **Add New Application Password**
|
|
392
|
-
5. Copy generated password
|
|
96
|
+
5. Copy the generated password
|
|
393
97
|
|
|
394
|
-
### Alternative
|
|
98
|
+
### Alternative Methods
|
|
395
99
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
WORDPRESS_JWT_SECRET=your-jwt-secret
|
|
100
|
+
- **JWT Authentication** - With JWT plugin
|
|
101
|
+
- **Basic Authentication** - Username/password (dev only)
|
|
102
|
+
- **API Key Authentication** - With API Key plugin
|
|
400
103
|
|
|
401
|
-
|
|
402
|
-
WORDPRESS_AUTH_METHOD=basic
|
|
403
|
-
WORDPRESS_PASSWORD=your-actual-password
|
|
404
|
-
|
|
405
|
-
# API Key Authentication (requires API Key plugin)
|
|
406
|
-
WORDPRESS_AUTH_METHOD=api-key
|
|
407
|
-
WORDPRESS_API_KEY=your-api-key
|
|
408
|
-
```
|
|
104
|
+
📖 **[Complete Authentication Guide](docs/user-guides/NPX_SETUP.md#authentication)**
|
|
409
105
|
|
|
410
106
|
## 📋 Available Tools (59 Tools)
|
|
411
107
|
|
|
412
|
-
###
|
|
413
|
-
|
|
414
|
-
- `wp_list_posts` - List and filter blog posts
|
|
415
|
-
- `wp_get_post` - Get specific post
|
|
416
|
-
- `wp_create_post` - Create new posts
|
|
417
|
-
- `wp_update_post` - Edit posts
|
|
418
|
-
- `wp_delete_post` - Delete posts
|
|
419
|
-
- `wp_get_post_revisions` - Get post revisions
|
|
420
|
-
|
|
421
|
-
### 📄 Pages (6 Tools)
|
|
422
|
-
|
|
423
|
-
- `wp_list_pages` - List pages
|
|
424
|
-
- `wp_get_page` - Get specific page
|
|
425
|
-
- `wp_create_page` - Create new pages
|
|
426
|
-
- `wp_update_page` - Edit pages
|
|
427
|
-
- `wp_delete_page` - Delete pages
|
|
428
|
-
- `wp_get_page_revisions` - Get page revisions
|
|
429
|
-
|
|
430
|
-
### 🖼️ Media (6 Tools)
|
|
431
|
-
|
|
432
|
-
- `wp_list_media` - Browse media library
|
|
433
|
-
- `wp_get_media` - Get media details
|
|
434
|
-
- `wp_upload_media` - Upload files
|
|
435
|
-
- `wp_update_media` - Edit media metadata
|
|
436
|
-
- `wp_delete_media` - Delete media
|
|
437
|
-
- `wp_get_media_sizes` - Get available image sizes
|
|
438
|
-
|
|
439
|
-
### 👥 Users (6 Tools)
|
|
440
|
-
|
|
441
|
-
- `wp_list_users` - List users
|
|
442
|
-
- `wp_get_user` - Get user details
|
|
443
|
-
- `wp_create_user` - Create new users
|
|
444
|
-
- `wp_update_user` - Edit user profiles
|
|
445
|
-
- `wp_delete_user` - Delete users
|
|
446
|
-
- `wp_get_current_user` - Get current user
|
|
447
|
-
|
|
448
|
-
### 💬 Comments (7 Tools)
|
|
449
|
-
|
|
450
|
-
- `wp_list_comments` - List comments
|
|
451
|
-
- `wp_get_comment` - Get comment details
|
|
452
|
-
- `wp_create_comment` - Create new comments
|
|
453
|
-
- `wp_update_comment` - Edit comments
|
|
454
|
-
- `wp_delete_comment` - Delete comments
|
|
455
|
-
- `wp_approve_comment` - Approve comments
|
|
456
|
-
- `wp_spam_comment` - Mark comments as spam
|
|
457
|
-
|
|
458
|
-
### 🏷️ Taxonomies (10 Tools)
|
|
459
|
-
|
|
460
|
-
- `wp_list_categories` - List categories
|
|
461
|
-
- `wp_get_category` - Get category details
|
|
462
|
-
- `wp_create_category` - Create new categories
|
|
463
|
-
- `wp_update_category` - Edit categories
|
|
464
|
-
- `wp_delete_category` - Delete categories
|
|
465
|
-
- `wp_list_tags` - List tags
|
|
466
|
-
- `wp_get_tag` - Get tag details
|
|
467
|
-
- `wp_create_tag` - Create new tags
|
|
468
|
-
- `wp_update_tag` - Edit tags
|
|
469
|
-
- `wp_delete_tag` - Delete tags
|
|
470
|
-
|
|
471
|
-
### ⚙️ Site Management (7 Tools)
|
|
472
|
-
|
|
473
|
-
- `wp_get_site_settings` - Get site settings
|
|
474
|
-
- `wp_update_site_settings` - Update site settings
|
|
475
|
-
- `wp_get_site_stats` - Get site statistics
|
|
476
|
-
- `wp_search_site` - Site-wide search
|
|
477
|
-
- `wp_get_application_passwords` - List app passwords
|
|
478
|
-
- `wp_create_application_password` - Create new app passwords
|
|
479
|
-
- `wp_delete_application_password` - Delete app passwords
|
|
480
|
-
|
|
481
|
-
### 🔐 Authentication (6 Tools)
|
|
482
|
-
|
|
483
|
-
- `wp_test_auth` - Test authentication
|
|
484
|
-
- `wp_get_auth_status` - Get authentication status
|
|
485
|
-
- `wp_start_oauth_flow` - Start OAuth flow
|
|
486
|
-
- `wp_complete_oauth_flow` - Complete OAuth flow
|
|
487
|
-
- `wp_refresh_oauth_token` - Refresh OAuth token
|
|
488
|
-
- `wp_switch_auth_method` - Switch authentication method
|
|
489
|
-
|
|
490
|
-
### ⚡ Cache Management (4 Tools)
|
|
491
|
-
|
|
492
|
-
- `wp_cache_stats` - Get real-time cache performance statistics
|
|
493
|
-
- `wp_cache_clear` - Clear cache entries with optional pattern matching
|
|
494
|
-
- `wp_cache_warm` - Pre-populate cache with essential data
|
|
495
|
-
- `wp_cache_info` - Get detailed cache configuration and status
|
|
496
|
-
|
|
497
|
-
### 📊 Performance Monitoring (6 Tools)
|
|
498
|
-
|
|
499
|
-
- `wp_performance_stats` - Get real-time performance statistics and metrics
|
|
500
|
-
- `wp_performance_history` - Get historical performance data and trends
|
|
501
|
-
- `wp_performance_benchmark` - Compare current performance against industry benchmarks
|
|
502
|
-
- `wp_performance_alerts` - Get performance alerts and anomaly detection results
|
|
503
|
-
- `wp_performance_optimize` - Get optimization recommendations and insights
|
|
504
|
-
- `wp_performance_export` - Export comprehensive performance report
|
|
505
|
-
|
|
506
|
-
## 🧪 Testing
|
|
108
|
+
### Content Management
|
|
507
109
|
|
|
508
|
-
|
|
110
|
+
- **📝 Posts** (6 tools) - Create, edit, delete, list posts and revisions
|
|
111
|
+
- **📄 Pages** (6 tools) - Manage static pages and revisions
|
|
112
|
+
- **🖼️ Media** (6 tools) - Upload, manage media library and files
|
|
509
113
|
|
|
510
|
-
|
|
511
|
-
- **TypeScript Build Tests**: 21/21 passed (100%)
|
|
512
|
-
- **Security Tests**: 40/40 passed (100%) - Comprehensive vulnerability testing
|
|
513
|
-
- **Configuration Tests**: 27/27 passed (100%) - Multi-site validation
|
|
514
|
-
- **Property-Based Tests**: 12/12 passed (100%) - Generative testing
|
|
515
|
-
- **Performance Tests**: 8/8 passed (100%) - Regression detection
|
|
516
|
-
- **Contract Tests**: Available via dedicated command when needed
|
|
517
|
-
- **Overall Success Rate**: 100% - All critical functionality verified
|
|
114
|
+
### User & Community
|
|
518
115
|
|
|
519
|
-
|
|
116
|
+
- **👥 Users** (6 tools) - User management and profiles
|
|
117
|
+
- **💬 Comments** (7 tools) - Comment moderation and management
|
|
118
|
+
- **🏷️ Taxonomies** (10 tools) - Categories and tags management
|
|
520
119
|
|
|
521
|
-
|
|
522
|
-
# Run all tests (improved)
|
|
523
|
-
npm test
|
|
120
|
+
### Site Management
|
|
524
121
|
|
|
525
|
-
|
|
526
|
-
|
|
122
|
+
- **⚙️ Site Settings** (7 tools) - Site configuration and statistics
|
|
123
|
+
- **🔐 Authentication** (6 tools) - Auth testing and management
|
|
124
|
+
- **⚡ Cache Management** (4 tools) - Performance caching control
|
|
125
|
+
- **📊 Performance Monitoring** (6 tools) - Real-time metrics and optimization
|
|
527
126
|
|
|
528
|
-
|
|
529
|
-
npm run test:coverage
|
|
127
|
+
📖 **[Complete Tool Documentation](docs/api/README.md)**
|
|
530
128
|
|
|
531
|
-
|
|
532
|
-
npm run test:fast
|
|
129
|
+
## 🤖 Claude Desktop Integration
|
|
533
130
|
|
|
534
|
-
|
|
535
|
-
npm run test:security # Security tests
|
|
536
|
-
npm run test:config # Configuration tests
|
|
537
|
-
npm run test:property # Property-based tests
|
|
538
|
-
npm run test:contracts # Contract tests
|
|
539
|
-
npm run test:performance # Performance regression tests
|
|
131
|
+
### Quick Prompts for Claude
|
|
540
132
|
|
|
541
|
-
|
|
542
|
-
npm run test:mcp # MCP protocol tests
|
|
543
|
-
npm run test:tools # Tool functionality tests
|
|
544
|
-
npm run test:auth # Authentication tests
|
|
133
|
+
**Setup Help:**
|
|
545
134
|
|
|
546
|
-
|
|
547
|
-
|
|
135
|
+
```text
|
|
136
|
+
Set up MCP WordPress using NPX. My site: https://mysite.com, username: myuser. Help with application password creation and Claude Desktop configuration.
|
|
137
|
+
```
|
|
548
138
|
|
|
549
|
-
|
|
550
|
-
npm run test:watch
|
|
139
|
+
**Content Management:**
|
|
551
140
|
|
|
552
|
-
|
|
553
|
-
|
|
141
|
+
```text
|
|
142
|
+
List my recent WordPress posts, then help me create a new post about [topic] with SEO-optimized content.
|
|
554
143
|
```
|
|
555
144
|
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
The project now includes a complete Docker test environment for reliable testing:
|
|
145
|
+
**Site Analysis:**
|
|
559
146
|
|
|
560
|
-
```
|
|
561
|
-
|
|
562
|
-
|
|
147
|
+
```text
|
|
148
|
+
Check my WordPress site performance, cache statistics, and provide optimization recommendations.
|
|
149
|
+
```
|
|
563
150
|
|
|
564
|
-
|
|
565
|
-
npm run test:with-env
|
|
151
|
+
### Configuration Example
|
|
566
152
|
|
|
567
|
-
|
|
568
|
-
|
|
153
|
+
```json
|
|
154
|
+
{
|
|
155
|
+
"mcpServers": {
|
|
156
|
+
"mcp-wordpress": {
|
|
157
|
+
"command": "npx",
|
|
158
|
+
"args": ["-y", "mcp-wordpress"],
|
|
159
|
+
"env": {
|
|
160
|
+
"WORDPRESS_SITE_URL": "https://your-site.com",
|
|
161
|
+
"WORDPRESS_USERNAME": "your-username",
|
|
162
|
+
"WORDPRESS_APP_PASSWORD": "your-app-password"
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
569
167
|
```
|
|
570
168
|
|
|
571
|
-
|
|
169
|
+
📖 **[Complete Claude Desktop Setup](docs/user-guides/NPX_SETUP.md)**
|
|
170
|
+
|
|
171
|
+
## 🧪 Testing & Status
|
|
172
|
+
|
|
173
|
+
### Current Test Status ✅
|
|
572
174
|
|
|
573
|
-
-
|
|
574
|
-
-
|
|
575
|
-
-
|
|
576
|
-
-
|
|
175
|
+
- **Main Test Suite**: 207/207 passed (100%)
|
|
176
|
+
- **Security Tests**: 40/40 passed (100%)
|
|
177
|
+
- **Performance Tests**: 8/8 passed (100%)
|
|
178
|
+
- **CI/CD Pipeline**: Fully functional
|
|
577
179
|
|
|
578
|
-
|
|
180
|
+
### Test Your Installation
|
|
579
181
|
|
|
580
182
|
```bash
|
|
581
183
|
# Check connection status
|
|
582
184
|
npm run status
|
|
583
185
|
|
|
584
|
-
#
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
# Lint code
|
|
588
|
-
npm run lint
|
|
589
|
-
|
|
590
|
-
# Auto-fix linting errors
|
|
591
|
-
npm run lint:fix
|
|
592
|
-
```
|
|
186
|
+
# Run full test suite
|
|
187
|
+
npm test
|
|
593
188
|
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
```diagram
|
|
597
|
-
mcp-wordpress/
|
|
598
|
-
├── src/ # TypeScript source code
|
|
599
|
-
│ ├── index.ts # Main MCP server
|
|
600
|
-
│ ├── server.ts # Server compatibility
|
|
601
|
-
│ ├── types/ # TypeScript definitions
|
|
602
|
-
│ │ ├── wordpress.ts # WordPress API types
|
|
603
|
-
│ │ ├── mcp.ts # MCP protocol types
|
|
604
|
-
│ │ ├── client.ts # Client interface types
|
|
605
|
-
│ │ └── index.ts # Type exports
|
|
606
|
-
│ ├── client/ # WordPress API client
|
|
607
|
-
│ │ ├── api.ts # HTTP client
|
|
608
|
-
│ │ └── auth.ts # Authentication
|
|
609
|
-
│ ├── tools/ # MCP tool implementations
|
|
610
|
-
│ │ ├── posts.ts # Post management
|
|
611
|
-
│ │ ├── pages.ts # Page management
|
|
612
|
-
│ │ ├── media.ts # Media management
|
|
613
|
-
│ │ ├── users.ts # User management
|
|
614
|
-
│ │ ├── comments.ts # Comment management
|
|
615
|
-
│ │ ├── taxonomies.ts # Categories/Tags
|
|
616
|
-
│ │ ├── site.ts # Site settings
|
|
617
|
-
│ │ └── auth.ts # Authentication
|
|
618
|
-
│ └── utils/ # Utility functions
|
|
619
|
-
│ └── debug.ts # Debug logger
|
|
620
|
-
├── dist/ # Compiled JavaScript files
|
|
621
|
-
├── bin/ # Utility scripts
|
|
622
|
-
│ ├── setup.js # Setup wizard
|
|
623
|
-
│ └── status.js # Status checker
|
|
624
|
-
├── tests/ # Test suite
|
|
625
|
-
├── scripts/ # Build and test scripts
|
|
626
|
-
├── tsconfig.json # TypeScript configuration
|
|
627
|
-
├── jest.config.json # Jest test configuration
|
|
628
|
-
└── package.json # Node.js project configuration
|
|
189
|
+
# Quick validation
|
|
190
|
+
npm run test:fast
|
|
629
191
|
```
|
|
630
192
|
|
|
631
|
-
## 💡 TypeScript Features
|
|
632
|
-
|
|
633
|
-
- **Complete Type Safety** - Compile-time validation
|
|
634
|
-
- **IntelliSense Support** - Better IDE integration
|
|
635
|
-
- **Type-safe API Client** - Typed HTTP methods
|
|
636
|
-
- **Comprehensive WordPress Types** - 400+ lines of precise definitions
|
|
637
|
-
- **MCP Protocol Types** - Tool definitions and handlers
|
|
638
|
-
- **Enhanced Error Handling** - Typed exceptions
|
|
639
|
-
- **Source Maps** - Debugging support
|
|
640
|
-
|
|
641
|
-
## 🔧 WordPress Requirements
|
|
642
|
-
|
|
643
|
-
- **WordPress 5.0+** with REST API enabled
|
|
644
|
-
- **HTTPS** (recommended for production)
|
|
645
|
-
- **User with appropriate permissions**
|
|
646
|
-
- **Application Passwords** enabled (WordPress 5.6+)
|
|
647
|
-
|
|
648
|
-
### WordPress User Roles
|
|
649
|
-
|
|
650
|
-
| Role | Access |
|
|
651
|
-
|------|--------|
|
|
652
|
-
| **Administrator** | Full access to all functions |
|
|
653
|
-
| **Editor** | Posts, pages, comments, media |
|
|
654
|
-
| **Author** | Own posts and media |
|
|
655
|
-
| **Contributor** | Own posts (drafts only) |
|
|
656
|
-
| **Subscriber** | Read only |
|
|
657
|
-
|
|
658
193
|
## 🐛 Troubleshooting
|
|
659
194
|
|
|
660
195
|
### Common Issues
|
|
661
196
|
|
|
662
197
|
1. **"Cannot connect to WordPress"**
|
|
663
|
-
-
|
|
664
|
-
-
|
|
665
|
-
- Test: `curl https://your-site.com/wp-json/wp/v2/`
|
|
198
|
+
- Verify `WORDPRESS_SITE_URL`
|
|
199
|
+
- Test REST API: `curl https://your-site.com/wp-json/wp/v2/`
|
|
666
200
|
|
|
667
201
|
2. **"Authentication failed"**
|
|
668
|
-
-
|
|
202
|
+
- Check username and application password
|
|
669
203
|
- Ensure Application Passwords are enabled
|
|
670
|
-
-
|
|
204
|
+
- Run `npm run setup` to reconfigure
|
|
671
205
|
|
|
672
|
-
3. **"
|
|
673
|
-
-
|
|
674
|
-
-
|
|
206
|
+
3. **"Tools not appearing in Claude"**
|
|
207
|
+
- Restart Claude Desktop after configuration
|
|
208
|
+
- Check Claude Desktop config file format
|
|
675
209
|
|
|
676
|
-
###
|
|
210
|
+
### Get Help
|
|
677
211
|
|
|
678
212
|
```bash
|
|
213
|
+
# Debug mode
|
|
679
214
|
DEBUG=true npm run dev
|
|
680
|
-
```
|
|
681
|
-
|
|
682
|
-
## 📚 API Documentation
|
|
683
|
-
|
|
684
|
-
- [WordPress REST API](https://developer.wordpress.org/rest-api/)
|
|
685
|
-
- [Model Context Protocol](https://modelcontextprotocol.io/)
|
|
686
|
-
- [TypeScript Handbook](https://www.typescriptlang.org/docs/)
|
|
687
|
-
|
|
688
|
-
## 🐳 Docker Support
|
|
689
|
-
|
|
690
|
-
Docker support with production-ready containers and Claude Desktop integration.
|
|
691
215
|
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
```bash
|
|
695
|
-
# Single-site with environment variables
|
|
696
|
-
docker run --rm -i \
|
|
697
|
-
-e WORDPRESS_SITE_URL=https://your-site.com \
|
|
698
|
-
-e WORDPRESS_USERNAME=your-username \
|
|
699
|
-
-e WORDPRESS_APP_PASSWORD=your-app-password \
|
|
700
|
-
docdyhr/mcp-wordpress:latest
|
|
701
|
-
|
|
702
|
-
# Multi-site with config file
|
|
703
|
-
docker run --rm -i \
|
|
704
|
-
-v ./mcp-wordpress.config.json:/app/mcp-wordpress.config.json:ro \
|
|
705
|
-
docdyhr/mcp-wordpress:latest
|
|
706
|
-
```
|
|
707
|
-
|
|
708
|
-
### Claude Desktop Docker Integration
|
|
709
|
-
|
|
710
|
-
**Single-Site:**
|
|
711
|
-
```json
|
|
712
|
-
{
|
|
713
|
-
"mcpServers": {
|
|
714
|
-
"mcp-wordpress": {
|
|
715
|
-
"command": "docker",
|
|
716
|
-
"args": [
|
|
717
|
-
"run", "--rm", "-i",
|
|
718
|
-
"-e", "WORDPRESS_SITE_URL=https://your-site.com",
|
|
719
|
-
"-e", "WORDPRESS_USERNAME=your-username",
|
|
720
|
-
"-e", "WORDPRESS_APP_PASSWORD=your-app-password",
|
|
721
|
-
"docdyhr/mcp-wordpress:latest"
|
|
722
|
-
]
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
```
|
|
727
|
-
|
|
728
|
-
**Multi-Site:**
|
|
729
|
-
```json
|
|
730
|
-
{
|
|
731
|
-
"mcpServers": {
|
|
732
|
-
"mcp-wordpress": {
|
|
733
|
-
"command": "docker",
|
|
734
|
-
"args": [
|
|
735
|
-
"run", "--rm", "-i",
|
|
736
|
-
"-v", "/path/to/mcp-wordpress.config.json:/app/mcp-wordpress.config.json:ro",
|
|
737
|
-
"docdyhr/mcp-wordpress:latest"
|
|
738
|
-
]
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
```
|
|
743
|
-
|
|
744
|
-
**📖 Complete Docker Guide**: [docs/user-guides/DOCKER_SETUP.md](docs/user-guides/DOCKER_SETUP.md)
|
|
745
|
-
|
|
746
|
-
## 🧪 Contract Testing with Live WordPress
|
|
747
|
-
|
|
748
|
-
Test the MCP server against a real WordPress instance using our automated testing setup:
|
|
216
|
+
# Connection test
|
|
217
|
+
npm run status
|
|
749
218
|
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
npm run test:contracts:live
|
|
219
|
+
# Re-run setup wizard
|
|
220
|
+
npm run setup
|
|
753
221
|
```
|
|
754
222
|
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
- 🐳 Start isolated WordPress + MySQL containers (port 8081)
|
|
758
|
-
- ⚙️ Auto-configure WordPress with test data and authentication
|
|
759
|
-
- 🧪 Run contract tests against the live WordPress API
|
|
760
|
-
- 🧹 Clean up automatically when done
|
|
223
|
+
## 📚 Documentation
|
|
761
224
|
|
|
762
|
-
|
|
225
|
+
### User Guides
|
|
763
226
|
|
|
764
|
-
- **
|
|
765
|
-
- **
|
|
766
|
-
- **
|
|
767
|
-
- **
|
|
227
|
+
- **[NPX Setup](docs/user-guides/NPX_SETUP.md)** - Quick start guide
|
|
228
|
+
- **[NPM Setup](docs/user-guides/NPM_SETUP.md)** - Local development
|
|
229
|
+
- **[Docker Setup](docs/user-guides/DOCKER_SETUP.md)** - Production deployment
|
|
230
|
+
- **[DTX Setup](docs/user-guides/DTX_SETUP.md)** - Desktop extension
|
|
768
231
|
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
```bash
|
|
772
|
-
# Test setup phase only
|
|
773
|
-
bash scripts/test-setup-only.sh
|
|
774
|
-
|
|
775
|
-
# Use existing WordPress instance
|
|
776
|
-
export WORDPRESS_TEST_URL="https://your-wordpress-site.com"
|
|
777
|
-
export WORDPRESS_USERNAME="your-username"
|
|
778
|
-
export WORDPRESS_APP_PASSWORD="your-app-password"
|
|
779
|
-
export PACT_LIVE_TESTING="true"
|
|
780
|
-
npm run test:contracts
|
|
781
|
-
```
|
|
232
|
+
### Technical Documentation
|
|
782
233
|
|
|
783
|
-
|
|
234
|
+
- **[API Documentation](docs/api/README.md)** - Complete tool reference
|
|
235
|
+
- **[Performance Guide](docs/PERFORMANCE_MONITORING.md)** - Monitoring and optimization
|
|
236
|
+
- **[Caching Guide](docs/CACHING.md)** - Cache configuration and management
|
|
237
|
+
- **[Security Guide](docs/SECURITY_TESTING.md)** - Security best practices
|
|
784
238
|
|
|
785
|
-
|
|
239
|
+
### Developer Resources
|
|
786
240
|
|
|
787
|
-
|
|
241
|
+
- **[Development Guide](docs/developer/README.md)** - Contributing and development
|
|
242
|
+
- **[API Reference](docs/developer/API_REFERENCE.md)** - Technical API details
|
|
243
|
+
- **[Architecture Guide](docs/developer/ARCHITECTURE.md)** - System architecture
|
|
244
|
+
- **[Testing Guide](docs/developer/TESTING.md)** - Test suite and CI/CD
|
|
788
245
|
|
|
789
|
-
|
|
790
|
-
- Comprehensive metrics collection (response times, cache hit rates, system resources)
|
|
791
|
-
- Historical performance analysis with trend detection
|
|
792
|
-
- Industry benchmark comparisons with optimization recommendations
|
|
793
|
-
- Smart alerts and anomaly detection
|
|
794
|
-
- Comprehensive performance reports with export options
|
|
795
|
-
- AI-powered optimization engine for performance improvements
|
|
796
|
-
- ⚡ **Intelligent Caching System**
|
|
797
|
-
- 50-70% performance improvement with reduced API calls
|
|
798
|
-
- Multi-layer caching architecture with intelligent invalidation
|
|
799
|
-
- Site-specific cache isolation for multi-site installations
|
|
800
|
-
- New MCP tools for cache performance monitoring and management
|
|
801
|
-
- Sub-millisecond response times for cache hits
|
|
802
|
-
- 📚 **Auto-Generated Documentation**
|
|
803
|
-
- Complete API documentation for all 59 tools with examples and usage guides
|
|
804
|
-
- Machine-readable OpenAPI specification for integration
|
|
805
|
-
- Automated CI/CD pipeline for documentation updates
|
|
806
|
-
- Comprehensive documentation quality validation
|
|
807
|
-
- Multi-format output including Markdown, JSON, and OpenAPI
|
|
808
|
-
- 🐳 **Docker Containerization**
|
|
809
|
-
- Production-ready Docker images for easy deployment
|
|
810
|
-
- Docker Compose setup for local development
|
|
811
|
-
- Flexible environment configuration via variables
|
|
812
|
-
- One-command deployment to any Docker environment
|
|
246
|
+
## 🔧 Requirements
|
|
813
247
|
|
|
814
|
-
|
|
248
|
+
- **WordPress 5.0+** with REST API enabled
|
|
249
|
+
- **HTTPS recommended** for production
|
|
250
|
+
- **User with appropriate permissions**
|
|
251
|
+
- **Application Passwords enabled** (WordPress 5.6+)
|
|
815
252
|
|
|
816
|
-
|
|
253
|
+
### WordPress User Roles
|
|
817
254
|
|
|
818
|
-
|
|
255
|
+
| Role | Access |
|
|
256
|
+
| ----------------- | ----------------------------- |
|
|
257
|
+
| **Administrator** | Full access to all functions |
|
|
258
|
+
| **Editor** | Posts, pages, comments, media |
|
|
259
|
+
| **Author** | Own posts and media |
|
|
260
|
+
| **Contributor** | Own posts (drafts only) |
|
|
261
|
+
| **Subscriber** | Read only |
|
|
819
262
|
|
|
820
|
-
|
|
263
|
+
## 📦 Installation Options
|
|
821
264
|
|
|
822
|
-
|
|
265
|
+
### NPM Package
|
|
823
266
|
|
|
824
267
|
```bash
|
|
825
|
-
#
|
|
268
|
+
# Global installation
|
|
826
269
|
npm install -g mcp-wordpress
|
|
827
270
|
|
|
828
|
-
#
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
# Use with npx (no installation)
|
|
832
|
-
npx mcp-wordpress
|
|
271
|
+
# Direct usage (recommended)
|
|
272
|
+
npx -y mcp-wordpress
|
|
833
273
|
```
|
|
834
274
|
|
|
835
|
-
|
|
275
|
+
### Docker Images
|
|
836
276
|
|
|
837
277
|
```bash
|
|
838
|
-
# Latest
|
|
278
|
+
# Latest version
|
|
839
279
|
docker pull docdyhr/mcp-wordpress:latest
|
|
840
280
|
|
|
841
281
|
# Specific version
|
|
842
|
-
docker pull docdyhr/mcp-wordpress:1.
|
|
843
|
-
|
|
844
|
-
# Test container (interactive)
|
|
845
|
-
docker run --rm -i docdyhr/mcp-wordpress:latest
|
|
846
|
-
```
|
|
847
|
-
|
|
848
|
-
### 🏷️ Release Process
|
|
849
|
-
|
|
850
|
-
**Automated Releases:**
|
|
851
|
-
|
|
852
|
-
- Releases are automatically created when conventional commits are pushed to the `main` branch
|
|
853
|
-
- Semantic versioning determines the version bump automatically
|
|
854
|
-
- NPM and Docker Hub publishing happens automatically on release
|
|
855
|
-
|
|
856
|
-
**Conventional Commit Format:**
|
|
857
|
-
|
|
858
|
-
```bash
|
|
859
|
-
# Patch release (1.2.2 → 1.2.4)
|
|
860
|
-
fix: resolve authentication timeout issue
|
|
861
|
-
|
|
862
|
-
# Minor release (1.2.2 → 1.3.0)
|
|
863
|
-
feat: add new performance monitoring tools
|
|
864
|
-
|
|
865
|
-
# Major release (1.2.2 → 2.0.0)
|
|
866
|
-
feat!: redesign MCP tool interface
|
|
867
|
-
BREAKING CHANGE: tool parameter structure has changed
|
|
282
|
+
docker pull docdyhr/mcp-wordpress:1.3.1
|
|
868
283
|
```
|
|
869
284
|
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
```bash
|
|
873
|
-
# Test release locally
|
|
874
|
-
npm run release:dry
|
|
875
|
-
|
|
876
|
-
# Create release manually (requires proper permissions)
|
|
877
|
-
npm run release
|
|
878
|
-
```
|
|
879
|
-
|
|
880
|
-
### 📋 Release Checklist
|
|
881
|
-
|
|
882
|
-
For contributors planning releases:
|
|
883
|
-
|
|
884
|
-
1. **Pre-Release Validation:**
|
|
885
|
-
- ✅ All tests passing (`npm test`)
|
|
886
|
-
- ✅ Documentation updated
|
|
887
|
-
- ✅ Performance benchmarks within acceptable range
|
|
888
|
-
- ✅ Security audit clean (`npm audit`)
|
|
889
|
-
|
|
890
|
-
2. **Commit with Conventional Format:**
|
|
891
|
-
|
|
892
|
-
```bash
|
|
893
|
-
git add .
|
|
894
|
-
git commit -m "feat: add new functionality"
|
|
895
|
-
git push origin main
|
|
896
|
-
```
|
|
897
|
-
|
|
898
|
-
3. **Automated Process Handles:**
|
|
899
|
-
- 📝 Generate release notes
|
|
900
|
-
- 🏷️ Create GitHub release
|
|
901
|
-
- 📦 Publish to NPM with provenance
|
|
902
|
-
- 🐳 Build and push Docker images (multi-arch)
|
|
903
|
-
- 📚 Update CHANGELOG.md
|
|
904
|
-
- 🔗 Update Docker Hub description
|
|
905
|
-
|
|
906
|
-
### 🌍 Distribution Channels
|
|
285
|
+
### Distribution Channels
|
|
907
286
|
|
|
908
287
|
- **NPM:** [`mcp-wordpress`](https://www.npmjs.com/package/mcp-wordpress)
|
|
909
288
|
- **Docker Hub:** [`docdyhr/mcp-wordpress`](https://hub.docker.com/r/docdyhr/mcp-wordpress)
|
|
910
|
-
- **GitHub
|
|
911
|
-
|
|
912
|
-
---
|
|
289
|
+
- **GitHub:** [Latest releases](https://github.com/docdyhr/mcp-wordpress/releases)
|
|
913
290
|
|
|
914
291
|
## 🙏 Acknowledgments
|
|
915
292
|
|
|
916
|
-
Special thanks to **[Stephan Ferraro](https://github.com/ferraro)** for the upstream
|
|
293
|
+
Special thanks to **[Stephan Ferraro](https://github.com/ferraro)** for the upstream project that inspired this implementation.
|
|
294
|
+
|
|
295
|
+
---
|
|
917
296
|
|
|
918
|
-
|
|
297
|
+
**Ready to get started?** Choose your setup method above and follow the guide - you'll be managing WordPress with Claude in minutes! 🚀
|