myaidev-method 0.2.22 โ†’ 0.2.24-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 (59) hide show
  1. package/USER_GUIDE.md +453 -48
  2. package/bin/cli.js +236 -38
  3. package/content-rules.example.md +80 -0
  4. package/dist/mcp/mcp-launcher.js +237 -0
  5. package/dist/server/.tsbuildinfo +1 -1
  6. package/dist/server/auth/layers.d.ts +1 -1
  7. package/dist/server/auth/services/AuthService.d.ts +1 -1
  8. package/dist/server/auth/services/TokenService.js.map +1 -1
  9. package/dist/server/auth/services/example.d.ts +5 -5
  10. package/package.json +22 -17
  11. package/src/config/workflows.js +28 -44
  12. package/src/index.js +21 -8
  13. package/src/lib/ascii-banner.js +214 -0
  14. package/src/lib/config-manager.js +470 -0
  15. package/src/lib/content-generator.js +427 -0
  16. package/src/lib/html-conversion-utils.js +843 -0
  17. package/src/lib/seo-optimizer.js +515 -0
  18. package/src/lib/update-manager.js +2 -1
  19. package/src/lib/visual-config-utils.js +321 -295
  20. package/src/lib/visual-generation-utils.js +1000 -811
  21. package/src/lib/wordpress-client.js +633 -0
  22. package/src/lib/workflow-installer.js +3 -3
  23. package/src/scripts/configure-wordpress-mcp.js +8 -3
  24. package/src/scripts/generate-visual-cli.js +365 -235
  25. package/src/scripts/html-conversion-cli.js +526 -0
  26. package/src/scripts/init/configure.js +436 -0
  27. package/src/scripts/init/install.js +460 -0
  28. package/src/scripts/ping.js +250 -0
  29. package/src/scripts/utils/file-utils.js +404 -0
  30. package/src/scripts/utils/logger.js +300 -0
  31. package/src/scripts/utils/write-content.js +293 -0
  32. package/src/scripts/wordpress/publish-to-wordpress.js +165 -0
  33. package/src/server/auth/services/TokenService.ts +1 -1
  34. package/src/templates/claude/agents/content-rules-setup.md +657 -0
  35. package/src/templates/claude/agents/content-writer.md +328 -1
  36. package/src/templates/claude/agents/visual-content-generator.md +311 -8
  37. package/src/templates/claude/commands/myai-configure.md +1 -1
  38. package/src/templates/claude/commands/myai-content-rules-setup.md +204 -0
  39. package/src/templates/claude/commands/myai-convert-html.md +186 -0
  40. package/src/templates/codex/commands/myai-content-rules-setup.md +85 -0
  41. package/src/templates/diagrams/architecture.d2 +52 -0
  42. package/src/templates/diagrams/flowchart.d2 +42 -0
  43. package/src/templates/diagrams/sequence.d2 +47 -0
  44. package/src/templates/docs/content-creation-guide.md +164 -0
  45. package/src/templates/docs/deployment-guide.md +336 -0
  46. package/src/templates/docs/visual-generation-guide.md +248 -0
  47. package/src/templates/docs/wordpress-publishing-guide.md +208 -0
  48. package/src/templates/gemini/commands/myai-content-rules-setup.toml +57 -0
  49. package/src/templates/infographics/comparison-table.html +347 -0
  50. package/src/templates/infographics/data-chart.html +268 -0
  51. package/src/templates/infographics/process-flow.html +365 -0
  52. package/.claude/mcp/sparc-orchestrator-server.js +0 -607
  53. package/.claude/mcp/wordpress-server.js +0 -1277
  54. package/src/agents/content-writer-prompt.md +0 -164
  55. package/src/agents/content-writer.json +0 -70
  56. package/src/templates/claude/mcp_config.json +0 -74
  57. package/src/templates/claude/slash_commands.json +0 -166
  58. package/src/templates/scripts/configure-wordpress-mcp.js +0 -181
  59. /package/src/scripts/{wordpress-health-check.js โ†’ wordpress/wordpress-health-check.js} +0 -0
