mcp-wordpress 1.2.3 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/README.md +113 -181
  2. package/dist/cache/CacheInvalidation.d.ts +3 -3
  3. package/dist/cache/CacheInvalidation.d.ts.map +1 -1
  4. package/dist/cache/CacheInvalidation.js +119 -119
  5. package/dist/cache/CacheInvalidation.js.map +1 -1
  6. package/dist/cache/CacheManager.d.ts +5 -0
  7. package/dist/cache/CacheManager.d.ts.map +1 -1
  8. package/dist/cache/CacheManager.js +26 -16
  9. package/dist/cache/CacheManager.js.map +1 -1
  10. package/dist/cache/HttpCacheWrapper.d.ts +1 -1
  11. package/dist/cache/HttpCacheWrapper.d.ts.map +1 -1
  12. package/dist/cache/HttpCacheWrapper.js +29 -29
  13. package/dist/cache/HttpCacheWrapper.js.map +1 -1
  14. package/dist/cache/__tests__/CacheInvalidation.test.js +96 -94
  15. package/dist/cache/__tests__/CacheInvalidation.test.js.map +1 -1
  16. package/dist/cache/__tests__/CacheManager.test.js +113 -113
  17. package/dist/cache/__tests__/CacheManager.test.js.map +1 -1
  18. package/dist/cache/__tests__/CachedWordPressClient.test.js +102 -99
  19. package/dist/cache/__tests__/CachedWordPressClient.test.js.map +1 -1
  20. package/dist/cache/__tests__/HttpCacheWrapper.test.js +98 -95
  21. package/dist/cache/__tests__/HttpCacheWrapper.test.js.map +1 -1
  22. package/dist/cache/index.d.ts +7 -7
  23. package/dist/cache/index.d.ts.map +1 -1
  24. package/dist/cache/index.js +4 -4
  25. package/dist/cache/index.js.map +1 -1
  26. package/dist/client/CachedWordPressClient.d.ts +4 -4
  27. package/dist/client/CachedWordPressClient.d.ts.map +1 -1
  28. package/dist/client/CachedWordPressClient.js +55 -51
  29. package/dist/client/CachedWordPressClient.js.map +1 -1
  30. package/dist/client/api.d.ts +10 -10
  31. package/dist/client/api.js +158 -158
  32. package/dist/client/api.js.map +1 -1
  33. package/dist/client/auth.d.ts +2 -2
  34. package/dist/client/auth.js +72 -72
  35. package/dist/client/managers/AuthenticationManager.d.ts +2 -2
  36. package/dist/client/managers/AuthenticationManager.js +46 -46
  37. package/dist/client/managers/BaseManager.d.ts +1 -1
  38. package/dist/client/managers/BaseManager.js +9 -9
  39. package/dist/client/managers/RequestManager.d.ts +5 -3
  40. package/dist/client/managers/RequestManager.d.ts.map +1 -1
  41. package/dist/client/managers/RequestManager.js +39 -19
  42. package/dist/client/managers/RequestManager.js.map +1 -1
  43. package/dist/client/managers/index.d.ts +3 -3
  44. package/dist/client/managers/index.js +3 -3
  45. package/dist/config/ConfigurationSchema.d.ts +2 -2
  46. package/dist/config/ConfigurationSchema.d.ts.map +1 -1
  47. package/dist/config/ConfigurationSchema.js +40 -40
  48. package/dist/config/ConfigurationSchema.js.map +1 -1
  49. package/dist/config/ServerConfiguration.d.ts +2 -2
  50. package/dist/config/ServerConfiguration.js +35 -35
  51. package/dist/config/ServerConfiguration.js.map +1 -1
  52. package/dist/docs/DocumentationGenerator.d.ts.map +1 -1
  53. package/dist/docs/DocumentationGenerator.js +296 -255
  54. package/dist/docs/DocumentationGenerator.js.map +1 -1
  55. package/dist/docs/MarkdownFormatter.d.ts +1 -1
  56. package/dist/docs/MarkdownFormatter.d.ts.map +1 -1
  57. package/dist/docs/MarkdownFormatter.js +60 -51
  58. package/dist/docs/MarkdownFormatter.js.map +1 -1
  59. package/dist/docs/index.d.ts +3 -3
  60. package/dist/docs/index.d.ts.map +1 -1
  61. package/dist/docs/index.js +2 -2
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +16 -16
  64. package/dist/index.js.map +1 -1
  65. package/dist/mcp-wordpress-1.3.1.tgz +0 -0
  66. package/dist/performance/MetricsCollector.d.ts +3 -3
  67. package/dist/performance/MetricsCollector.d.ts.map +1 -1
  68. package/dist/performance/MetricsCollector.js +33 -27
  69. package/dist/performance/MetricsCollector.js.map +1 -1
  70. package/dist/performance/PerformanceAnalytics.d.ts +12 -12
  71. package/dist/performance/PerformanceAnalytics.d.ts.map +1 -1
  72. package/dist/performance/PerformanceAnalytics.js +200 -154
  73. package/dist/performance/PerformanceAnalytics.js.map +1 -1
  74. package/dist/performance/PerformanceMonitor.d.ts +5 -5
  75. package/dist/performance/PerformanceMonitor.d.ts.map +1 -1
  76. package/dist/performance/PerformanceMonitor.js +53 -52
  77. package/dist/performance/PerformanceMonitor.js.map +1 -1
  78. package/dist/performance/index.d.ts +6 -6
  79. package/dist/performance/index.d.ts.map +1 -1
  80. package/dist/performance/index.js +3 -3
  81. package/dist/security/InputValidator.d.ts +1 -1
  82. package/dist/security/InputValidator.d.ts.map +1 -1
  83. package/dist/security/InputValidator.js +111 -88
  84. package/dist/security/InputValidator.js.map +1 -1
  85. package/dist/security/SecurityConfig.d.ts +5 -5
  86. package/dist/security/SecurityConfig.js +92 -92
  87. package/dist/security/SecurityConfig.js.map +1 -1
  88. package/dist/server/ConnectionTester.d.ts +1 -1
  89. package/dist/server/ConnectionTester.d.ts.map +1 -1
  90. package/dist/server/ConnectionTester.js +4 -4
  91. package/dist/server/ConnectionTester.js.map +1 -1
  92. package/dist/server/ToolRegistry.d.ts +2 -2
  93. package/dist/server/ToolRegistry.d.ts.map +1 -1
  94. package/dist/server/ToolRegistry.js +35 -32
  95. package/dist/server/ToolRegistry.js.map +1 -1
  96. package/dist/server.d.ts +2 -2
  97. package/dist/server.js +2 -2
  98. package/dist/tools/BaseToolManager.js +5 -5
  99. package/dist/tools/auth.d.ts +2 -2
  100. package/dist/tools/auth.d.ts.map +1 -1
  101. package/dist/tools/auth.js +32 -31
  102. package/dist/tools/auth.js.map +1 -1
  103. package/dist/tools/cache.d.ts +1 -1
  104. package/dist/tools/cache.d.ts.map +1 -1
  105. package/dist/tools/cache.js +71 -71
  106. package/dist/tools/cache.js.map +1 -1
  107. package/dist/tools/comments.d.ts +2 -2
  108. package/dist/tools/comments.d.ts.map +1 -1
  109. package/dist/tools/comments.js +79 -79
  110. package/dist/tools/comments.js.map +1 -1
  111. package/dist/tools/index.d.ts +10 -10
  112. package/dist/tools/index.js +10 -10
  113. package/dist/tools/media.d.ts +2 -2
  114. package/dist/tools/media.js +80 -80
  115. package/dist/tools/pages.d.ts +2 -2
  116. package/dist/tools/pages.d.ts.map +1 -1
  117. package/dist/tools/pages.js +75 -75
  118. package/dist/tools/pages.js.map +1 -1
  119. package/dist/tools/performance.d.ts +1 -1
  120. package/dist/tools/performance.d.ts.map +1 -1
  121. package/dist/tools/performance.js +311 -287
  122. package/dist/tools/performance.js.map +1 -1
  123. package/dist/tools/posts.d.ts +2 -2
  124. package/dist/tools/posts.d.ts.map +1 -1
  125. package/dist/tools/posts.js +94 -94
  126. package/dist/tools/posts.js.map +1 -1
  127. package/dist/tools/site.d.ts +2 -2
  128. package/dist/tools/site.d.ts.map +1 -1
  129. package/dist/tools/site.js +60 -60
  130. package/dist/tools/site.js.map +1 -1
  131. package/dist/tools/taxonomies.d.ts +2 -2
  132. package/dist/tools/taxonomies.js +89 -89
  133. package/dist/tools/users.d.ts +2 -2
  134. package/dist/tools/users.js +68 -68
  135. package/dist/tools/users.js.map +1 -1
  136. package/dist/types/client.d.ts +13 -13
  137. package/dist/types/client.d.ts.map +1 -1
  138. package/dist/types/client.js +12 -12
  139. package/dist/types/client.js.map +1 -1
  140. package/dist/types/index.d.ts +19 -19
  141. package/dist/types/index.d.ts.map +1 -1
  142. package/dist/types/index.js +3 -3
  143. package/dist/types/mcp.d.ts +7 -7
  144. package/dist/types/wordpress.d.ts +21 -21
  145. package/dist/types/wordpress.d.ts.map +1 -1
  146. package/dist/utils/debug.d.ts +2 -2
  147. package/dist/utils/debug.js +28 -28
  148. package/dist/utils/error.d.ts.map +1 -1
  149. package/dist/utils/error.js +13 -13
  150. package/dist/utils/error.js.map +1 -1
  151. package/dist/utils/toolWrapper.d.ts.map +1 -1
  152. package/dist/utils/toolWrapper.js +5 -5
  153. package/dist/utils/toolWrapper.js.map +1 -1
  154. package/dist/utils/validation.d.ts.map +1 -1
  155. package/dist/utils/validation.js +41 -31
  156. package/dist/utils/validation.js.map +1 -1
  157. package/docs/CACHING.md +36 -2
  158. package/docs/DOCKER.md +11 -5
  159. package/docs/PERFORMANCE_MONITORING.md +49 -1
  160. package/docs/SECURITY_TESTING.md +30 -1
  161. package/docs/api/README.md +9 -1
  162. package/docs/api/categories/auth.md +2 -0
  163. package/docs/api/categories/cache.md +2 -0
  164. package/docs/api/categories/comment.md +2 -0
  165. package/docs/api/categories/media.md +2 -0
  166. package/docs/api/categories/page.md +2 -0
  167. package/docs/api/categories/performance.md +2 -0
  168. package/docs/api/categories/post.md +2 -0
  169. package/docs/api/categories/taxonomy.md +2 -0
  170. package/docs/api/categories/user.md +2 -0
  171. package/docs/api/summary.json +1 -1
  172. package/docs/api/tools/wp_approve_comment.md +3 -5
  173. package/docs/contract-testing.md +24 -3
  174. package/docs/developer/GITHUB_ACTIONS_SETUP.md +8 -2
  175. package/docs/developer/MAINTENANCE.md +27 -1
  176. package/docs/developer/MIGRATION_GUIDE.md +13 -1
  177. package/docs/developer/NPM_AUTH_SETUP.md +13 -2
  178. package/docs/developer/REFACTORING.md +31 -1
  179. package/docs/releases/COMMUNITY_ANNOUNCEMENT_v1.1.2.md +18 -7
  180. package/docs/releases/RELEASE_NOTES_v1.1.2.md +31 -5
  181. package/docs/user-guides/DOCKER_NPM_DTX_SETUP.md +217 -0
  182. package/docs/user-guides/DOCKER_SETUP.md +264 -0
  183. package/docs/user-guides/DTX_SETUP.md +327 -0
  184. package/docs/user-guides/NPM_SETUP.md +109 -0
  185. package/docs/user-guides/NPX_SETUP.md +281 -0
  186. package/docs/wordpress-rest-api-authentication-troubleshooting.md +13 -2
  187. package/package.json +20 -6
  188. package/src/cache/CacheInvalidation.ts +140 -132
  189. package/src/cache/CacheManager.ts +40 -29
  190. package/src/cache/HttpCacheWrapper.ts +105 -68
  191. package/src/cache/__tests__/CacheInvalidation.test.ts +123 -118
  192. package/src/cache/__tests__/CacheManager.test.ts +156 -152
  193. package/src/cache/__tests__/CachedWordPressClient.test.ts +131 -116
  194. package/src/cache/__tests__/HttpCacheWrapper.test.ts +118 -115
  195. package/src/cache/index.ts +13 -13
  196. package/src/client/CachedWordPressClient.ts +90 -80
  197. package/src/client/api.ts +205 -205
  198. package/src/client/auth.ts +80 -80
  199. package/src/client/managers/AuthenticationManager.ts +61 -61
  200. package/src/client/managers/BaseManager.ts +11 -11
  201. package/src/client/managers/RequestManager.ts +79 -47
  202. package/src/client/managers/index.ts +3 -3
  203. package/src/config/ConfigurationSchema.ts +44 -44
  204. package/src/config/ServerConfiguration.ts +39 -39
  205. package/src/docs/DocumentationGenerator.ts +402 -295
  206. package/src/docs/MarkdownFormatter.ts +94 -69
  207. package/src/docs/index.ts +4 -4
  208. package/src/index.ts +24 -21
  209. package/src/performance/MetricsCollector.ts +90 -58
  210. package/src/performance/PerformanceAnalytics.ts +386 -262
  211. package/src/performance/PerformanceMonitor.ts +152 -118
  212. package/src/performance/index.ts +9 -9
  213. package/src/security/InputValidator.ts +148 -91
  214. package/src/security/SecurityConfig.ts +94 -94
  215. package/src/server/ConnectionTester.ts +21 -15
  216. package/src/server/ToolRegistry.ts +64 -51
  217. package/src/server.ts +2 -2
  218. package/src/tools/BaseToolManager.ts +6 -6
  219. package/src/tools/auth.ts +42 -37
  220. package/src/tools/cache.ts +85 -81
  221. package/src/tools/comments.ts +93 -91
  222. package/src/tools/index.ts +10 -10
  223. package/src/tools/media.ts +89 -89
  224. package/src/tools/pages.ts +89 -87
  225. package/src/tools/performance.ts +443 -352
  226. package/src/tools/posts.ts +109 -107
  227. package/src/tools/site.ts +86 -77
  228. package/src/tools/taxonomies.ts +102 -102
  229. package/src/tools/users.ts +77 -77
  230. package/src/types/client.ts +157 -60
  231. package/src/types/index.ts +49 -27
  232. package/src/types/mcp.ts +15 -15
  233. package/src/types/wordpress.ts +57 -29
  234. package/src/utils/debug.ts +37 -37
  235. package/src/utils/error.ts +47 -25
  236. package/src/utils/toolWrapper.ts +12 -8
  237. package/src/utils/validation.ts +116 -65
  238. package/dist/client/WordPressClient.d.ts +0 -81
  239. package/dist/client/WordPressClient.d.ts.map +0 -1
  240. package/dist/client/WordPressClient.js +0 -354
  241. package/dist/client/WordPressClient.js.map +0 -1
  242. package/dist/performance/AnomalyDetector.d.ts +0 -63
  243. package/dist/performance/AnomalyDetector.d.ts.map +0 -1
  244. package/dist/performance/AnomalyDetector.js +0 -222
  245. package/dist/performance/AnomalyDetector.js.map +0 -1
  246. package/dist/performance/BenchmarkAnalyzer.d.ts +0 -67
  247. package/dist/performance/BenchmarkAnalyzer.d.ts.map +0 -1
  248. package/dist/performance/BenchmarkAnalyzer.js +0 -301
  249. package/dist/performance/BenchmarkAnalyzer.js.map +0 -1
  250. package/dist/performance/TrendAnalyzer.d.ts +0 -69
  251. package/dist/performance/TrendAnalyzer.d.ts.map +0 -1
  252. package/dist/performance/TrendAnalyzer.js +0 -203
  253. package/dist/performance/TrendAnalyzer.js.map +0 -1
  254. package/dist/tools/BaseToolClass.d.ts +0 -76
  255. package/dist/tools/BaseToolClass.d.ts.map +0 -1
  256. package/dist/tools/BaseToolClass.js +0 -104
  257. package/dist/tools/BaseToolClass.js.map +0 -1
  258. package/dist/tools/base.d.ts +0 -37
  259. package/dist/tools/base.d.ts.map +0 -1
  260. package/dist/tools/base.js +0 -60
  261. package/dist/tools/base.js.map +0 -1
  262. 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
