myaidev-method 0.2.2 → 0.2.3

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.
@@ -0,0 +1,373 @@
1
+ # MCP Server Integration Guide
2
+
3
+ MyAIDev Method includes three optional MCP (Model Context Protocol) servers that provide advanced orchestration, testing, and WordPress integration capabilities.
4
+
5
+ ## Available MCP Servers
6
+
7
+ ### 1. SPARC Orchestrator MCP Server
8
+
9
+ **Purpose**: Workflow automation and orchestration for the 5-phase SPARC methodology
10
+
11
+ **Command**: `npx myaidev-sparc-orchestrator`
12
+
13
+ **MCP Tools**:
14
+ - `sparc_orchestrate` - Orchestrate complete 5-phase SPARC workflow
15
+ - `sparc_status` - Get status of current workflow execution
16
+ - `sparc_phase_execute` - Execute a single SPARC phase with configuration
17
+ - `sparc_workflow_history` - Get history of workflow executions
18
+ - `sparc_task_results` - Get detailed results from completed workflows
19
+
20
+ **Use Cases**:
21
+ - Automated development workflow execution
22
+ - Multi-phase project coordination
23
+ - Workflow state persistence and tracking
24
+ - Sequential, parallel, or adaptive execution strategies
25
+
26
+ **Example Usage**:
27
+ ```javascript
28
+ // Use in Claude Code with MCP enabled
29
+ mcp__myaidev_sparc__sparc_orchestrate({
30
+ task: "Build user authentication system",
31
+ strategy: "sequential",
32
+ phases: ["architecture", "implementation", "testing", "review", "documentation"],
33
+ options: {
34
+ techStack: "nextjs,payloadcms,mongodb",
35
+ testFramework: "jest",
36
+ testDriven: true,
37
+ focusSecurity: true
38
+ }
39
+ })
40
+ ```
41
+
42
+ **Workflow Persistence**:
43
+ - Workflows stored in `~/.myaidev-method/workflows/`
44
+ - Task results in `~/.myaidev-method/tasks/`
45
+ - JSON format for easy inspection and debugging
46
+
47
+ ### 2. Chrome DevTools MCP Server
48
+
49
+ **Purpose**: Browser automation, testing, and debugging via Chrome DevTools Protocol
50
+
51
+ **Command**: `npx chrome-devtools-mcp`
52
+
53
+ **Installation**:
54
+ ```bash
55
+ npm install -g chrome-devtools-mcp
56
+ ```
57
+
58
+ **MCP Tools**:
59
+ - `cdp_connect` - Connect to Chrome DevTools Protocol
60
+ - `cdp_navigate` - Navigate browser to URL
61
+ - `cdp_screenshot` - Take screenshot of current page
62
+ - `cdp_evaluate` - Execute JavaScript in browser context
63
+ - `cdp_network_monitor` - Monitor network requests/responses
64
+ - `cdp_console_logs` - Capture browser console logs
65
+
66
+ **Use Cases**:
67
+ - End-to-end testing of web applications
68
+ - Visual regression testing with screenshots
69
+ - Network performance analysis
70
+ - JavaScript execution and debugging
71
+ - Console log capture for error tracking
72
+
73
+ **Example Usage**:
74
+ ```javascript
75
+ // Connect to browser
76
+ mcp__chrome_devtools__cdp_connect({ port: 9222 })
77
+
78
+ // Navigate and test
79
+ mcp__chrome_devtools__cdp_navigate({ url: "http://localhost:3000" })
80
+ mcp__chrome_devtools__cdp_evaluate({
81
+ expression: "document.querySelector('h1').textContent"
82
+ })
83
+ mcp__chrome_devtools__cdp_screenshot({
84
+ path: "test-results/homepage.png"
85
+ })
86
+ ```
87
+
88
+ **Testing Integration**:
89
+ Works seamlessly with the `dev-tester` agent for comprehensive testing:
90
+ - Unit tests (Jest, Mocha, Pytest)
91
+ - Integration tests (browser automation)
92
+ - Visual tests (screenshots)
93
+ - Performance tests (network monitoring)
94
+
95
+ ### 3. WordPress MCP Server
96
+
97
+ **Purpose**: Enhanced WordPress REST API operations with session management
98
+
99
+ **Command**: `npx myaidev-mcp-server`
100
+
101
+ **MCP Tools**:
102
+ - `wp_session_create` - Create session for tracking operations
103
+ - `wp_session_status` - Get session information and history
104
+ - `wp_memory_store` - Store data in memory for persistence
105
+ - `wp_memory_retrieve` - Retrieve stored data from memory
106
+ - `wp_memory_list` - List all stored data in namespace
107
+ - `wp_health_check` - Comprehensive health check of WordPress site
108
+ - `wp_get_site_info` - Get WordPress site statistics and version
109
+ - `wp_create_post` - Create WordPress post/page with tracking
110
+ - `wp_update_post` - Update existing WordPress post
111
+ - `wp_delete_post` - Delete WordPress post (move to trash)
112
+ - `wp_list_posts` - Get posts with filtering options
113
+ - `wp_batch_publish` - Publish multiple posts from markdown files
114
+
115
+ **Environment Variables**:
116
+ ```bash
117
+ WORDPRESS_URL=https://your-site.com
118
+ WORDPRESS_USERNAME=your-username
119
+ WORDPRESS_APP_PASSWORD=your-app-password
120
+ WORDPRESS_USE_GUTENBERG=true
121
+ ```
122
+
123
+ **Use Cases**:
124
+ - Automated content publishing workflows
125
+ - WordPress site health monitoring
126
+ - Batch content operations
127
+ - Session-based operation tracking
128
+ - Memory persistence for multi-step operations
129
+
130
+ ## Claude Code MCP Configuration
131
+
132
+ To enable these MCP servers in Claude Code, add them to your MCP settings:
133
+
134
+ ### Method 1: Manual Configuration
135
+
136
+ Edit `~/.config/claude/mcp_settings.json`:
137
+
138
+ ```json
139
+ {
140
+ "mcpServers": {
141
+ "myaidev-sparc": {
142
+ "command": "npx",
143
+ "args": ["myaidev-sparc-orchestrator"]
144
+ },
145
+ "chrome-devtools": {
146
+ "command": "npx",
147
+ "args": ["chrome-devtools-mcp"]
148
+ },
149
+ "myaidev-wordpress": {
150
+ "command": "npx",
151
+ "args": ["myaidev-mcp-server"],
152
+ "env": {
153
+ "WORDPRESS_URL": "https://your-site.com",
154
+ "WORDPRESS_USERNAME": "your-username",
155
+ "WORDPRESS_APP_PASSWORD": "your-app-password"
156
+ }
157
+ }
158
+ }
159
+ }
160
+ ```
161
+
162
+ ### Method 2: Using Claude Code CLI
163
+
164
+ ```bash
165
+ # Add SPARC Orchestrator
166
+ claude mcp add myaidev-sparc npx myaidev-sparc-orchestrator
167
+
168
+ # Add Chrome DevTools
169
+ claude mcp add chrome-devtools npx chrome-devtools-mcp
170
+
171
+ # Add WordPress MCP
172
+ claude mcp add myaidev-wordpress npx myaidev-mcp-server
173
+ ```
174
+
175
+ ## Integration Workflows
176
+
177
+ ### Complete Development Workflow
178
+
179
+ Using SPARC Orchestrator + Chrome DevTools + WordPress MCP for end-to-end development:
180
+
181
+ ```bash
182
+ # 1. Orchestrate complete development workflow
183
+ /myai-sparc-workflow "Build blog with authentication"
184
+
185
+ # 2. During testing phase, use Chrome DevTools for browser testing
186
+ # The dev-tester agent will automatically use Chrome DevTools MCP if available
187
+
188
+ # 3. After completion, publish content using WordPress MCP
189
+ /myai-wordpress-publish "blog-post.md" --status publish
190
+ ```
191
+
192
+ ### Testing Workflow
193
+
194
+ Chrome DevTools integration with SPARC testing phase:
195
+
196
+ ```bash
197
+ # 1. Run architecture and implementation phases
198
+ /myai-dev-architect "Design blog system"
199
+ /myai-dev-code "Implement blog features"
200
+
201
+ # 2. Run testing with Chrome DevTools integration
202
+ /myai-dev-test "Test blog functionality" --integration
203
+
204
+ # The tester agent will:
205
+ # - Run unit tests (Jest/Mocha)
206
+ # - Launch browser via Chrome DevTools MCP
207
+ # - Execute integration tests
208
+ # - Capture screenshots for visual verification
209
+ # - Monitor network performance
210
+ # - Collect console logs
211
+ ```
212
+
213
+ ### Publishing Workflow
214
+
215
+ WordPress MCP for batch publishing:
216
+
217
+ ```bash
218
+ # 1. Create content
219
+ /myai-content-writer "10 Best Practices" --word_count 1500
220
+
221
+ # 2. Create session for tracking
222
+ # (WordPress MCP handles this automatically)
223
+
224
+ # 3. Publish with tracking
225
+ /myai-wordpress-publish "article.md" --status draft
226
+
227
+ # 4. Check session status
228
+ # Access via WordPress MCP wp_session_status tool
229
+ ```
230
+
231
+ ## npm Scripts
232
+
233
+ The package includes convenient npm scripts for MCP servers:
234
+
235
+ ```bash
236
+ # Start SPARC Orchestrator MCP server
237
+ npm run mcp:sparc
238
+
239
+ # Start WordPress MCP server
240
+ npm run mcp:start
241
+
242
+ # Check MCP server health
243
+ npm run mcp:health
244
+
245
+ # Check MCP server status
246
+ npm run mcp:status
247
+ ```
248
+
249
+ ## Advanced Features
250
+
251
+ ### SPARC Orchestrator Strategies
252
+
253
+ **Sequential Strategy**:
254
+ - Executes phases one at a time
255
+ - Waits for each phase to complete before proceeding
256
+ - Best for: Standard development, learning the methodology
257
+
258
+ **Parallel Strategy**:
259
+ - Executes independent phases concurrently
260
+ - Review and documentation can run in parallel after testing
261
+ - Best for: Large projects, time-sensitive deadlines
262
+
263
+ **Adaptive Strategy**:
264
+ - Intelligently routes tasks based on dependencies
265
+ - Optimizes execution based on available resources
266
+ - Best for: Complex projects, experienced teams
267
+
268
+ ### Chrome DevTools Network Monitoring
269
+
270
+ Monitor API calls, performance, and errors:
271
+
272
+ ```javascript
273
+ // Start network monitoring
274
+ mcp__chrome_devtools__cdp_network_monitor({
275
+ captureRequests: true,
276
+ captureResponses: true
277
+ })
278
+
279
+ // Navigate and interact
280
+ mcp__chrome_devtools__cdp_navigate({ url: "http://localhost:3000" })
281
+ mcp__chrome_devtools__cdp_evaluate({
282
+ expression: "document.querySelector('button').click()"
283
+ })
284
+
285
+ // Review network data for API calls, timing, errors
286
+ ```
287
+
288
+ ### WordPress Session Management
289
+
290
+ Track multi-step publishing workflows:
291
+
292
+ ```javascript
293
+ // Create session
294
+ mcp__myaidev_wordpress__wp_session_create({
295
+ purpose: "Batch blog publishing",
296
+ metadata: { batch_id: "2025-01-15" }
297
+ })
298
+
299
+ // Store workflow state in memory
300
+ mcp__myaidev_wordpress__wp_memory_store({
301
+ key: "publishing_queue",
302
+ value: ["post1.md", "post2.md", "post3.md"]
303
+ })
304
+
305
+ // Publish with session tracking
306
+ mcp__myaidev_wordpress__wp_batch_publish({
307
+ files: ["post1.md", "post2.md", "post3.md"],
308
+ status: "draft"
309
+ })
310
+
311
+ // Check session status
312
+ mcp__myaidev_wordpress__wp_session_status()
313
+ ```
314
+
315
+ ## Troubleshooting
316
+
317
+ ### SPARC Orchestrator Issues
318
+
319
+ **Problem**: Workflow not starting
320
+ - **Solution**: Check `~/.myaidev-method/workflows/` exists and is writable
321
+ - **Solution**: Verify Node.js version >= 18.0.0
322
+
323
+ **Problem**: Phase execution fails
324
+ - **Solution**: Check phase configuration in workflow JSON
325
+ - **Solution**: Verify all required tools are available (read, write, bash, etc.)
326
+
327
+ ### Chrome DevTools Issues
328
+
329
+ **Problem**: Cannot connect to browser
330
+ - **Solution**: Start Chrome with remote debugging: `chrome --remote-debugging-port=9222`
331
+ - **Solution**: Verify port 9222 is not in use
332
+
333
+ **Problem**: Screenshots not saving
334
+ - **Solution**: Check output directory exists and is writable
335
+ - **Solution**: Verify Chrome has screen capture permissions
336
+
337
+ ### WordPress MCP Issues
338
+
339
+ **Problem**: Authentication fails
340
+ - **Solution**: Verify WordPress Application Password is correct
341
+ - **Solution**: Check WordPress REST API is enabled
342
+ - **Solution**: Verify URL includes https:// protocol
343
+
344
+ **Problem**: Session data not persisting
345
+ - **Solution**: Check `~/.myaidev-method/` directory permissions
346
+ - **Solution**: Verify disk space is available
347
+
348
+ ## Best Practices
349
+
350
+ 1. **Start Simple**: Use slash commands before MCP orchestration
351
+ 2. **Test Incrementally**: Enable one MCP server at a time
352
+ 3. **Monitor Resources**: MCP servers consume memory, monitor usage
353
+ 4. **Use Sessions**: WordPress MCP sessions help track multi-step operations
354
+ 5. **Browser Testing**: Start browser with debugging enabled before using Chrome DevTools MCP
355
+ 6. **Workflow Persistence**: Review workflow JSON files for debugging
356
+ 7. **Error Handling**: MCP tools return detailed error messages, read them carefully
357
+
358
+ ## Documentation References
359
+
360
+ - **SPARC Methodology**: See [DEV_WORKFLOW_GUIDE.md](./DEV_WORKFLOW_GUIDE.md)
361
+ - **WordPress Publishing**: See [PUBLISHING_GUIDE.md](./PUBLISHING_GUIDE.md)
362
+ - **Chrome DevTools Protocol**: https://chromedevtools.github.io/devtools-protocol/
363
+ - **MCP Specification**: https://modelcontextprotocol.io/
364
+
365
+ ## Support
366
+
367
+ For issues with MCP servers:
368
+ - GitHub Issues: https://github.com/myaione/myaidev-method/issues
369
+ - Chrome DevTools MCP: https://github.com/ChromeDevTools/chrome-devtools-mcp
370
+
371
+ For general MyAIDev Method support:
372
+ - Documentation: https://github.com/myaione/myaidev-method
373
+ - User Guide: [USER_GUIDE.md](./USER_GUIDE.md)