@@ -1,164 +0,0 @@
1
- # Content Writer Agent Prompt
2
-
3
- You are a professional content writer with expertise in creating high-quality, engaging, and SEO-optimized content. Your role is to produce well-researched articles, blog posts, and web content that serves the target audience while meeting business objectives.
4
-
5
- ## Core Competencies
6
-
7
- 1. **Writing Excellence**
8
- - Clear, concise, and engaging prose
9
- - Proper grammar, spelling, and punctuation
10
- - Varied sentence structure and rhythm
11
- - Active voice preference
12
- - Storytelling when appropriate
13
-
14
- 2. **SEO Optimization**
15
- - Natural keyword integration
16
- - Proper heading hierarchy (H1, H2, H3)
17
- - Meta descriptions (150-160 characters)
18
- - Internal and external linking suggestions
19
- - URL-friendly slugs
20
- - Alt text recommendations for images
21
-
22
- 3. **Content Structure**
23
- - Compelling introductions with hooks
24
- - Logical flow and transitions
25
- - Scannable formatting (bullets, lists, short paragraphs)
26
- - Strong conclusions with CTAs when appropriate
27
- - Pull quotes and highlights for emphasis
28
-
29
- 4. **Research & Accuracy**
30
- - Fact-checking all claims
31
- - Citing credible sources
32
- - Staying current with industry trends
33
- - Understanding the target audience
34
- - Competitive content analysis
35
-
36
- ## Writing Process
37
-
38
- ### Phase 1: Understanding
39
- - Identify the content purpose and goals
40
- - Define the target audience
41
- - Determine the desired tone and style
42
- - Clarify key messages and takeaways
43
-
44
- ### Phase 2: Research
45
- - Conduct thorough topic research
46
- - Analyze competitor content
47
- - Identify knowledge gaps to fill
48
- - Gather statistics and expert quotes
49
- - Find relevant examples and case studies
50
-
51
- ### Phase 3: Planning
52
- - Create a detailed outline
53
- - Organize information logically
54
- - Plan keyword placement
55
- - Identify supporting media needs
56
-
57
- ### Phase 4: Writing
58
- - Craft an attention-grabbing headline
59
- - Write a compelling introduction
60
- - Develop body content with proper structure
61
- - Include relevant examples and data
62
- - Create a memorable conclusion
63
-
64
- ### Phase 5: Optimization
65
- - Review for SEO best practices
66
- - Ensure readability (Flesch score 60+)
67
- - Add internal/external link suggestions
68
- - Include meta description
69
- - Suggest related content
70
-
71
- ### Phase 6: Final Review
72
- - Proofread for errors
73
- - Check factual accuracy
74
- - Verify tone consistency
75
- - Ensure goal alignment
76
-
77
- ## Content Guidelines
78
-
79
- ### Tone and Voice
80
- - Professional yet approachable
81
- - Confident without being condescending
82
- - Informative and educational
83
- - Engaging and conversational when appropriate
84
-
85
- ### Formatting Standards
86
- - Use Markdown for all content
87
- - Headers: H1 for title, H2 for main sections, H3 for subsections
88
- - Paragraphs: 2-4 sentences maximum
89
- - Lists: Use when presenting 3+ related items
90
- - Emphasis: Bold for key terms, italics for emphasis
91
- - Links: Descriptive anchor text
92
-
93
- ### SEO Best Practices
94
- - Primary keyword in title, first paragraph, and H2s
95
- - Related keywords throughout naturally
96
- - Answer user intent clearly
97
- - Include LSI (Latent Semantic Indexing) keywords
98
- - Optimize for featured snippets when relevant
99
-
100
- ## Output Requirements
101
-
102
- For each content piece, provide:
103
-
104
- ```json
105
- {
106
- "title": "Compelling, keyword-rich title",
107
- "meta_description": "150-160 character summary for search results",
108
- "slug": "url-friendly-version-of-title",
109
- "content": "Full markdown-formatted content",
110
- "tags": ["relevant", "topic", "tags"],
111
- "category": "Primary category",
112
- "featured_image_suggestion": "Description of ideal hero image",
113
- "word_count": 800,
114
- "reading_time": "4 minutes",
115
- "keywords": {
116
- "primary": "main keyword",
117
- "secondary": ["supporting", "keywords"]
118
- },
119
- "internal_links": [
120
- {
121
- "anchor_text": "relevant text",
122
- "suggested_url": "/path/to/related/content"
123
- }
124
- ],
125
- "external_links": [
126
- {
127
- "anchor_text": "source or reference",
128
- "url": "https://authoritative-source.com"
129
- }
130
- ]
131
- }
132
- ```
133
-
134
- ## Quality Checklist
135
-
136
- Before finalizing any content, ensure:
137
-
138
- - [ ] Title is compelling and includes primary keyword
139
- - [ ] Introduction hooks the reader within first 2 sentences
140
- - [ ] Content thoroughly addresses user intent
141
- - [ ] All facts are accurate and verifiable
142
- - [ ] Proper heading hierarchy is maintained
143
- - [ ] Content is scannable with varied formatting
144
- - [ ] Keywords are naturally integrated
145
- - [ ] Meta description summarizes content effectively
146
- - [ ] Conclusion provides value and next steps
147
- - [ ] No spelling or grammar errors
148
- - [ ] Tone is consistent throughout
149
- - [ ] Content is original and adds unique value
150
-
151
- ## Special Instructions
152
-
153
- When creating content:
154
-
155
- 1. Always prioritize user value over keyword density
156
- 2. Write for humans first, search engines second
157
- 3. Include actionable takeaways when relevant
158
- 4. Use data and examples to support claims
159
- 5. Address common questions and objections
160
- 6. Consider content repurposing opportunities
161
- 7. Suggest complementary content pieces
162
- 8. Include social media snippets when requested
163
-
164
- Remember: Quality content builds trust, authority, and engagement. Every piece should serve the reader while achieving business objectives.
@@ -1,70 +0,0 @@
1
- {
2
- "name": "content-writer",
3
- "description": "Professional content writer agent for creating high-quality articles, blog posts, and web content",
4
- "version": "1.0.0",
5
- "tools": ["Read", "Write", "Edit", "WebSearch", "WebFetch"],
6
- "prompt": {
7
- "role": "You are a professional content writer specializing in creating engaging, SEO-optimized content.",
8
- "instructions": [
9
- "Write in a clear, engaging, and professional tone",
10
- "Structure content with proper headings (H1, H2, H3)",
11
- "Include relevant keywords naturally throughout the content",
12
- "Ensure content is factually accurate and well-researched",
13
- "Create compelling introductions and conclusions",
14
- "Use bullet points and numbered lists where appropriate",
15
- "Maintain a consistent voice and style throughout",
16
- "Optimize for readability with short paragraphs and varied sentence structure",
17
- "Include a meta description suggestion when appropriate",
18
- "Format content in Markdown for easy conversion to HTML"
19
- ],
20
- "workflow": [
21
- {
22
- "step": 1,
23
- "action": "Understand the topic and target audience",
24
- "description": "Analyze the content request to identify key topics, audience, and goals"
25
- },
26
- {
27
- "step": 2,
28
- "action": "Research and gather information",
29
- "description": "Use WebSearch and WebFetch to gather relevant, up-to-date information"
30
- },
31
- {
32
- "step": 3,
33
- "action": "Create content outline",
34
- "description": "Structure the content with logical flow and proper headings"
35
- },
36
- {
37
- "step": 4,
38
- "action": "Write the content",
39
- "description": "Create the full content following SEO best practices"
40
- },
41
- {
42
- "step": 5,
43
- "action": "Review and optimize",
44
- "description": "Review for clarity, accuracy, and SEO optimization"
45
- },
46
- {
47
- "step": 6,
48
- "action": "Format and finalize",
49
- "description": "Ensure proper Markdown formatting and prepare for publishing"
50
- }
51
- ],
52
- "output_format": {
53
- "title": "string",
54
- "meta_description": "string (150-160 characters)",
55
- "slug": "string (URL-friendly)",
56
- "content": "markdown string",
57
- "tags": ["array", "of", "relevant", "tags"],
58
- "category": "string",
59
- "featured_image_suggestion": "string (description for image selection)"
60
- }
61
- },
62
- "configuration": {
63
- "default_word_count": 800,
64
- "min_word_count": 300,
65
- "max_word_count": 2500,
66
- "seo_optimization": true,
67
- "include_meta": true,
68
- "markdown_output": true
69
- }
70
- }
@@ -1,74 +0,0 @@
1
- {
2
- "mcpServers": {
3
- "wordpress": {
4
- "command": "node",
5
- "args": ["../../mcp/wordpress-server.js"],
6
- "env": {
7
- "WORDPRESS_URL": "${WORDPRESS_URL}",
8
- "WORDPRESS_USERNAME": "${WORDPRESS_USERNAME}",
9
- "WORDPRESS_APP_PASSWORD": "${WORDPRESS_APP_PASSWORD}"
10
- },
11
- "autoStart": false,
12
- "description": "WordPress MCP server for content management",
13
- "tools": [
14
- "wp_create_post",
15
- "wp_update_post",
16
- "wp_get_post",
17
- "wp_list_posts",
18
- "wp_upload_media",
19
- "wp_create_category",
20
- "wp_create_tag"
21
- ]
22
- },
23
- "openstack": {
24
- "command": "node",
25
- "args": ["../../mcp/openstack-server.js"],
26
- "env": {
27
- "OS_AUTH_URL": "${OS_AUTH_URL}",
28
- "OS_USERNAME": "${OS_USERNAME}",
29
- "OS_PASSWORD": "${OS_PASSWORD}",
30
- "OS_PROJECT_ID": "${OS_PROJECT_ID}",
31
- "OS_USER_DOMAIN_ID": "${OS_USER_DOMAIN_ID}",
32
- "OS_PROJECT_DOMAIN_ID": "${OS_PROJECT_DOMAIN_ID}",
33
- "OS_REGION_NAME": "${OS_REGION_NAME}",
34
- "OS_IDENTITY_API_VERSION": "3",
35
- "CLOUD_INIT": "${CLOUD_INIT}"
36
- },
37
- "autoStart": false,
38
- "description": "OpenStack MCP server for VM management and cloud orchestration",
39
- "tools": [
40
- "os_health_check",
41
- "os_session_create",
42
- "os_cloud_init_info",
43
- "os_cloud_init_fetch",
44
- "os_image_list",
45
- "os_flavor_list",
46
- "os_network_list",
47
- "os_security_group_list",
48
- "os_keypair_list",
49
- "os_keypair_create",
50
- "os_server_list",
51
- "os_server_create",
52
- "os_server_show",
53
- "os_server_delete",
54
- "os_server_start",
55
- "os_server_stop",
56
- "os_server_reboot",
57
- "os_server_console",
58
- "os_floating_ip_create",
59
- "os_floating_ip_list",
60
- "os_server_add_floating_ip",
61
- "os_volume_list",
62
- "os_volume_create",
63
- "os_server_add_volume",
64
- "os_operation_history"
65
- ]
66
- }
67
- },
68
- "configuration": {
69
- "auto_connect": false,
70
- "retry_on_failure": true,
71
- "max_retries": 3,
72
- "timeout": 30000
73
- }
74
- }
@@ -1,166 +0,0 @@
1
- {
2
- "commands": [
3
- {
4
- "name": "myai-content-writer",
5
- "description": "Launch the professional content writer agent for creating articles and blog posts",
6
- "handler": "content-writer",
7
- "configuration": {
8
- "agent_file": "../../agents/content-writer.json",
9
- "prompt_file": "../../agents/content-writer-prompt.md",
10
- "tools": ["Read", "Write", "Edit", "WebSearch", "WebFetch", "Task"],
11
- "parameters": {
12
- "topic": {
13
- "type": "string",
14
- "required": true,
15
- "description": "The topic or title for the content"
16
- },
17
- "word_count": {
18
- "type": "number",
19
- "required": false,
20
- "default": 800,
21
- "description": "Target word count for the content"
22
- },
23
- "audience": {
24
- "type": "string",
25
- "required": false,
26
- "description": "Target audience for the content"
27
- },
28
- "tone": {
29
- "type": "string",
30
- "required": false,
31
- "default": "professional",
32
- "options": ["professional", "casual", "technical", "conversational", "academic"],
33
- "description": "Tone of voice for the content"
34
- },
35
- "seo_keywords": {
36
- "type": "array",
37
- "required": false,
38
- "description": "Primary and secondary keywords for SEO"
39
- },
40
- "publish_to_wordpress": {
41
- "type": "boolean",
42
- "required": false,
43
- "default": false,
44
- "description": "Automatically publish as draft to WordPress"
45
- }
46
- }
47
- },
48
- "examples": [
49
- {
50
- "command": "/myai-content-writer \"10 Best Practices for Remote Work\"",
51
- "description": "Create an article about remote work best practices"
52
- },
53
- {
54
- "command": "/myai-content-writer \"AI in Healthcare\" --word_count 1500 --tone technical --audience \"healthcare professionals\"",
55
- "description": "Create a technical article about AI in healthcare for professionals"
56
- },
57
- {
58
- "command": "/myai-content-writer \"Summer Garden Tips\" --seo_keywords \"garden tips,summer gardening,outdoor plants\" --publish_to_wordpress true",
59
- "description": "Create SEO-optimized garden content and publish to WordPress"
60
- }
61
- ],
62
- "workflow": {
63
- "steps": [
64
- {
65
- "step": 1,
66
- "action": "Parse command parameters",
67
- "description": "Extract topic, word count, and other parameters from the command"
68
- },
69
- {
70
- "step": 2,
71
- "action": "Load agent configuration",
72
- "description": "Load the content-writer agent configuration and prompt"
73
- },
74
- {
75
- "step": 3,
76
- "action": "Initialize agent with prompt",
77
- "description": "Initialize the agent with the specialized content writer prompt"
78
- },
79
- {
80
- "step": 4,
81
- "action": "Execute content creation",
82
- "description": "Agent researches and creates the content following the workflow"
83
- },
84
- {
85
- "step": 5,
86
- "action": "Save content locally",
87
- "description": "Save the generated content to a markdown file"
88
- },
89
- {
90
- "step": 6,
91
- "action": "Publish to WordPress (optional)",
92
- "description": "If requested, publish the content as a draft to WordPress"
93
- }
94
- ]
95
- }
96
- },
97
- {
98
- "name": "myai-wordpress-publish",
99
- "description": "Publish existing content to WordPress as a draft",
100
- "handler": "wordpress-publisher",
101
- "configuration": {
102
- "mcp_config": "../../mcp/wordpress-mcp.json",
103
- "tools": ["Read", "Task"],
104
- "parameters": {
105
- "file": {
106
- "type": "string",
107
- "required": true,
108
- "description": "Path to the markdown file to publish"
109
- },
110
- "status": {
111
- "type": "string",
112
- "required": false,
113
- "default": "draft",
114
- "options": ["draft", "publish", "pending", "private"],
115
- "description": "WordPress post status"
116
- }
117
- }
118
- },
119
- "examples": [
120
- {
121
- "command": "/myai-wordpress-publish \"content/my-article.md\"",
122
- "description": "Publish a markdown file to WordPress as draft"
123
- },
124
- {
125
- "command": "/myai-wordpress-publish \"blog-post.md\" --status publish",
126
- "description": "Publish directly to WordPress (live)"
127
- }
128
- ]
129
- },
130
- {
131
- "name": "myai-configure",
132
- "description": "Configure MyAI settings including WordPress credentials",
133
- "handler": "configuration",
134
- "configuration": {
135
- "tools": ["Read", "Write", "Edit"],
136
- "parameters": {
137
- "setting": {
138
- "type": "string",
139
- "required": true,
140
- "options": ["wordpress", "defaults", "agents"],
141
- "description": "Which setting to configure"
142
- }
143
- }
144
- },
145
- "examples": [
146
- {
147
- "command": "/myai-configure wordpress",
148
- "description": "Configure WordPress connection settings"
149
- },
150
- {
151
- "command": "/myai-configure defaults",
152
- "description": "Configure default settings for content creation"
153
- }
154
- ]
155
- }
156
- ],
157
- "global_configuration": {
158
- "prefix": "myai",
159
- "version": "1.0.0",
160
- "auto_load": true,
161
- "requirements": {
162
- "claude_code_version": ">=1.0.0",
163
- "node_version": ">=18.0.0"
164
- }
165
- }
166
- }
@@ -1,181 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import fs from 'fs-extra';
4
- import path from 'path';
5
- import dotenv from 'dotenv';
6
- import { fileURLToPath } from 'url';
7
-
8
- const __filename = fileURLToPath(import.meta.url);
9
- const __dirname = path.dirname(__filename);
10
-
11
- /**
12
- * Configure WordPress MCP integration for Claude Code
13
- * This script creates the .mcp.json file required for Claude Code to recognize
14
- * and use the WordPress MCP server
15
- */
16
- export async function configureWordPressMCP(projectDir = process.cwd()) {
17
- try {
18
- console.log('๐Ÿ”ง Configuring WordPress MCP integration...');
19
-
20
- // Load environment variables from .env file
21
- const envPath = path.join(projectDir, '.env');
22
- if (!fs.existsSync(envPath)) {
23
- throw new Error('.env file not found. Please run WordPress configuration first.');
24
- }
25
-
26
- dotenv.config({ path: envPath });
27
-
28
- // Validate required environment variables
29
- const requiredVars = ['WORDPRESS_URL', 'WORDPRESS_USERNAME', 'WORDPRESS_APP_PASSWORD'];
30
- const missing = requiredVars.filter(varName => !process.env[varName]);
31
-
32
- if (missing.length > 0) {
33
- throw new Error(`Missing required environment variables: ${missing.join(', ')}`);
34
- }
35
-
36
- // Check if MCP server files exist
37
- const mcpServerPath = path.join(projectDir, '.claude/mcp/wordpress-server.js');
38
- const gutenbergConverterPath = path.join(projectDir, '.claude/mcp/gutenberg-converter.js');
39
-
40
- if (!fs.existsSync(mcpServerPath)) {
41
- throw new Error(`WordPress MCP server not found at: ${mcpServerPath}`);
42
- }
43
-
44
- if (!fs.existsSync(gutenbergConverterPath)) {
45
- throw new Error(`Gutenberg converter not found at: ${gutenbergConverterPath}`);
46
- }
47
-
48
- // Create MCP configuration
49
- const mcpConfigPath = path.join(projectDir, '.mcp.json');
50
-
51
- // Use relative path for portability across different environments
52
- const relativeMcpServerPath = ".claude/mcp/wordpress-server.js";
53
-
54
- const mcpConfig = {
55
- mcpServers: {
56
- wordpress: {
57
- command: "node",
58
- args: [relativeMcpServerPath],
59
- env: {
60
- WORDPRESS_URL: process.env.WORDPRESS_URL,
61
- WORDPRESS_USERNAME: process.env.WORDPRESS_USERNAME,
62
- WORDPRESS_APP_PASSWORD: process.env.WORDPRESS_APP_PASSWORD,
63
- WORDPRESS_USE_GUTENBERG: process.env.WORDPRESS_USE_GUTENBERG || "false"
64
- }
65
- }
66
- }
67
- };
68
-
69
- // If .mcp.json already exists, merge with existing configuration
70
- let existingConfig = {};
71
- if (fs.existsSync(mcpConfigPath)) {
72
- try {
73
- existingConfig = JSON.parse(fs.readFileSync(mcpConfigPath, 'utf8'));
74
- console.log('๐Ÿ“ Found existing .mcp.json file, merging configuration...');
75
- } catch (error) {
76
- console.warn('โš ๏ธ Existing .mcp.json file is invalid, creating new one...');
77
- }
78
- }
79
-
80
- // Merge configurations
81
- const finalConfig = {
82
- ...existingConfig,
83
- mcpServers: {
84
- ...existingConfig.mcpServers,
85
- ...mcpConfig.mcpServers
86
- }
87
- };
88
-
89
- // Write MCP configuration file
90
- fs.writeFileSync(mcpConfigPath, JSON.stringify(finalConfig, null, 2));
91
- console.log('โœ… Created .mcp.json configuration file');
92
-
93
- // Set executable permissions on MCP server
94
- try {
95
- fs.chmodSync(mcpServerPath, 0o755);
96
- console.log('โœ… Set executable permissions on WordPress MCP server');
97
- } catch (error) {
98
- console.warn('โš ๏ธ Could not set executable permissions:', error.message);
99
- }
100
-
101
- // Test MCP server startup
102
- console.log('๐Ÿงช Testing MCP server startup...');
103
-
104
- try {
105
- const { spawn } = await import('child_process');
106
-
107
- return new Promise((resolve, reject) => {
108
- const testProcess = spawn('node', [relativeMcpServerPath], {
109
- cwd: projectDir, // Set working directory to project root
110
- env: { ...process.env, ...mcpConfig.mcpServers.wordpress.env },
111
- stdio: ['pipe', 'pipe', 'pipe']
112
- });
113
-
114
- let stderr = '';
115
- testProcess.stderr.on('data', (data) => {
116
- stderr += data.toString();
117
- });
118
-
119
- // Give the server 3 seconds to start up
120
- setTimeout(() => {
121
- testProcess.kill('SIGTERM');
122
-
123
- if (stderr.includes('WordPress MCP Server running') || stderr.includes('Server running')) {
124
- console.log('โœ… MCP server startup test successful');
125
- resolve(true);
126
- } else if (stderr.includes('Error') || stderr.includes('Missing required environment')) {
127
- console.error('โŒ MCP server startup failed:', stderr);
128
- reject(new Error('MCP server failed to start'));
129
- } else {
130
- console.log('โœ… MCP server appears to be working');
131
- resolve(true);
132
- }
133
- }, 3000);
134
-
135
- testProcess.on('error', (error) => {
136
- reject(new Error(`Failed to start MCP server: ${error.message}`));
137
- });
138
- });
139
- } catch (testError) {
140
- console.warn('โš ๏ธ Could not test MCP server startup:', testError.message);
141
- console.log(' MCP configuration created, but please test manually if needed');
142
- }
143
-
144
- console.log('\n๐ŸŽ‰ WordPress MCP integration configured successfully!');
145
- console.log('\n๐Ÿ“‹ Configuration Summary:');
146
- console.log(` โ€ข WordPress URL: ${process.env.WORDPRESS_URL}`);
147
- console.log(` โ€ข Username: ${process.env.WORDPRESS_USERNAME}`);
148
- console.log(` โ€ข Gutenberg mode: ${process.env.WORDPRESS_USE_GUTENBERG || 'false'}`);
149
- console.log(` โ€ข MCP config: ${mcpConfigPath}`);
150
- console.log(` โ€ข MCP server: ${relativeMcpServerPath}`);
151
-
152
- console.log('\n๐Ÿ”„ Next steps:');
153
- console.log(' 1. Restart Claude Code to load the new MCP configuration');
154
- console.log(' 2. Use WordPress MCP tools in your agents and commands');
155
- console.log(' 3. Test with: /myai-wordpress-admin or /myai-wordpress-publish');
156
-
157
- return true;
158
-
159
- } catch (error) {
160
- console.error('โŒ WordPress MCP configuration failed:', error.message);
161
- console.log('\n๐Ÿ› ๏ธ Troubleshooting:');
162
- console.log(' โ€ข Ensure WordPress credentials are configured in .env');
163
- console.log(' โ€ข Check that .claude/mcp/wordpress-server.js exists');
164
- console.log(' โ€ข Verify Node.js version is 18+ (required for MCP SDK)');
165
- console.log(' โ€ข Run: npm install to ensure dependencies are installed');
166
-
167
- return false;
168
- }
169
- }
170
-
171
- // Allow running as standalone script
172
- if (import.meta.url === `file://${process.argv[1]}`) {
173
- configureWordPressMCP()
174
- .then((success) => {
175
- process.exit(success ? 0 : 1);
176
- })
177
- .catch((error) => {
178
- console.error('Configuration script error:', error);
179
- process.exit(1);
180
- });
181
- }