- **GitHub**: https://github.com/AiondaDotCom/mcp-wordpress
26
- **NPM**: https://www.npmjs.com/package/mcp-wordpress
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/AiondaDotCom/mcp-wordpress
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 @aiondadotcom/mcp-wordpress@1.1.2
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 @aiondadotcom/mcp-wordpress
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/AiondaDotCom/mcp-wordpress](https://github.com/AiondaDotCom/mcp-wordpress)
163
- - **NPM Package**: [@aiondadotcom/mcp-wordpress](https://www.npmjs.com/package/@aiondadotcom/mcp-wordpress)
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,217 @@
1
+ # Docker, NPM, and DTX Setup Guide
2
+
3
+ This guide provides step-by-step instructions for setting up the MCP WordPress server using Docker, NPM, and DTX, including Claude Desktop configuration.
4
+
5
+ ---
6
+
7
+ ## 🚀 Docker Setup
8
+
9
+ ### 1. Build the Docker Image
10
+
11
+ Use the provided `Dockerfile` to build the MCP WordPress container:
12
+
13
+ ```bash
14
+ git clone https://github.com/docdyhr/mcp-wordpress.git
15
+ cd mcp-wordpress
16
+ docker build -t mcp-wordpress .
17
+ ```
18
+
19
+ ### 2. Run the Docker Container
20
+
21
+ Start the container with the necessary environment variables:
22
+
23
+ ```bash
24
+ # For Claude Desktop MCP integration (recommended)
25
+ docker run --rm -i \
26
+ -e WORDPRESS_SITE_URL=https://example.com \
27
+ -e WORDPRESS_USERNAME=your_username \
28
+ -e WORDPRESS_APP_PASSWORD="xxxx xxxx xxxx xxxx xxxx xxxx" \
29
+ mcp-wordpress
30
+
31
+ # For debugging/testing (background mode)
32
+ docker run -d --name mcp-wordpress-debug \
33
+ -e WORDPRESS_SITE_URL=https://example.com \
34
+ -e WORDPRESS_USERNAME=your_username \
35
+ -e WORDPRESS_APP_PASSWORD="xxxx xxxx xxxx xxxx xxxx xxxx" \
36
+ mcp-wordpress
37
+ ```
38
+
39
+ ### 3. Multi-Site Configuration
40
+
41
+ For multi-site setups, mount a configuration file:
42
+
43
+ 1. Create `mcp-wordpress.config.json`:
44
+
45
+ ```json
46
+ {
47
+ "sites": [
48
+ {
49
+ "id": "site1",
50
+ "name": "Main Site",
51
+ "config": {
52
+ "WORDPRESS_SITE_URL": "https://site1.com",
53
+ "WORDPRESS_USERNAME": "admin",
54
+ "WORDPRESS_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
55
+ }
56
+ },
57
+ {
58
+ "id": "site2",
59
+ "name": "Blog Site",
60
+ "config": {
61
+ "WORDPRESS_SITE_URL": "https://blog.site2.com",
62
+ "WORDPRESS_USERNAME": "editor",
63
+ "WORDPRESS_APP_PASSWORD": "yyyy yyyy yyyy yyyy yyyy yyyy"
64
+ }
65
+ }
66
+ ]
67
+ }
68
+ ```
69
+
70
+ 2. Run the container with the configuration file:
71
+
72
+ ```bash
73
+ # For Claude Desktop MCP integration (recommended)
74
+ docker run --rm -i \
75
+ -v $(pwd)/mcp-wordpress.config.json:/app/mcp-wordpress.config.json:ro \
76
+ mcp-wordpress
77
+
78
+ # For debugging/testing (background mode)
79
+ docker run -d --name mcp-wordpress-multisite \
80
+ -v $(pwd)/mcp-wordpress.config.json:/app/mcp-wordpress.config.json:ro \
81
+ mcp-wordpress
82
+ ```
83
+
84
+ ---
85
+
86
+ ## 📦 NPM Setup
87
+
88
+ ### 1. Install Dependencies
89
+
90
+ Clone the repository and install dependencies:
91
+
92
+ ```bash
93
+ git clone https://github.com/docdyhr/mcp-wordpress.git
94
+ cd mcp-wordpress
95
+ npm install
96
+ ```
97
+
98
+ ### 2. Run the Setup Wizard
99
+
100
+ Run the interactive setup wizard:
101
+
102
+ ```bash
103
+ npm run setup
104
+ ```
105
+
106
+ ### 3. Start the Server
107
+
108
+ Start the MCP WordPress server:
109
+
110
+ ```bash
111
+ npm start
112
+ ```
113
+
114
+ ### 4. Test the Tools
115
+
116
+ Run tests to verify functionality:
117
+
118
+ ```bash
119
+ npm run test:tools
120
+ ```
121
+
122
+ ---
123
+
124
+ ## 🖼️ DTX Setup
125
+
126
+ ### 1. Build the DTX Package
127
+
128
+ Use the provided script to build the DTX package:
129
+
130
+ ```bash
131
+ npm run build
132
+ ```
133
+
134
+ ### 2. Deploy the DTX Package
135
+
136
+ Deploy the DTX package to the appropriate directory:
137
+
138
+ ```bash
139
+ cp -r dxt/ /path/to/dtx/directory
140
+ ```
141
+
142
+ ### 3. Verify DTX Integration
143
+
144
+ Ensure the DTX package is correctly integrated by checking the `manifest.json` file:
145
+
146
+ ```json
147
+ {
148
+ "name": "MCP WordPress",
149
+ "version": "1.0.0",
150
+ "description": "DTX package for MCP WordPress",
151
+ "main": "index.js"
152
+ }
153
+ ```
154
+
155
+ ---
156
+
157
+ ## 🤖 Claude Desktop Configuration
158
+
159
+ ### 1. Update Configuration File
160
+
161
+ Add the MCP WordPress server to your Claude Desktop configuration file:
162
+
163
+ ```json
164
+ {
165
+ "mcpServers": {
166
+ "mcp-wordpress": {
167
+ "command": "node",
168
+ "args": ["/path/to/your/mcp-wordpress/dist/index.js"],
169
+ "env": {
170
+ "WORDPRESS_SITE_URL": "https://example.com",
171
+ "WORDPRESS_USERNAME": "your_username",
172
+ "WORDPRESS_APP_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx",
173
+ "WORDPRESS_AUTH_METHOD": "app-password"
174
+ }
175
+ }
176
+ }
177
+ }
178
+ ```
179
+
180
+ ### 2. Restart Claude Desktop
181
+
182
+ Close and reopen Claude Desktop to load the new configuration.
183
+
184
+ ### 3. Test Integration
185
+
186
+ Use natural language commands in Claude Desktop to interact with your WordPress site:
187
+
188
+ - "List my WordPress posts"
189
+ - "Show me my site statistics"
190
+ - "What categories do I have?"
191
+
192
+ ---
193
+
194
+ ## 🛠️ Maintenance Commands
195
+
196
+ ### Docker
197
+
198
+ ```bash
199
+ docker ps # List running containers
200
+ docker logs mcp-wordpress # View container logs
201
+ docker stop mcp-wordpress # Stop the container
202
+ docker rm mcp-wordpress # Remove the container
203
+ ```
204
+
205
+ ### NPM
206
+
207
+ ```bash
208
+ npm run status # Check WordPress connection
209
+ npm run health # Full system health check
210
+ npm run verify-claude # Verify Claude Desktop integration
211
+ ```
212
+
213
+ ### DTX
214
+
215
+ ```bash
216
+ npm run build # Rebuild the DTX package
217
+ ```