mcp-wordpress 1.2.2 → 1.3.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 +210 -182
- package/dist/cache/CacheInvalidation.d.ts +3 -3
- package/dist/cache/CacheInvalidation.d.ts.map +1 -1
- package/dist/cache/CacheInvalidation.js +119 -119
- package/dist/cache/CacheInvalidation.js.map +1 -1
- package/dist/cache/CacheManager.d.ts +5 -0
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.js +26 -16
- package/dist/cache/CacheManager.js.map +1 -1
- package/dist/cache/HttpCacheWrapper.d.ts +1 -1
- package/dist/cache/HttpCacheWrapper.d.ts.map +1 -1
- package/dist/cache/HttpCacheWrapper.js +29 -29
- package/dist/cache/HttpCacheWrapper.js.map +1 -1
- package/dist/cache/__tests__/CacheInvalidation.test.js +96 -94
- package/dist/cache/__tests__/CacheInvalidation.test.js.map +1 -1
- package/dist/cache/__tests__/CacheManager.test.js +113 -113
- package/dist/cache/__tests__/CacheManager.test.js.map +1 -1
- package/dist/cache/__tests__/CachedWordPressClient.test.js +102 -99
- package/dist/cache/__tests__/CachedWordPressClient.test.js.map +1 -1
- package/dist/cache/__tests__/HttpCacheWrapper.test.js +98 -95
- package/dist/cache/__tests__/HttpCacheWrapper.test.js.map +1 -1
- package/dist/cache/index.d.ts +7 -7
- package/dist/cache/index.d.ts.map +1 -1
- package/dist/cache/index.js +4 -4
- package/dist/cache/index.js.map +1 -1
- package/dist/client/CachedWordPressClient.d.ts +4 -4
- package/dist/client/CachedWordPressClient.d.ts.map +1 -1
- package/dist/client/CachedWordPressClient.js +55 -51
- package/dist/client/CachedWordPressClient.js.map +1 -1
- package/dist/client/api.d.ts +10 -10
- package/dist/client/api.js +158 -158
- package/dist/client/api.js.map +1 -1
- package/dist/client/auth.d.ts +2 -2
- package/dist/client/auth.js +72 -72
- package/dist/client/managers/AuthenticationManager.d.ts +2 -2
- package/dist/client/managers/AuthenticationManager.js +46 -46
- package/dist/client/managers/BaseManager.d.ts +1 -1
- package/dist/client/managers/BaseManager.js +9 -9
- package/dist/client/managers/RequestManager.d.ts +5 -3
- package/dist/client/managers/RequestManager.d.ts.map +1 -1
- package/dist/client/managers/RequestManager.js +39 -19
- package/dist/client/managers/RequestManager.js.map +1 -1
- package/dist/client/managers/index.d.ts +3 -3
- package/dist/client/managers/index.js +3 -3
- package/dist/config/ConfigurationSchema.d.ts +2 -2
- package/dist/config/ConfigurationSchema.d.ts.map +1 -1
- package/dist/config/ConfigurationSchema.js +40 -40
- package/dist/config/ConfigurationSchema.js.map +1 -1
- package/dist/config/ServerConfiguration.d.ts +2 -2
- package/dist/config/ServerConfiguration.js +35 -35
- package/dist/config/ServerConfiguration.js.map +1 -1
- package/dist/docs/DocumentationGenerator.d.ts.map +1 -1
- package/dist/docs/DocumentationGenerator.js +296 -255
- package/dist/docs/DocumentationGenerator.js.map +1 -1
- package/dist/docs/MarkdownFormatter.d.ts +1 -1
- package/dist/docs/MarkdownFormatter.d.ts.map +1 -1
- package/dist/docs/MarkdownFormatter.js +60 -51
- package/dist/docs/MarkdownFormatter.js.map +1 -1
- package/dist/docs/index.d.ts +3 -3
- package/dist/docs/index.d.ts.map +1 -1
- package/dist/docs/index.js +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/dist/mcp-wordpress-1.3.0.tgz +0 -0
- package/dist/performance/MetricsCollector.d.ts +3 -3
- package/dist/performance/MetricsCollector.d.ts.map +1 -1
- package/dist/performance/MetricsCollector.js +33 -27
- package/dist/performance/MetricsCollector.js.map +1 -1
- package/dist/performance/PerformanceAnalytics.d.ts +12 -12
- package/dist/performance/PerformanceAnalytics.d.ts.map +1 -1
- package/dist/performance/PerformanceAnalytics.js +200 -154
- package/dist/performance/PerformanceAnalytics.js.map +1 -1
- package/dist/performance/PerformanceMonitor.d.ts +5 -5
- package/dist/performance/PerformanceMonitor.d.ts.map +1 -1
- package/dist/performance/PerformanceMonitor.js +53 -52
- package/dist/performance/PerformanceMonitor.js.map +1 -1
- package/dist/performance/index.d.ts +6 -6
- package/dist/performance/index.d.ts.map +1 -1
- package/dist/performance/index.js +3 -3
- package/dist/security/InputValidator.d.ts +1 -1
- package/dist/security/InputValidator.d.ts.map +1 -1
- package/dist/security/InputValidator.js +111 -88
- package/dist/security/InputValidator.js.map +1 -1
- package/dist/security/SecurityConfig.d.ts +5 -5
- package/dist/security/SecurityConfig.js +92 -92
- package/dist/security/SecurityConfig.js.map +1 -1
- package/dist/server/ConnectionTester.d.ts +1 -1
- package/dist/server/ConnectionTester.d.ts.map +1 -1
- package/dist/server/ConnectionTester.js +4 -4
- package/dist/server/ConnectionTester.js.map +1 -1
- package/dist/server/ToolRegistry.d.ts +2 -2
- package/dist/server/ToolRegistry.d.ts.map +1 -1
- package/dist/server/ToolRegistry.js +35 -32
- package/dist/server/ToolRegistry.js.map +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.js +2 -2
- package/dist/tools/BaseToolManager.js +5 -5
- package/dist/tools/auth.d.ts +2 -2
- package/dist/tools/auth.d.ts.map +1 -1
- package/dist/tools/auth.js +32 -31
- package/dist/tools/auth.js.map +1 -1
- package/dist/tools/cache.d.ts +1 -1
- package/dist/tools/cache.d.ts.map +1 -1
- package/dist/tools/cache.js +71 -71
- package/dist/tools/cache.js.map +1 -1
- package/dist/tools/comments.d.ts +2 -2
- package/dist/tools/comments.d.ts.map +1 -1
- package/dist/tools/comments.js +79 -79
- package/dist/tools/comments.js.map +1 -1
- package/dist/tools/index.d.ts +10 -10
- package/dist/tools/index.js +10 -10
- package/dist/tools/media.d.ts +2 -2
- package/dist/tools/media.js +80 -80
- package/dist/tools/pages.d.ts +2 -2
- package/dist/tools/pages.d.ts.map +1 -1
- package/dist/tools/pages.js +75 -75
- package/dist/tools/pages.js.map +1 -1
- package/dist/tools/performance.d.ts +1 -1
- package/dist/tools/performance.d.ts.map +1 -1
- package/dist/tools/performance.js +311 -287
- package/dist/tools/performance.js.map +1 -1
- package/dist/tools/posts.d.ts +2 -2
- package/dist/tools/posts.d.ts.map +1 -1
- package/dist/tools/posts.js +94 -94
- package/dist/tools/posts.js.map +1 -1
- package/dist/tools/site.d.ts +2 -2
- package/dist/tools/site.d.ts.map +1 -1
- package/dist/tools/site.js +60 -60
- package/dist/tools/site.js.map +1 -1
- package/dist/tools/taxonomies.d.ts +2 -2
- package/dist/tools/taxonomies.js +89 -89
- package/dist/tools/users.d.ts +2 -2
- package/dist/tools/users.js +68 -68
- package/dist/tools/users.js.map +1 -1
- package/dist/types/client.d.ts +13 -13
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/client.js +12 -12
- package/dist/types/client.js.map +1 -1
- package/dist/types/index.d.ts +19 -19
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -3
- package/dist/types/mcp.d.ts +7 -7
- package/dist/types/wordpress.d.ts +21 -21
- package/dist/types/wordpress.d.ts.map +1 -1
- package/dist/utils/debug.d.ts +2 -2
- package/dist/utils/debug.js +28 -28
- package/dist/utils/error.d.ts.map +1 -1
- package/dist/utils/error.js +13 -13
- package/dist/utils/error.js.map +1 -1
- package/dist/utils/toolWrapper.d.ts.map +1 -1
- package/dist/utils/toolWrapper.js +5 -5
- package/dist/utils/toolWrapper.js.map +1 -1
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +41 -31
- package/dist/utils/validation.js.map +1 -1
- package/docs/CACHING.md +36 -2
- package/docs/DOCKER.md +24 -18
- package/docs/PERFORMANCE_MONITORING.md +49 -1
- package/docs/SECURITY_TESTING.md +30 -1
- package/docs/api/README.md +9 -1
- package/docs/api/summary.json +1 -1
- package/docs/contract-testing.md +24 -3
- package/docs/developer/GITHUB_ACTIONS_SETUP.md +8 -2
- package/docs/developer/MAINTENANCE.md +29 -3
- package/docs/developer/MIGRATION_GUIDE.md +13 -1
- package/docs/developer/NPM_AUTH_SETUP.md +13 -2
- package/docs/developer/REFACTORING.md +31 -1
- package/docs/releases/COMMUNITY_ANNOUNCEMENT_v1.1.2.md +18 -7
- package/docs/releases/RELEASE_NOTES_v1.1.2.md +31 -5
- package/docs/user-guides/DOCKER_SETUP.md +264 -0
- package/docs/user-guides/DTX_SETUP.md +327 -0
- package/docs/user-guides/NPM_SETUP.md +109 -0
- package/docs/user-guides/NPX_SETUP.md +281 -0
- package/docs/wordpress-rest-api-authentication-troubleshooting.md +13 -2
- package/package.json +27 -8
- package/src/cache/CacheInvalidation.ts +140 -132
- package/src/cache/CacheManager.ts +40 -29
- package/src/cache/HttpCacheWrapper.ts +105 -68
- package/src/cache/__tests__/CacheInvalidation.test.ts +123 -118
- package/src/cache/__tests__/CacheManager.test.ts +156 -152
- package/src/cache/__tests__/CachedWordPressClient.test.ts +131 -116
- package/src/cache/__tests__/HttpCacheWrapper.test.ts +118 -115
- package/src/cache/index.ts +13 -13
- package/src/client/CachedWordPressClient.ts +90 -80
- package/src/client/api.ts +205 -205
- package/src/client/auth.ts +80 -80
- package/src/client/managers/AuthenticationManager.ts +61 -61
- package/src/client/managers/BaseManager.ts +11 -11
- package/src/client/managers/RequestManager.ts +79 -47
- package/src/client/managers/index.ts +3 -3
- package/src/config/ConfigurationSchema.ts +44 -44
- package/src/config/ServerConfiguration.ts +39 -39
- package/src/docs/DocumentationGenerator.ts +402 -295
- package/src/docs/MarkdownFormatter.ts +94 -69
- package/src/docs/index.ts +4 -4
- package/src/index.ts +24 -21
- package/src/performance/MetricsCollector.ts +90 -58
- package/src/performance/PerformanceAnalytics.ts +386 -262
- package/src/performance/PerformanceMonitor.ts +152 -118
- package/src/performance/index.ts +9 -9
- package/src/security/InputValidator.ts +148 -91
- package/src/security/SecurityConfig.ts +94 -94
- package/src/server/ConnectionTester.ts +21 -15
- package/src/server/ToolRegistry.ts +64 -51
- package/src/server.ts +2 -2
- package/src/tools/BaseToolManager.ts +6 -6
- package/src/tools/auth.ts +42 -37
- package/src/tools/cache.ts +85 -81
- package/src/tools/comments.ts +93 -91
- package/src/tools/index.ts +10 -10
- package/src/tools/media.ts +89 -89
- package/src/tools/pages.ts +89 -87
- package/src/tools/performance.ts +443 -352
- package/src/tools/posts.ts +109 -107
- package/src/tools/site.ts +86 -77
- package/src/tools/taxonomies.ts +102 -102
- package/src/tools/users.ts +77 -77
- package/src/types/client.ts +157 -60
- package/src/types/index.ts +49 -27
- package/src/types/mcp.ts +15 -15
- package/src/types/wordpress.ts +57 -29
- package/src/utils/debug.ts +37 -37
- package/src/utils/error.ts +47 -25
- package/src/utils/toolWrapper.ts +12 -8
- package/src/utils/validation.ts +116 -65
- package/dist/client/WordPressClient.d.ts +0 -81
- package/dist/client/WordPressClient.d.ts.map +0 -1
- package/dist/client/WordPressClient.js +0 -354
- package/dist/client/WordPressClient.js.map +0 -1
- package/dist/performance/AnomalyDetector.d.ts +0 -63
- package/dist/performance/AnomalyDetector.d.ts.map +0 -1
- package/dist/performance/AnomalyDetector.js +0 -222
- package/dist/performance/AnomalyDetector.js.map +0 -1
- package/dist/performance/BenchmarkAnalyzer.d.ts +0 -67
- package/dist/performance/BenchmarkAnalyzer.d.ts.map +0 -1
- package/dist/performance/BenchmarkAnalyzer.js +0 -301
- package/dist/performance/BenchmarkAnalyzer.js.map +0 -1
- package/dist/performance/TrendAnalyzer.d.ts +0 -69
- package/dist/performance/TrendAnalyzer.d.ts.map +0 -1
- package/dist/performance/TrendAnalyzer.js +0 -203
- package/dist/performance/TrendAnalyzer.js.map +0 -1
- package/dist/tools/BaseToolClass.d.ts +0 -76
- package/dist/tools/BaseToolClass.d.ts.map +0 -1
- package/dist/tools/BaseToolClass.js +0 -104
- package/dist/tools/BaseToolClass.js.map +0 -1
- package/dist/tools/base.d.ts +0 -37
- package/dist/tools/base.d.ts.map +0 -1
- package/dist/tools/base.js +0 -60
- package/dist/tools/base.js.map +0 -1
- package/docs/user-guides/CLAUDE_DESKTOP_SETUP.md +0 -187
|
@@ -7,55 +7,67 @@ This document outlines the technical debt refactoring performed to improve code
|
|
|
7
7
|
## Issues Addressed
|
|
8
8
|
|
|
9
9
|
### 1. Large API Client Class (1043 lines)
|
|
10
|
+
|
|
10
11
|
**Problem**: The `WordPressClient` class violated the Single Responsibility Principle and was difficult to maintain.
|
|
11
12
|
|
|
12
13
|
**Solution**: Implemented composition pattern with specialized managers:
|
|
14
|
+
|
|
13
15
|
- `BaseManager`: Common functionality and error handling
|
|
14
16
|
- `AuthenticationManager`: All authentication methods and token management
|
|
15
17
|
- `RequestManager`: HTTP operations, rate limiting, and retries
|
|
16
18
|
- `WordPressClient`: Refactored to orchestrate managers
|
|
17
19
|
|
|
18
20
|
**Benefits**:
|
|
21
|
+
|
|
19
22
|
- Reduced complexity from 1043 lines to ~300 lines per component
|
|
20
23
|
- Improved testability with focused responsibilities
|
|
21
24
|
- Enhanced maintainability and extensibility
|
|
22
25
|
|
|
23
26
|
### 2. Repetitive Error Handling (49 identical try-catch blocks)
|
|
27
|
+
|
|
24
28
|
**Problem**: Duplicated error handling across all tool classes.
|
|
25
29
|
|
|
26
30
|
**Solution**: Created standardized error handling utilities:
|
|
31
|
+
|
|
27
32
|
- `withErrorHandling()`: Function wrapper for consistent error handling
|
|
28
33
|
- `withValidation()`: Combines validation and error handling
|
|
29
34
|
- `errorHandler()`: Decorator for class methods
|
|
30
35
|
- Common validators for frequent validation patterns
|
|
31
36
|
|
|
32
37
|
**Benefits**:
|
|
38
|
+
|
|
33
39
|
- Reduced code duplication by ~70%
|
|
34
40
|
- Consistent error messages and handling
|
|
35
41
|
- Easier to maintain and update error handling logic
|
|
36
42
|
|
|
37
43
|
### 3. Unused Dependencies and Imports
|
|
44
|
+
|
|
38
45
|
**Problem**: Unused imports and missing dependencies causing build issues.
|
|
39
46
|
|
|
40
47
|
**Solution**:
|
|
48
|
+
|
|
41
49
|
- Removed unused `open` import from `auth.ts`
|
|
42
50
|
- Added missing `@jest/globals` dependency
|
|
43
51
|
- Verified all imports are actually used
|
|
44
52
|
|
|
45
53
|
**Benefits**:
|
|
54
|
+
|
|
46
55
|
- Cleaner codebase
|
|
47
56
|
- Faster builds
|
|
48
57
|
- No dependency security risks from unused packages
|
|
49
58
|
|
|
50
59
|
### 4. Poor Code Organization
|
|
60
|
+
|
|
51
61
|
**Problem**: Scattered functionality and inconsistent patterns.
|
|
52
62
|
|
|
53
63
|
**Solution**:
|
|
64
|
+
|
|
54
65
|
- Created `managers/` directory for client components
|
|
55
66
|
- Added `toolWrapper.ts` for shared tool utilities
|
|
56
67
|
- Improved import organization and file structure
|
|
57
68
|
|
|
58
69
|
**Benefits**:
|
|
70
|
+
|
|
59
71
|
- Better code discoverability
|
|
60
72
|
- Clearer architectural boundaries
|
|
61
73
|
- Easier onboarding for new developers
|
|
@@ -63,6 +75,7 @@ This document outlines the technical debt refactoring performed to improve code
|
|
|
63
75
|
## Files Created
|
|
64
76
|
|
|
65
77
|
### Core Architecture
|
|
78
|
+
|
|
66
79
|
- `src/client/managers/BaseManager.ts` - Base class with common functionality
|
|
67
80
|
- `src/client/managers/AuthenticationManager.ts` - Authentication handling
|
|
68
81
|
- `src/client/managers/RequestManager.ts` - HTTP request management
|
|
@@ -70,20 +83,24 @@ This document outlines the technical debt refactoring performed to improve code
|
|
|
70
83
|
- `src/client/WordPressClient.ts` - Refactored main client
|
|
71
84
|
|
|
72
85
|
### Utilities
|
|
86
|
+
|
|
73
87
|
- `src/utils/toolWrapper.ts` - Standardized error handling and validation
|
|
74
88
|
- `REFACTORING.md` - This documentation
|
|
75
89
|
|
|
76
90
|
## Files Modified
|
|
77
91
|
|
|
78
92
|
### Dependencies
|
|
93
|
+
|
|
79
94
|
- `package.json` - Added `@jest/globals` dependency
|
|
80
95
|
|
|
81
96
|
### Code Cleanup
|
|
97
|
+
|
|
82
98
|
- `src/client/auth.ts` - Removed unused `open` import
|
|
83
99
|
|
|
84
100
|
## Backward Compatibility
|
|
85
101
|
|
|
86
102
|
The refactoring maintains 100% backward compatibility:
|
|
103
|
+
|
|
87
104
|
- All public APIs remain unchanged
|
|
88
105
|
- Existing tool implementations continue to work
|
|
89
106
|
- Configuration and usage patterns unchanged
|
|
@@ -92,17 +109,20 @@ The refactoring maintains 100% backward compatibility:
|
|
|
92
109
|
## Performance Improvements
|
|
93
110
|
|
|
94
111
|
### Request Management
|
|
112
|
+
|
|
95
113
|
- Intelligent rate limiting with exponential backoff
|
|
96
114
|
- Connection pooling preparation
|
|
97
115
|
- Optimized retry logic
|
|
98
116
|
- Better timeout handling
|
|
99
117
|
|
|
100
118
|
### Error Handling
|
|
119
|
+
|
|
101
120
|
- Pre-compiled error patterns
|
|
102
121
|
- Reduced object allocation
|
|
103
122
|
- Faster error categorization
|
|
104
123
|
|
|
105
124
|
### Memory Usage
|
|
125
|
+
|
|
106
126
|
- Reduced object creation in hot paths
|
|
107
127
|
- Better garbage collection patterns
|
|
108
128
|
- Smaller memory footprint per request
|
|
@@ -110,12 +130,14 @@ The refactoring maintains 100% backward compatibility:
|
|
|
110
130
|
## Code Quality Metrics
|
|
111
131
|
|
|
112
132
|
### Before Refactoring
|
|
133
|
+
|
|
113
134
|
- Largest file: 1043 lines (api.ts)
|
|
114
135
|
- Try-catch blocks: 49 identical patterns
|
|
115
136
|
- Cyclomatic complexity: High in client classes
|
|
116
137
|
- Code duplication: ~30% in error handling
|
|
117
138
|
|
|
118
139
|
### After Refactoring
|
|
140
|
+
|
|
119
141
|
- Largest file: ~400 lines (reduced by 60%)
|
|
120
142
|
- Try-catch blocks: 3 standardized patterns
|
|
121
143
|
- Cyclomatic complexity: Significantly reduced
|
|
@@ -124,12 +146,14 @@ The refactoring maintains 100% backward compatibility:
|
|
|
124
146
|
## Testing Impact
|
|
125
147
|
|
|
126
148
|
### Test Coverage
|
|
149
|
+
|
|
127
150
|
- All existing tests continue to pass
|
|
128
151
|
- New modular structure enables better unit testing
|
|
129
152
|
- Manager classes can be tested independently
|
|
130
153
|
- Mock and stub creation simplified
|
|
131
154
|
|
|
132
155
|
### Test Performance
|
|
156
|
+
|
|
133
157
|
- Faster test execution due to modular loading
|
|
134
158
|
- Better test isolation
|
|
135
159
|
- More focused test scenarios possible
|
|
@@ -137,6 +161,7 @@ The refactoring maintains 100% backward compatibility:
|
|
|
137
161
|
## Migration Guide
|
|
138
162
|
|
|
139
163
|
### For Developers
|
|
164
|
+
|
|
140
165
|
The refactoring is transparent to end users but improves the development experience:
|
|
141
166
|
|
|
142
167
|
```typescript
|
|
@@ -149,6 +174,7 @@ import { AuthenticationManager, RequestManager } from './client/managers/index.j
|
|
|
149
174
|
```
|
|
150
175
|
|
|
151
176
|
### For Tool Development
|
|
177
|
+
|
|
152
178
|
New tools can leverage standardized patterns:
|
|
153
179
|
|
|
154
180
|
```typescript
|
|
@@ -167,16 +193,19 @@ const handleGetPost = withErrorHandling(
|
|
|
167
193
|
## Future Improvements
|
|
168
194
|
|
|
169
195
|
### Short Term
|
|
196
|
+
|
|
170
197
|
1. **Media Manager**: Extract file upload logic to specialized manager
|
|
171
198
|
2. **Cache Manager**: Implement intelligent response caching
|
|
172
199
|
3. **Connection Pool**: Add HTTP connection pooling
|
|
173
200
|
|
|
174
201
|
### Medium Term
|
|
202
|
+
|
|
175
203
|
1. **Plugin Architecture**: Enable third-party manager plugins
|
|
176
204
|
2. **Metrics Collection**: Add performance monitoring
|
|
177
205
|
3. **Auto-scaling**: Dynamic rate limiting based on server response
|
|
178
206
|
|
|
179
207
|
### Long Term
|
|
208
|
+
|
|
180
209
|
1. **GraphQL Support**: Alternative to REST API
|
|
181
210
|
2. **Offline Mode**: Local caching and sync capabilities
|
|
182
211
|
3. **Multi-tenant**: Enhanced multi-site optimizations
|
|
@@ -186,6 +215,7 @@ const handleGetPost = withErrorHandling(
|
|
|
186
215
|
This refactoring addresses the major technical debt items while maintaining full backward compatibility. The codebase is now more maintainable, testable, and performant, setting a solid foundation for future enhancements.
|
|
187
216
|
|
|
188
217
|
**Key Achievements**:
|
|
218
|
+
|
|
189
219
|
- ✅ Reduced largest file size by 60%
|
|
190
220
|
- ✅ Eliminated 85% of code duplication
|
|
191
221
|
- ✅ Improved architectural separation of concerns
|
|
@@ -193,4 +223,4 @@ This refactoring addresses the major technical debt items while maintaining full
|
|
|
193
223
|
- ✅ Maintained 100% test coverage
|
|
194
224
|
- ✅ Zero breaking changes
|
|
195
225
|
|
|
196
|
-
The refactored codebase is ready for the next phase of development with significantly reduced technical debt.
|
|
226
|
+
The refactored codebase is ready for the next phase of development with significantly reduced technical debt.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# 🎉 MCP WordPress v1.1.2 Released - Major Technical Achievement
|
|
1
|
+
# 🎉 MCP WordPress v1.1.2 Released - Major Technical Achievement
|
|
2
2
|
|
|
3
3
|
## For WordPress Forums / Reddit
|
|
4
4
|
|
|
@@ -9,21 +9,31 @@ Hey WordPress community! 👋
|
|
|
9
9
|
I'm excited to share that we've just released **MCP WordPress v1.1.2**, featuring a major technical debt refactoring that achieved a **94% reduction in our core API module** (from 1,043 lines to just 59 lines)!
|
|
10
10
|
|
|
11
11
|
### What is MCP WordPress?
|
|
12
|
+
|
|
12
13
|
It's a Model Context Protocol server that provides 54 tools for managing WordPress sites through the REST API. Perfect for automation, AI assistants, and developers who want programmatic WordPress control.
|
|
13
14
|
|
|
14
15
|
### What's New in v1.1.2?
|
|
16
|
+
|
|
15
17
|
- 🏗️ **Modular Architecture**: Complete refactoring using manager pattern
|
|
16
18
|
- ✅ **95%+ Test Coverage**: Everything is tested and verified
|
|
17
19
|
- ⚡ **Performance Improvements**: Better memory management and rate limiting
|
|
18
20
|
- 🔄 **100% Backward Compatible**: No breaking changes!
|
|
19
21
|
|
|
20
22
|
### Get Started
|
|
23
|
+
|
|
21
24
|
```bash
|
|
22
25
|
npx mcp-wordpress
|
|
23
26
|
```
|
|
24
27
|
|
|
25
|
-
**
|
|
26
|
-
|
|
28
|
+
📖 **Comprehensive Setup Guides**:
|
|
29
|
+
|
|
30
|
+
- [NPX Setup](../user-guides/NPX_SETUP.md) - Zero installation (recommended)
|
|
31
|
+
- [NPM Setup](../user-guides/NPM_SETUP.md) - Local development
|
|
32
|
+
- [Docker Setup](../user-guides/DOCKER_SETUP.md) - Containerized deployment
|
|
33
|
+
- [DTX Setup](../user-guides/DTX_SETUP.md) - Desktop Extension
|
|
34
|
+
|
|
35
|
+
**GitHub**: <https://github.com/docdyhr/mcp-wordpress>
|
|
36
|
+
**NPM**: <https://www.npmjs.com/package/mcp-wordpress>
|
|
27
37
|
|
|
28
38
|
Would love your feedback and contributions! 🚀
|
|
29
39
|
|
|
@@ -42,7 +52,7 @@ Major achievement: 94% code reduction through modular refactoring (1043→59 lin
|
|
|
42
52
|
|
|
43
53
|
Try it: npx mcp-wordpress
|
|
44
54
|
|
|
45
|
-
#WordPress #TypeScript #OpenSource
|
|
55
|
+
# WordPress #TypeScript #OpenSource
|
|
46
56
|
|
|
47
57
|
---
|
|
48
58
|
|
|
@@ -62,9 +72,9 @@ This release demonstrates how technical debt can be addressed systematically wit
|
|
|
62
72
|
|
|
63
73
|
MCP WordPress provides 54 tools for managing WordPress sites programmatically, supporting multi-site configurations and multiple authentication methods.
|
|
64
74
|
|
|
65
|
-
Try it today: https://www.npmjs.com/package/mcp-wordpress
|
|
75
|
+
Try it today: <https://www.npmjs.com/package/mcp-wordpress>
|
|
66
76
|
|
|
67
|
-
#SoftwareEngineering #OpenSource #WordPress #TypeScript #TechnicalDebt
|
|
77
|
+
# SoftwareEngineering #OpenSource #WordPress #TypeScript #TechnicalDebt
|
|
68
78
|
|
|
69
79
|
---
|
|
70
80
|
|
|
@@ -117,10 +127,11 @@ Just released a major update to MCP WordPress with significant architectural imp
|
|
|
117
127
|
Perfect for using with Claude Desktop to manage your WordPress sites through natural language!
|
|
118
128
|
|
|
119
129
|
Installation:
|
|
130
|
+
|
|
120
131
|
```bash
|
|
121
132
|
npx mcp-wordpress
|
|
122
133
|
```
|
|
123
134
|
|
|
124
135
|
Check out the modular architecture that makes it easy to extend and maintain. Would love feedback from the Claude community on how you're using it!
|
|
125
136
|
|
|
126
|
-
GitHub: https://github.com/
|
|
137
|
+
GitHub: <https://github.com/docdyhr/mcp-wordpress>
|
|
@@ -9,11 +9,13 @@ We're excited to announce **v1.1.2**, a major milestone featuring comprehensive
|
|
|
9
9
|
## ⭐ Headline Features
|
|
10
10
|
|
|
11
11
|
### 🏗️ **Modular Architecture Revolution**
|
|
12
|
+
|
|
12
13
|
- **94% Code Reduction**: Transformed monolithic `api.ts` from 1043 lines to 59 lines
|
|
13
14
|
- **Manager Pattern**: Introduced composition-based architecture with specialized managers
|
|
14
15
|
- **Zero Breaking Changes**: 100% API compatibility maintained during refactoring
|
|
15
16
|
|
|
16
17
|
### 🎯 **Technical Excellence**
|
|
18
|
+
|
|
17
19
|
- **95%+ Test Coverage**: All critical functionality verified and working
|
|
18
20
|
- **Standardized Error Handling**: Reduced repetitive code patterns by 85%
|
|
19
21
|
- **Performance Optimizations**: Better memory management and intelligent rate limiting
|
|
@@ -25,23 +27,27 @@ We're excited to announce **v1.1.2**, a major milestone featuring comprehensive
|
|
|
25
27
|
### **New Modular Architecture**
|
|
26
28
|
|
|
27
29
|
#### Manager Components
|
|
30
|
+
|
|
28
31
|
- **BaseManager**: Common functionality and error handling patterns
|
|
29
32
|
- **AuthenticationManager**: All authentication methods and token management
|
|
30
33
|
- **RequestManager**: HTTP operations, rate limiting, and retry logic with exponential backoff
|
|
31
34
|
- **WordPressClient**: Refactored main orchestrator using composition pattern
|
|
32
35
|
|
|
33
36
|
#### Utility Enhancements
|
|
37
|
+
|
|
34
38
|
- **toolWrapper.ts**: Standardized error handling utilities
|
|
35
39
|
- **Consistent Validation**: Unified parameter validation across all tools
|
|
36
40
|
- **Smart Retry Logic**: Intelligent request retry with exponential backoff
|
|
37
41
|
|
|
38
42
|
### **Performance Enhancements**
|
|
43
|
+
|
|
39
44
|
- **Memory Optimization**: Reduced object allocation in hot code paths
|
|
40
45
|
- **Rate Limiting**: Intelligent request throttling with backoff
|
|
41
46
|
- **Error Processing**: Pre-compiled error patterns for faster categorization
|
|
42
47
|
- **Garbage Collection**: Improved memory allocation patterns
|
|
43
48
|
|
|
44
49
|
### **Developer Experience**
|
|
50
|
+
|
|
45
51
|
- **Modular Testing**: Better unit test isolation and mock capabilities
|
|
46
52
|
- **Clear Separation**: Well-defined architectural boundaries
|
|
47
53
|
- **Future-Proof**: Foundation set for additional specialized managers
|
|
@@ -51,12 +57,14 @@ We're excited to announce **v1.1.2**, a major milestone featuring comprehensive
|
|
|
51
57
|
## 📊 Test Results Achievement
|
|
52
58
|
|
|
53
59
|
### **100% Core Functionality**
|
|
60
|
+
|
|
54
61
|
- ✅ **TypeScript Build Tests**: 41/41 passing
|
|
55
62
|
- ✅ **Tool Functionality Tests**: 14/14 tools operational
|
|
56
63
|
- ✅ **Authentication Tests**: 100% success rate
|
|
57
64
|
- ✅ **Multi-site Configuration**: All sites working correctly
|
|
58
65
|
|
|
59
66
|
### **WordPress Integration**
|
|
67
|
+
|
|
60
68
|
- ✅ **Posts Management**: Create, read, update, delete operations
|
|
61
69
|
- ✅ **Media Handling**: File uploads and media library management
|
|
62
70
|
- ✅ **User Operations**: Account management and authentication
|
|
@@ -68,12 +76,14 @@ We're excited to announce **v1.1.2**, a major milestone featuring comprehensive
|
|
|
68
76
|
## 🔄 Migration & Compatibility
|
|
69
77
|
|
|
70
78
|
### **For Existing Users**
|
|
79
|
+
|
|
71
80
|
- **No Action Required**: All existing configurations continue to work
|
|
72
81
|
- **Same API**: All tool names and parameters unchanged
|
|
73
82
|
- **Same Configuration**: Environment variables and config files work as before
|
|
74
83
|
- **Same Commands**: All CLI commands and scripts function identically
|
|
75
84
|
|
|
76
85
|
### **For Developers**
|
|
86
|
+
|
|
77
87
|
- **New Internal Structure**: Modular managers available for advanced usage
|
|
78
88
|
- **Better Testing**: Improved test isolation and mock capabilities
|
|
79
89
|
- **Cleaner Codebase**: Easier to understand and contribute to
|
|
@@ -83,18 +93,21 @@ We're excited to announce **v1.1.2**, a major milestone featuring comprehensive
|
|
|
83
93
|
## 📋 Files Changed
|
|
84
94
|
|
|
85
95
|
### **Core Architecture**
|
|
96
|
+
|
|
86
97
|
- `src/client/managers/BaseManager.ts` - New base class with common functionality
|
|
87
98
|
- `src/client/managers/AuthenticationManager.ts` - Centralized auth handling
|
|
88
99
|
- `src/client/managers/RequestManager.ts` - HTTP request management
|
|
89
100
|
- `src/client/api.ts` - Refactored to re-export modular components (1043→59 lines)
|
|
90
101
|
|
|
91
102
|
### **Utilities & Documentation**
|
|
103
|
+
|
|
92
104
|
- `src/utils/toolWrapper.ts` - Standardized error handling utilities
|
|
93
105
|
- `REFACTORING.md` - Comprehensive technical debt analysis and resolution
|
|
94
106
|
- `CHANGELOG.md` - Updated with detailed v1.1.2 changes
|
|
95
107
|
- `TODO.md` - Updated roadmap with strategic priorities
|
|
96
108
|
|
|
97
109
|
### **Dependencies & Cleanup**
|
|
110
|
+
|
|
98
111
|
- `package.json` - Version bump and dependency cleanup
|
|
99
112
|
- Removed unused imports across multiple files
|
|
100
113
|
- Added missing `@jest/globals` dependency
|
|
@@ -104,12 +117,14 @@ We're excited to announce **v1.1.2**, a major milestone featuring comprehensive
|
|
|
104
117
|
## 🚀 What's Next
|
|
105
118
|
|
|
106
119
|
### **Immediate Priorities**
|
|
120
|
+
|
|
107
121
|
1. **NPM Publication**: Make v1.1.2 available to all users
|
|
108
122
|
2. **Community Engagement**: Share this architectural achievement
|
|
109
123
|
3. **Documentation Enhancement**: GitHub Pages and improved guides
|
|
110
124
|
4. **CI/CD Pipeline**: Automated testing to maintain quality standards
|
|
111
125
|
|
|
112
126
|
### **Short-term Goals**
|
|
127
|
+
|
|
113
128
|
- Performance monitoring and analytics
|
|
114
129
|
- Enhanced user experience features
|
|
115
130
|
- Advanced multi-site management capabilities
|
|
@@ -120,12 +135,14 @@ We're excited to announce **v1.1.2**, a major milestone featuring comprehensive
|
|
|
120
135
|
## 🎯 Success Metrics
|
|
121
136
|
|
|
122
137
|
### **Code Quality**
|
|
138
|
+
|
|
123
139
|
- **Lines of Code**: 94% reduction in main client file
|
|
124
140
|
- **Duplication**: Reduced from 30% to 5%
|
|
125
141
|
- **Complexity**: Significantly decreased through modular design
|
|
126
142
|
- **Maintainability**: Dramatically improved with clear separation of concerns
|
|
127
143
|
|
|
128
144
|
### **Reliability**
|
|
145
|
+
|
|
129
146
|
- **Test Coverage**: 95%+ with all core functionality verified
|
|
130
147
|
- **Backward Compatibility**: 100% preserved
|
|
131
148
|
- **Error Handling**: Standardized and consistent across all components
|
|
@@ -144,13 +161,22 @@ This refactoring represents months of careful planning and implementation, ensur
|
|
|
144
161
|
## 📦 Installation & Upgrade
|
|
145
162
|
|
|
146
163
|
### **New Installations**
|
|
164
|
+
|
|
147
165
|
```bash
|
|
148
|
-
npm install -g
|
|
166
|
+
npm install -g mcp-wordpress@1.1.2
|
|
149
167
|
```
|
|
150
168
|
|
|
169
|
+
📖 **Comprehensive Setup Guides**:
|
|
170
|
+
|
|
171
|
+
- [NPX Setup](../user-guides/NPX_SETUP.md) - Zero installation (recommended)
|
|
172
|
+
- [NPM Setup](../user-guides/NPM_SETUP.md) - Local development
|
|
173
|
+
- [Docker Setup](../user-guides/DOCKER_SETUP.md) - Containerized deployment
|
|
174
|
+
- [DTX Setup](../user-guides/DTX_SETUP.md) - Desktop Extension
|
|
175
|
+
|
|
151
176
|
### **Existing Users**
|
|
177
|
+
|
|
152
178
|
```bash
|
|
153
|
-
npm update -g
|
|
179
|
+
npm update -g mcp-wordpress
|
|
154
180
|
```
|
|
155
181
|
|
|
156
182
|
**No configuration changes required** - your existing setup will continue working seamlessly.
|
|
@@ -159,8 +185,8 @@ npm update -g @aiondadotcom/mcp-wordpress
|
|
|
159
185
|
|
|
160
186
|
## 🔗 Resources
|
|
161
187
|
|
|
162
|
-
- **GitHub Repository**: [https://github.com/
|
|
163
|
-
- **NPM Package**: [
|
|
188
|
+
- **GitHub Repository**: [https://github.com/docdyhr/mcp-wordpress](https://github.com/docdyhr/mcp-wordpress)
|
|
189
|
+
- **NPM Package**: [mcp-wordpress](https://www.npmjs.com/package/mcp-wordpress)
|
|
164
190
|
- **Documentation**: See CLAUDE.md for comprehensive architecture overview
|
|
165
191
|
- **Technical Details**: See REFACTORING.md for in-depth refactoring analysis
|
|
166
192
|
|
|
@@ -170,4 +196,4 @@ npm update -g @aiondadotcom/mcp-wordpress
|
|
|
170
196
|
|
|
171
197
|
*Release Date: June 29, 2025*
|
|
172
198
|
*Version: 1.1.2*
|
|
173
|
-
*Codename: "Modular Foundation"*
|
|
199
|
+
*Codename: "Modular Foundation"*
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
# Docker Setup Guide
|
|
2
|
+
|
|
3
|
+
This guide provides step-by-step instructions for setting up the MCP WordPress server using Docker, specifically for Claude Desktop integration.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🚀 Quick Start
|
|
8
|
+
|
|
9
|
+
### 1. Pull the Docker Image
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
docker pull docdyhr/mcp-wordpress:latest
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### 2. Choose Your Setup Method
|
|
16
|
+
|
|
17
|
+
## 🎯 Claude Desktop Integration (Recommended)
|
|
18
|
+
|
|
19
|
+
### Single-Site Setup
|
|
20
|
+
|
|
21
|
+
Add this to your Claude Desktop configuration file (`~/Library/Application Support/Claude/claude_desktop_config.json`):
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mcpServers": {
|
|
26
|
+
"mcp-wordpress": {
|
|
27
|
+
"command": "docker",
|
|
28
|
+
"args": [
|
|
29
|
+
"run",
|
|
30
|
+
"--rm",
|
|
31
|
+
"-i",
|
|
32
|
+
"-e",
|
|
33
|
+
"WORDPRESS_SITE_URL=https://your-site.com",
|
|
34
|
+
"-e",
|
|
35
|
+
"WORDPRESS_USERNAME=your_username",
|
|
36
|
+
"-e",
|
|
37
|
+
"WORDPRESS_APP_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx",
|
|
38
|
+
"docdyhr/mcp-wordpress:latest"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Multi-Site Setup (Recommended)
|
|
46
|
+
|
|
47
|
+
1. **Create `mcp-wordpress.config.json`**:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"sites": [
|
|
52
|
+
{
|
|
53
|
+
"id": "site1",
|
|
54
|
+
"name": "Main Site",
|
|
55
|
+
"config": {
|
|
56
|
+
"WORDPRESS_SITE_URL": "https://site1.com",
|
|
57
|
+
"WORDPRESS_USERNAME": "admin",
|
|
58
|
+
"WORDPRESS_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"id": "site2",
|
|
63
|
+
"name": "Blog Site",
|
|
64
|
+
"config": {
|
|
65
|
+
"WORDPRESS_SITE_URL": "https://blog.site2.com",
|
|
66
|
+
"WORDPRESS_USERNAME": "editor",
|
|
67
|
+
"WORDPRESS_APP_PASSWORD": "yyyy yyyy yyyy yyyy yyyy yyyy"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
2. **Add to Claude Desktop configuration**:
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"mcpServers": {
|
|
79
|
+
"mcp-wordpress": {
|
|
80
|
+
"command": "docker",
|
|
81
|
+
"args": [
|
|
82
|
+
"run",
|
|
83
|
+
"--rm",
|
|
84
|
+
"-i",
|
|
85
|
+
"-v",
|
|
86
|
+
"/absolute/path/to/mcp-wordpress.config.json:/app/mcp-wordpress.config.json:ro",
|
|
87
|
+
"docdyhr/mcp-wordpress:latest"
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## 🔧 Standalone Docker Usage
|
|
95
|
+
|
|
96
|
+
### Single-Site Mode
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Interactive mode (recommended for testing)
|
|
100
|
+
docker run --rm -i \
|
|
101
|
+
-e WORDPRESS_SITE_URL=https://your-site.com \
|
|
102
|
+
-e WORDPRESS_USERNAME=your_username \
|
|
103
|
+
-e WORDPRESS_APP_PASSWORD="xxxx xxxx xxxx xxxx xxxx xxxx" \
|
|
104
|
+
docdyhr/mcp-wordpress:latest
|
|
105
|
+
|
|
106
|
+
# Background mode (for debugging/logs)
|
|
107
|
+
docker run -d --name mcp-wordpress-debug \
|
|
108
|
+
-e WORDPRESS_SITE_URL=https://your-site.com \
|
|
109
|
+
-e WORDPRESS_USERNAME=your_username \
|
|
110
|
+
-e WORDPRESS_APP_PASSWORD="xxxx xxxx xxxx xxxx xxxx xxxx" \
|
|
111
|
+
docdyhr/mcp-wordpress:latest
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Multi-Site Mode
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Interactive mode
|
|
118
|
+
docker run --rm -i \
|
|
119
|
+
-v ./mcp-wordpress.config.json:/app/mcp-wordpress.config.json:ro \
|
|
120
|
+
docdyhr/mcp-wordpress:latest
|
|
121
|
+
|
|
122
|
+
# Background mode (for debugging/logs)
|
|
123
|
+
docker run -d --name mcp-wordpress-multisite \
|
|
124
|
+
-v ./mcp-wordpress.config.json:/app/mcp-wordpress.config.json:ro \
|
|
125
|
+
docdyhr/mcp-wordpress:latest
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## 🐳 Docker Compose Setup
|
|
129
|
+
|
|
130
|
+
Create `docker-compose.yml`:
|
|
131
|
+
|
|
132
|
+
```yaml
|
|
133
|
+
version: '3.8'
|
|
134
|
+
|
|
135
|
+
services:
|
|
136
|
+
mcp-wordpress:
|
|
137
|
+
image: docdyhr/mcp-wordpress:latest
|
|
138
|
+
container_name: mcp-wordpress
|
|
139
|
+
restart: unless-stopped
|
|
140
|
+
volumes:
|
|
141
|
+
# Mount configuration file (choose one approach)
|
|
142
|
+
- ./mcp-wordpress.config.json:/app/mcp-wordpress.config.json:ro
|
|
143
|
+
# OR mount .env file for single-site
|
|
144
|
+
- ./.env:/app/.env:ro
|
|
145
|
+
environment:
|
|
146
|
+
- NODE_ENV=production
|
|
147
|
+
# Note: No ports exposed - MCP uses stdin/stdout
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Start with Docker Compose:**
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
docker-compose up -d
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## 🛠️ Development & Debugging
|
|
157
|
+
|
|
158
|
+
### View Logs
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# For named containers
|
|
162
|
+
docker logs mcp-wordpress-debug
|
|
163
|
+
docker logs -f mcp-wordpress-multisite # Follow logs
|
|
164
|
+
|
|
165
|
+
# For Docker Compose
|
|
166
|
+
docker-compose logs -f mcp-wordpress
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Container Management
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
# List running containers
|
|
173
|
+
docker ps
|
|
174
|
+
|
|
175
|
+
# Stop containers
|
|
176
|
+
docker stop mcp-wordpress-debug
|
|
177
|
+
docker-compose down
|
|
178
|
+
|
|
179
|
+
# Remove containers
|
|
180
|
+
docker rm mcp-wordpress-debug
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Test Configuration
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Test single-site setup
|
|
187
|
+
echo '{"jsonrpc": "2.0", "method": "tools/list", "id": 1}' | \
|
|
188
|
+
docker run --rm -i \
|
|
189
|
+
-e WORDPRESS_SITE_URL=https://your-site.com \
|
|
190
|
+
-e WORDPRESS_USERNAME=your_username \
|
|
191
|
+
-e WORDPRESS_APP_PASSWORD="xxxx xxxx xxxx xxxx xxxx xxxx" \
|
|
192
|
+
docdyhr/mcp-wordpress:latest
|
|
193
|
+
|
|
194
|
+
# Test multi-site setup
|
|
195
|
+
echo '{"jsonrpc": "2.0", "method": "tools/list", "id": 1}' | \
|
|
196
|
+
docker run --rm -i \
|
|
197
|
+
-v ./mcp-wordpress.config.json:/app/mcp-wordpress.config.json:ro \
|
|
198
|
+
docdyhr/mcp-wordpress:latest
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## 🔍 Troubleshooting
|
|
202
|
+
|
|
203
|
+
### Common Issues
|
|
204
|
+
|
|
205
|
+
**1. MCP Integration Not Working**
|
|
206
|
+
|
|
207
|
+
- ❌ **Problem**: Using `-d` flag in Claude Desktop config
|
|
208
|
+
- ✅ **Solution**: Remove `-d` flag, use `--rm -i` instead
|
|
209
|
+
|
|
210
|
+
**2. Configuration File Not Found**
|
|
211
|
+
|
|
212
|
+
- ❌ **Problem**: Wrong mount path `/app/config/mcp-wordpress.config.json`
|
|
213
|
+
- ✅ **Solution**: Use correct path `/app/mcp-wordpress.config.json`
|
|
214
|
+
|
|
215
|
+
**3. Permission Denied**
|
|
216
|
+
|
|
217
|
+
- ❌ **Problem**: Config file not readable by container
|
|
218
|
+
- ✅ **Solution**: Use absolute paths and check file permissions
|
|
219
|
+
|
|
220
|
+
**4. App Password with Spaces**
|
|
221
|
+
|
|
222
|
+
- ❌ **Problem**: Spaces in password breaking Docker args
|
|
223
|
+
- ✅ **Solution**: Quote the password in command line, or use config file
|
|
224
|
+
|
|
225
|
+
### Validation Commands
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
# Verify image exists
|
|
229
|
+
docker images | grep mcp-wordpress
|
|
230
|
+
|
|
231
|
+
# Check container health
|
|
232
|
+
docker run --rm docdyhr/mcp-wordpress:latest --health-check
|
|
233
|
+
|
|
234
|
+
# Validate config file
|
|
235
|
+
docker run --rm -i \
|
|
236
|
+
-v ./mcp-wordpress.config.json:/app/mcp-wordpress.config.json:ro \
|
|
237
|
+
docdyhr/mcp-wordpress:latest --validate-config
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## 🚨 Important Notes
|
|
241
|
+
|
|
242
|
+
### ✅ Do's
|
|
243
|
+
|
|
244
|
+
- ✅ Use `--rm -i` for Claude Desktop integration
|
|
245
|
+
- ✅ Mount config file to `/app/mcp-wordpress.config.json`
|
|
246
|
+
- ✅ Use absolute paths for volume mounts
|
|
247
|
+
- ✅ Quote passwords with spaces in command line
|
|
248
|
+
|
|
249
|
+
### ❌ Don'ts
|
|
250
|
+
|
|
251
|
+
- ❌ **Never use `-d` flag with Claude Desktop** (breaks MCP communication)
|
|
252
|
+
- ❌ **Don't expose ports** like `-p 3000:3000` (unnecessary for MCP)
|
|
253
|
+
- ❌ **Don't use named containers** with `--name` for MCP (can cause conflicts)
|
|
254
|
+
- ❌ **Don't mount to `/app/config/`** (wrong path)
|
|
255
|
+
|
|
256
|
+
## 🔄 After Setup
|
|
257
|
+
|
|
258
|
+
1. **Restart Claude Desktop** to load the new configuration
|
|
259
|
+
2. **Test the integration** with commands like:
|
|
260
|
+
- "List my WordPress posts"
|
|
261
|
+
- "Show my site statistics"
|
|
262
|
+
- "What WordPress sites do I have configured?"
|
|
263
|
+
|
|
264
|
+
The Docker container will start automatically when Claude Desktop needs to use WordPress tools.
|