@respira/wordpress-mcp-server 1.4.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 ADDED
@@ -0,0 +1,155 @@
1
+ # Respira WordPress MCP Server
2
+
3
+ MCP (Model Context Protocol) server for connecting AI coding assistants to WordPress sites.
4
+
5
+ ## Installation
6
+
7
+ ### From npm (Coming Soon)
8
+
9
+ ```bash
10
+ npm install -g @respira/wordpress-mcp-server
11
+ ```
12
+
13
+ ### From GitHub Releases
14
+
15
+ Since the repository is private, download the MCP server from GitHub releases:
16
+
17
+ 1. Go to [GitHub Releases](https://github.com/webmyc/respira-wordpress/releases)
18
+ 2. Find the latest release with tag `mcp-v*` (e.g., `mcp-v1.3.1`)
19
+ 3. Download the `respira-wordpress-mcp-server-*.zip` file
20
+ 4. Extract the archive to a location on your computer (e.g., `~/.respira/mcp-server/`)
21
+ 5. The extracted folder contains the `dist/` directory with the compiled server
22
+
23
+ **Note**: The repository is private, so you cannot clone it directly. Use the releases page to download pre-built packages.
24
+
25
+ ## Configuration
26
+
27
+ ### Option 1: Configuration File (Recommended)
28
+
29
+ Create a configuration file at `~/.respira/config.json`:
30
+
31
+ ```json
32
+ {
33
+ "sites": [
34
+ {
35
+ "id": "my-site",
36
+ "name": "My WordPress Site",
37
+ "url": "https://mysite.com",
38
+ "apiKey": "respira_your-api-key-here",
39
+ "default": true
40
+ }
41
+ ],
42
+ "preferences": {
43
+ "autoDuplicate": true,
44
+ "securityChecks": true
45
+ }
46
+ }
47
+ ```
48
+
49
+ ### Option 2: Environment Variables
50
+
51
+ Create a `.env` file:
52
+
53
+ ```bash
54
+ WP_SITE_URL=https://your-wordpress-site.com
55
+ WP_API_KEY=respira_your-api-key-here
56
+ ```
57
+
58
+ ## Usage
59
+
60
+ ### With Cursor
61
+
62
+ Add to your Cursor settings (`.cursor/mcp.json`):
63
+
64
+ ```json
65
+ {
66
+ "mcpServers": {
67
+ "respira-wordpress": {
68
+ "command": "node",
69
+ "args": ["/path/to/mcp-server/dist/index.js"]
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ ### With Claude Desktop
76
+
77
+ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
78
+
79
+ ```json
80
+ {
81
+ "mcpServers": {
82
+ "respira-wordpress": {
83
+ "command": "node",
84
+ "args": ["/path/to/mcp-server/dist/index.js"]
85
+ }
86
+ }
87
+ }
88
+ ```
89
+
90
+ ## Available Tools
91
+
92
+ ### Content Management
93
+ - `wordpress_get_site_context` - Get comprehensive site information
94
+ - `wordpress_get_theme_docs` - Get theme documentation
95
+ - `wordpress_get_builder_info` - Get page builder information
96
+ - `wordpress_list_pages` - List all pages
97
+ - `wordpress_read_page` - Get page content
98
+ - `wordpress_create_page_duplicate` - Duplicate a page for safe editing
99
+ - `wordpress_update_page` - Update page content
100
+ - `wordpress_delete_page` - Delete a page
101
+ - `wordpress_list_posts` - List all posts
102
+ - `wordpress_read_post` - Get post content
103
+ - `wordpress_create_post_duplicate` - Duplicate a post
104
+ - `wordpress_list_media` - List media files
105
+ - `wordpress_extract_builder_content` - Extract page builder content
106
+ - `wordpress_inject_builder_content` - Inject page builder content
107
+ - `wordpress_validate_security` - Validate content for security issues
108
+ - `wordpress_switch_site` - Switch between multiple WordPress sites
109
+
110
+ ### Page Speed Analysis
111
+ - `wordpress_analyze_performance` - Analyze page performance metrics (load time, optimization opportunities)
112
+ - `wordpress_get_core_web_vitals` - Get Core Web Vitals scores (LCP, FID, CLS)
113
+ - `wordpress_analyze_images` - Analyze image optimization opportunities
114
+
115
+ ### SEO Analysis
116
+ - `wordpress_analyze_seo` - Comprehensive SEO analysis (meta tags, headings, alt text, linking)
117
+ - `wordpress_check_seo_issues` - Check for common SEO issues and get recommendations
118
+ - `wordpress_analyze_readability` - Analyze content readability (Flesch Reading Ease, sentence structure)
119
+
120
+ ### AI Engine Optimization (AEO)
121
+ - `wordpress_analyze_aeo` - Analyze content for AI search engines (Perplexity, ChatGPT)
122
+ - `wordpress_check_structured_data` - Check schema markup and structured data (JSON-LD, microdata)
123
+
124
+ ### Plugin Management (EXPERIMENTAL)
125
+ - `wordpress_list_plugins` - List all installed plugins with status and version
126
+ - `wordpress_install_plugin` - Install a plugin from WordPress.org or ZIP URL
127
+ - `wordpress_activate_plugin` - Activate a plugin
128
+ - `wordpress_deactivate_plugin` - Deactivate a plugin
129
+ - `wordpress_update_plugin` - Update a plugin to the latest version
130
+ - `wordpress_delete_plugin` - Permanently delete a plugin
131
+
132
+ **Note**: Plugin management tools are EXPERIMENTAL and require the feature to be enabled in Respira settings (disabled by default for security). Use with caution and always have backups.
133
+
134
+ ## Development
135
+
136
+ ```bash
137
+ # Watch mode
138
+ npm run watch
139
+
140
+ # Build
141
+ npm run build
142
+
143
+ # Run
144
+ npm run start
145
+
146
+ # Lint
147
+ npm run lint
148
+
149
+ # Format
150
+ npm run format
151
+ ```
152
+
153
+ ## License
154
+
155
+ MIT
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Configuration management
3
+ */
4
+ import type { RespiraConfig, WordPressSiteConfig } from './types/index.js';
5
+ /**
6
+ * Load configuration from file
7
+ */
8
+ export declare function loadConfig(): RespiraConfig;
9
+ /**
10
+ * Save configuration to file
11
+ */
12
+ export declare function saveConfig(config: RespiraConfig): void;
13
+ /**
14
+ * Add a new site to configuration
15
+ */
16
+ export declare function addSite(site: WordPressSiteConfig): void;
17
+ /**
18
+ * Remove a site from configuration
19
+ */
20
+ export declare function removeSite(siteId: string): void;
21
+ /**
22
+ * Set default site
23
+ */
24
+ export declare function setDefaultSite(siteId: string): void;
25
+ /**
26
+ * Test connection to a WordPress site
27
+ */
28
+ export declare function testConnection(siteId: string): Promise<void>;
29
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAa3E;;GAEG;AACH,wBAAgB,UAAU,IAAI,aAAa,CAkE1C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAWtD;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAevD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAgB/C;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAiBnD;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBlE"}
package/dist/config.js ADDED
@@ -0,0 +1,162 @@
1
+ /**
2
+ * Configuration management
3
+ */
4
+ import { readFileSync, existsSync, writeFileSync, mkdirSync } from 'fs';
5
+ import { join } from 'path';
6
+ import { homedir } from 'os';
7
+ const CONFIG_DIR = join(homedir(), '.respira');
8
+ const CONFIG_FILE = join(CONFIG_DIR, 'config.json');
9
+ const DEFAULT_CONFIG = {
10
+ sites: [],
11
+ preferences: {
12
+ autoDuplicate: true,
13
+ securityChecks: true,
14
+ },
15
+ };
16
+ /**
17
+ * Load configuration from file
18
+ */
19
+ export function loadConfig() {
20
+ if (!existsSync(CONFIG_FILE)) {
21
+ console.error('No configuration file found. Creating default configuration...');
22
+ console.error(`Please edit ${CONFIG_FILE} to add your WordPress sites.`);
23
+ // Create directory if it doesn't exist
24
+ if (!existsSync(CONFIG_DIR)) {
25
+ mkdirSync(CONFIG_DIR, { recursive: true });
26
+ }
27
+ // Create default config
28
+ const exampleConfig = {
29
+ sites: [
30
+ {
31
+ id: 'example-site',
32
+ name: 'My WordPress Site',
33
+ url: 'https://example.com',
34
+ apiKey: 'respira_your-api-key-here',
35
+ default: true,
36
+ },
37
+ ],
38
+ preferences: {
39
+ autoDuplicate: true,
40
+ securityChecks: true,
41
+ },
42
+ };
43
+ saveConfig(exampleConfig);
44
+ throw new Error(`Configuration file created at ${CONFIG_FILE}\n` +
45
+ 'Please update it with your WordPress site URL and API key, then run again.');
46
+ }
47
+ try {
48
+ const configData = readFileSync(CONFIG_FILE, 'utf-8');
49
+ const config = JSON.parse(configData);
50
+ // Validate configuration
51
+ if (!config.sites || config.sites.length === 0) {
52
+ throw new Error('No WordPress sites configured in config.json');
53
+ }
54
+ // Validate each site
55
+ config.sites.forEach((site, index) => {
56
+ if (!site.id || !site.name || !site.url || !site.apiKey) {
57
+ throw new Error(`Site ${index + 1} is missing required fields (id, name, url, apiKey)`);
58
+ }
59
+ if (!site.apiKey.startsWith('respira_')) {
60
+ console.warn(`Warning: API key for "${site.name}" doesn't start with "respira_" prefix`);
61
+ }
62
+ });
63
+ return config;
64
+ }
65
+ catch (error) {
66
+ if (error.code === 'ENOENT') {
67
+ return DEFAULT_CONFIG;
68
+ }
69
+ if (error instanceof SyntaxError) {
70
+ throw new Error(`Invalid JSON in config file: ${CONFIG_FILE}\n${error.message}`);
71
+ }
72
+ const errorMessage = error?.message || error?.toString() || 'Unknown error';
73
+ throw new Error(`Failed to load configuration from ${CONFIG_FILE}: ${errorMessage}`);
74
+ }
75
+ }
76
+ /**
77
+ * Save configuration to file
78
+ */
79
+ export function saveConfig(config) {
80
+ try {
81
+ if (!existsSync(CONFIG_DIR)) {
82
+ mkdirSync(CONFIG_DIR, { recursive: true });
83
+ }
84
+ writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
85
+ console.error(`Configuration saved to ${CONFIG_FILE}`);
86
+ }
87
+ catch (error) {
88
+ throw new Error(`Failed to save configuration: ${error.message}`);
89
+ }
90
+ }
91
+ /**
92
+ * Add a new site to configuration
93
+ */
94
+ export function addSite(site) {
95
+ const config = loadConfig();
96
+ // Check for duplicate ID
97
+ if (config.sites.some((s) => s.id === site.id)) {
98
+ throw new Error(`Site with ID "${site.id}" already exists`);
99
+ }
100
+ // If this is the first site, make it default
101
+ if (config.sites.length === 0) {
102
+ site.default = true;
103
+ }
104
+ config.sites.push(site);
105
+ saveConfig(config);
106
+ }
107
+ /**
108
+ * Remove a site from configuration
109
+ */
110
+ export function removeSite(siteId) {
111
+ const config = loadConfig();
112
+ const index = config.sites.findIndex((s) => s.id === siteId);
113
+ if (index === -1) {
114
+ throw new Error(`Site with ID "${siteId}" not found`);
115
+ }
116
+ config.sites.splice(index, 1);
117
+ // If we removed the default site, make the first site default
118
+ if (config.sites.length > 0 && !config.sites.some((s) => s.default)) {
119
+ config.sites[0].default = true;
120
+ }
121
+ saveConfig(config);
122
+ }
123
+ /**
124
+ * Set default site
125
+ */
126
+ export function setDefaultSite(siteId) {
127
+ const config = loadConfig();
128
+ const site = config.sites.find((s) => s.id === siteId);
129
+ if (!site) {
130
+ throw new Error(`Site with ID "${siteId}" not found`);
131
+ }
132
+ // Remove default from all sites
133
+ config.sites.forEach((s) => {
134
+ s.default = false;
135
+ });
136
+ // Set new default
137
+ site.default = true;
138
+ saveConfig(config);
139
+ }
140
+ /**
141
+ * Test connection to a WordPress site
142
+ */
143
+ export async function testConnection(siteId) {
144
+ const config = loadConfig();
145
+ const site = config.sites.find((s) => s.id === siteId);
146
+ if (!site) {
147
+ throw new Error(`Site with ID "${siteId}" not found`);
148
+ }
149
+ const { WordPressClient } = await import('./wordpress-client.js');
150
+ const client = new WordPressClient(site);
151
+ try {
152
+ const context = await client.getSiteContext();
153
+ console.log(`✓ Connected to ${site.name}`);
154
+ console.log(` WordPress: ${context.wordpress_version}`);
155
+ console.log(` PHP: ${context.php_version}`);
156
+ console.log(` Theme: ${context.active_theme.name}`);
157
+ }
158
+ catch (error) {
159
+ throw new Error(`Connection test failed: ${error.message}`);
160
+ }
161
+ }
162
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAA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,CAAC,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,MAAc;IACjD,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAE5B,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC;IACvD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,iBAAiB,MAAM,aAAa,CAAC,CAAC;IACxD,CAAC;IAED,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC;IAClE,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;IAEzC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,cAAc,EAAE,CAAC;QAC9C,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,gBAAgB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC;QACzD,OAAO,CAAC,GAAG,CAAC,UAAU,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;QAC7C,OAAO,CAAC,GAAG,CAAC,YAAY,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,2BAA2B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Divi Builder Context and Documentation
3
+ *
4
+ * Provides comprehensive Divi documentation for AI assistants.
5
+ */
6
+ export declare const diviContext = "\nYou are editing a Divi Builder page. Divi uses a hierarchical structure: Sections > Rows > Modules.\n\n## Divi Structure\n\n- **Sections (et_pb_section)**: Top-level containers that hold rows\n- **Rows (et_pb_row)**: Column layout containers that hold modules\n- **Modules**: Content elements (text, images, buttons, etc.)\n\n## Common Divi Modules\n\n### Layout Modules\n- **et_pb_section**: Top-level container\n- **et_pb_row**: Column layout container\n\n### Content Modules (Tier 1 - Most Common)\n- **et_pb_text**: Text content module for paragraphs and headings\n - Attributes: content (HTML), text_color (hex), background_color (hex), font_size (px/em)\n- **et_pb_image**: Image module\n - Attributes: src (URL), alt (text), url (link URL), align (left/center/right)\n- **et_pb_button**: Button module\n - Attributes: button_text (text), button_url (URL), button_alignment (left/center/right), button_bg_color (hex)\n- **et_pb_cta**: Call to action module with heading, text, and button\n - Attributes: title (text), content (HTML), button_text (text), button_url (URL)\n- **et_pb_blurb**: Icon with text module\n - Attributes: title (text), content (HTML), image (URL), url (link URL)\n- **et_pb_video**: Video module\n - Attributes: src (URL - YouTube, Vimeo, or direct video), image_src (thumbnail URL)\n- **et_pb_html_content**: Custom HTML content module (supports scripts)\n - Attributes: content (HTML - can include scripts)\n- **et_pb_code**: Custom HTML/CSS/JS module\n - Attributes: content (base64 encoded)\n\n### Common Modules (Tier 2)\n- **et_pb_slider**: Content slider\n- **et_pb_testimonial**: Testimonial module\n- **et_pb_team_member**: Team member profile\n- **et_pb_pricing_tables**: Pricing table\n- **et_pb_contact_form**: Contact form\n- **et_pb_gallery**: Image gallery\n- **et_pb_accordion**: Accordion/toggle content\n- **et_pb_tabs**: Tabbed content\n- **et_pb_blog**: Blog posts display\n- **et_pb_portfolio**: Portfolio display\n\n## Common Attributes (Available on Most Modules)\n\n- **admin_label**: Label shown in builder for identification\n- **module_id**: Unique CSS ID for the module\n- **module_class**: Custom CSS class\n- **disabled_on**: Hide module on devices (format: \"off|off|off\" for desktop|tablet|phone)\n- **custom_css**: Custom CSS for this module\n- **background_color**: Background color (hex format: #FFFFFF)\n- **text_color**: Text color (hex format: #000000)\n- **padding**: Padding (format: \"10px|20px|10px|20px\" for top|right|bottom|left)\n- **margin**: Margin (same format as padding)\n\n## Format Specifications\n\n- **Colors**: Always use hex format (e.g., #0000FF for blue, #FFFFFF for white)\n- **Spacing**: Use format \"10px|20px|10px|20px\" (top|right|bottom|left)\n- **Sizing**: Use px, em, rem, %, or vw units\n- **Fonts**: Font names from Google Fonts or system fonts\n- **URLs**: Full URLs including https://\n\n## Common Tasks\n\n### Change Text Color\nFind the et_pb_text module and modify its text_color attribute to the desired hex color.\n\n### Update Heading\nFind the et_pb_text module containing the heading and modify its content attribute.\n\n### Add Button\nCreate an et_pb_button module with button_text and button_url attributes.\n\n### Change Background Color\nModify the background_color attribute of the section, row, or module.\n\n### Update Image\nFind the et_pb_image module and modify its src attribute to the new image URL.\n\n## Important Rules\n\n1. Modules MUST be inside rows (except sections)\n2. Rows MUST be inside sections\n3. Don't create bare modules without proper parent containers\n4. Check nesting depth (max 3 levels typical: section > row > module)\n5. Preserve all existing attributes when modifying modules\n6. Use proper attribute formats (hex for colors, URLs for links)\n";
7
+ export declare const diviAttributeHelp: {
8
+ colors: string;
9
+ spacing: string;
10
+ sizing: string;
11
+ fonts: string;
12
+ urls: string;
13
+ };
14
+ export declare const diviValidationRules = "\nCRITICAL Divi Rules:\n1. Modules MUST be inside rows (except sections which are top-level)\n2. Rows MUST be inside sections\n3. Don't create bare modules without parents\n4. Check nesting depth (max 3 levels typical: section > row > module)\n5. Preserve module structure when modifying\n6. Always use proper attribute formats\n";
15
+ //# sourceMappingURL=divi-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"divi-context.d.ts","sourceRoot":"","sources":["../src/divi-context.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,WAAW,8tHA0FvB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;CAM7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,8UAQ/B,CAAC"}
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Divi Builder Context and Documentation
3
+ *
4
+ * Provides comprehensive Divi documentation for AI assistants.
5
+ */
6
+ export const diviContext = `
7
+ You are editing a Divi Builder page. Divi uses a hierarchical structure: Sections > Rows > Modules.
8
+
9
+ ## Divi Structure
10
+
11
+ - **Sections (et_pb_section)**: Top-level containers that hold rows
12
+ - **Rows (et_pb_row)**: Column layout containers that hold modules
13
+ - **Modules**: Content elements (text, images, buttons, etc.)
14
+
15
+ ## Common Divi Modules
16
+
17
+ ### Layout Modules
18
+ - **et_pb_section**: Top-level container
19
+ - **et_pb_row**: Column layout container
20
+
21
+ ### Content Modules (Tier 1 - Most Common)
22
+ - **et_pb_text**: Text content module for paragraphs and headings
23
+ - Attributes: content (HTML), text_color (hex), background_color (hex), font_size (px/em)
24
+ - **et_pb_image**: Image module
25
+ - Attributes: src (URL), alt (text), url (link URL), align (left/center/right)
26
+ - **et_pb_button**: Button module
27
+ - Attributes: button_text (text), button_url (URL), button_alignment (left/center/right), button_bg_color (hex)
28
+ - **et_pb_cta**: Call to action module with heading, text, and button
29
+ - Attributes: title (text), content (HTML), button_text (text), button_url (URL)
30
+ - **et_pb_blurb**: Icon with text module
31
+ - Attributes: title (text), content (HTML), image (URL), url (link URL)
32
+ - **et_pb_video**: Video module
33
+ - Attributes: src (URL - YouTube, Vimeo, or direct video), image_src (thumbnail URL)
34
+ - **et_pb_html_content**: Custom HTML content module (supports scripts)
35
+ - Attributes: content (HTML - can include scripts)
36
+ - **et_pb_code**: Custom HTML/CSS/JS module
37
+ - Attributes: content (base64 encoded)
38
+
39
+ ### Common Modules (Tier 2)
40
+ - **et_pb_slider**: Content slider
41
+ - **et_pb_testimonial**: Testimonial module
42
+ - **et_pb_team_member**: Team member profile
43
+ - **et_pb_pricing_tables**: Pricing table
44
+ - **et_pb_contact_form**: Contact form
45
+ - **et_pb_gallery**: Image gallery
46
+ - **et_pb_accordion**: Accordion/toggle content
47
+ - **et_pb_tabs**: Tabbed content
48
+ - **et_pb_blog**: Blog posts display
49
+ - **et_pb_portfolio**: Portfolio display
50
+
51
+ ## Common Attributes (Available on Most Modules)
52
+
53
+ - **admin_label**: Label shown in builder for identification
54
+ - **module_id**: Unique CSS ID for the module
55
+ - **module_class**: Custom CSS class
56
+ - **disabled_on**: Hide module on devices (format: "off|off|off" for desktop|tablet|phone)
57
+ - **custom_css**: Custom CSS for this module
58
+ - **background_color**: Background color (hex format: #FFFFFF)
59
+ - **text_color**: Text color (hex format: #000000)
60
+ - **padding**: Padding (format: "10px|20px|10px|20px" for top|right|bottom|left)
61
+ - **margin**: Margin (same format as padding)
62
+
63
+ ## Format Specifications
64
+
65
+ - **Colors**: Always use hex format (e.g., #0000FF for blue, #FFFFFF for white)
66
+ - **Spacing**: Use format "10px|20px|10px|20px" (top|right|bottom|left)
67
+ - **Sizing**: Use px, em, rem, %, or vw units
68
+ - **Fonts**: Font names from Google Fonts or system fonts
69
+ - **URLs**: Full URLs including https://
70
+
71
+ ## Common Tasks
72
+
73
+ ### Change Text Color
74
+ Find the et_pb_text module and modify its text_color attribute to the desired hex color.
75
+
76
+ ### Update Heading
77
+ Find the et_pb_text module containing the heading and modify its content attribute.
78
+
79
+ ### Add Button
80
+ Create an et_pb_button module with button_text and button_url attributes.
81
+
82
+ ### Change Background Color
83
+ Modify the background_color attribute of the section, row, or module.
84
+
85
+ ### Update Image
86
+ Find the et_pb_image module and modify its src attribute to the new image URL.
87
+
88
+ ## Important Rules
89
+
90
+ 1. Modules MUST be inside rows (except sections)
91
+ 2. Rows MUST be inside sections
92
+ 3. Don't create bare modules without proper parent containers
93
+ 4. Check nesting depth (max 3 levels typical: section > row > module)
94
+ 5. Preserve all existing attributes when modifying modules
95
+ 6. Use proper attribute formats (hex for colors, URLs for links)
96
+ `;
97
+ export const diviAttributeHelp = {
98
+ colors: 'Use hex format: #0000FF (no rgb() or color names)',
99
+ spacing: 'Use format: 10px|20px|10px|20px (top|right|bottom|left)',
100
+ sizing: 'Use px, em, rem, %, or vw units',
101
+ fonts: 'Font names from Google Fonts or system fonts',
102
+ urls: 'Full URLs including https:// protocol',
103
+ };
104
+ export const diviValidationRules = `
105
+ CRITICAL Divi Rules:
106
+ 1. Modules MUST be inside rows (except sections which are top-level)
107
+ 2. Rows MUST be inside sections
108
+ 3. Don't create bare modules without parents
109
+ 4. Check nesting depth (max 3 levels typical: section > row > module)
110
+ 5. Preserve module structure when modifying
111
+ 6. Always use proper attribute formats
112
+ `;
113
+ //# sourceMappingURL=divi-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"divi-context.js","sourceRoot":"","sources":["../src/divi-context.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0F1B,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,MAAM,EAAE,mDAAmD;IAC3D,OAAO,EAAE,yDAAyD;IAClE,MAAM,EAAE,iCAAiC;IACzC,KAAK,EAAE,8CAA8C;IACrD,IAAI,EAAE,uCAAuC;CAC9C,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;CAQlC,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Divi Builder Prompt Templates
3
+ *
4
+ * Pre-built prompt expansions for common Divi editing tasks.
5
+ */
6
+ export interface DiviPrompt {
7
+ name: string;
8
+ description: string;
9
+ template: string;
10
+ }
11
+ export declare const diviPrompts: Record<string, DiviPrompt>;
12
+ export declare const diviCommonAttributes: string[];
13
+ export declare function getDiviPrompt(name: string): DiviPrompt | undefined;
14
+ export declare function expandDiviPrompt(promptName: string, variables: Record<string, string>): string;
15
+ //# sourceMappingURL=divi-prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"divi-prompts.d.ts","sourceRoot":"","sources":["../src/divi-prompts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAwFlD,CAAC;AAEF,eAAO,MAAM,oBAAoB,UAShC,CAAC;AAEF,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAElE;AAED,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,MAAM,CAYR"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Divi Builder Prompt Templates
3
+ *
4
+ * Pre-built prompt expansions for common Divi editing tasks.
5
+ */
6
+ export const diviPrompts = {
7
+ createHeroSection: {
8
+ name: 'create_divi_hero',
9
+ description: 'Create a Divi hero section with background and CTA',
10
+ template: `Create a Divi section with:
11
+ - Background image or color
12
+ - Centered text module with heading
13
+ - Button module for CTA
14
+
15
+ Structure:
16
+ [et_pb_section background_image="{bg_url}" background_color="{bg_color}"]
17
+ [et_pb_row]
18
+ [et_pb_text text_orientation="center"]
19
+ <h1>{heading}</h1>
20
+ <p>{subheading}</p>
21
+ [/et_pb_text]
22
+ [et_pb_button button_url="{url}" button_text="{text}" button_alignment="center"]
23
+ [/et_pb_button]
24
+ [/et_pb_row]
25
+ [/et_pb_section]`,
26
+ },
27
+ updateModuleStyle: {
28
+ name: 'update_divi_style',
29
+ description: 'Update visual styling of a Divi module',
30
+ template: `To update module styling, modify these common attributes:
31
+ - background_color: Use hex format (e.g., #0000FF)
32
+ - text_color: Use hex format (e.g., #FFFFFF)
33
+ - border_radius: Use px or % (e.g., 10px or 50%)
34
+ - padding: Use format "10px|20px|10px|20px" (top|right|bottom|left)
35
+ - margin: Same format as padding
36
+
37
+ Example: To make text blue, set text_color="#0000FF"`,
38
+ },
39
+ updateTextContent: {
40
+ name: 'update_divi_text',
41
+ description: 'Update text content in a Divi text module',
42
+ template: `Find the et_pb_text module and modify its content attribute.
43
+ Content can include HTML tags like <h1>, <p>, <strong>, <em>, etc.
44
+
45
+ Example:
46
+ - Original: <h1>Old Heading</h1>
47
+ - Updated: <h1>New Heading</h1>`,
48
+ },
49
+ addButton: {
50
+ name: 'add_divi_button',
51
+ description: 'Add a button module to a Divi page',
52
+ template: `Create an et_pb_button module with:
53
+ - button_text: The button label
54
+ - button_url: The link URL
55
+ - button_alignment: left, center, or right
56
+ - button_bg_color: Background color (hex format)
57
+ - button_text_color: Text color (hex format)
58
+
59
+ Example:
60
+ [et_pb_button button_text="Click Here" button_url="https://example.com" button_alignment="center" button_bg_color="#0000FF" button_text_color="#FFFFFF"]
61
+ [/et_pb_button]`,
62
+ },
63
+ updateImage: {
64
+ name: 'update_divi_image',
65
+ description: 'Update an image in a Divi image module',
66
+ template: `Find the et_pb_image module and modify:
67
+ - src: New image URL
68
+ - alt: Image alt text (for accessibility)
69
+ - url: Optional link URL if image should be clickable
70
+ - align: left, center, or right
71
+
72
+ Example:
73
+ [et_pb_image src="https://example.com/new-image.jpg" alt="Description" align="center"]
74
+ [/et_pb_image]`,
75
+ },
76
+ changeColors: {
77
+ name: 'change_divi_colors',
78
+ description: 'Change colors in Divi modules',
79
+ template: `To change colors:
80
+ 1. Find the module (section, row, or content module)
81
+ 2. Modify the color attribute:
82
+ - text_color: For text color (hex format)
83
+ - background_color: For background color (hex format)
84
+ - button_bg_color: For button background
85
+ - button_text_color: For button text
86
+
87
+ Always use hex format: #RRGGBB (e.g., #0000FF for blue)`,
88
+ },
89
+ };
90
+ export const diviCommonAttributes = [
91
+ 'background_color',
92
+ 'text_color',
93
+ 'border_radius',
94
+ 'padding',
95
+ 'margin',
96
+ 'admin_label',
97
+ 'module_id',
98
+ 'module_class',
99
+ ];
100
+ export function getDiviPrompt(name) {
101
+ return diviPrompts[name];
102
+ }
103
+ export function expandDiviPrompt(promptName, variables) {
104
+ const prompt = diviPrompts[promptName];
105
+ if (!prompt) {
106
+ return '';
107
+ }
108
+ let expanded = prompt.template;
109
+ Object.entries(variables).forEach(([key, value]) => {
110
+ expanded = expanded.replace(new RegExp(`\\{${key}\\}`, 'g'), value);
111
+ });
112
+ return expanded;
113
+ }
114
+ //# sourceMappingURL=divi-prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"divi-prompts.js","sourceRoot":"","sources":["../src/divi-prompts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,MAAM,CAAC,MAAM,WAAW,GAA+B;IACrD,iBAAiB,EAAE;QACjB,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,oDAAoD;QACjE,QAAQ,EAAE;;;;;;;;;;;;;;;iBAeG;KACd;IAED,iBAAiB,EAAE;QACjB,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,wCAAwC;QACrD,QAAQ,EAAE;;;;;;;qDAOuC;KAClD;IAED,iBAAiB,EAAE;QACjB,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,2CAA2C;QACxD,QAAQ,EAAE;;;;;gCAKkB;KAC7B;IAED,SAAS,EAAE;QACT,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,oCAAoC;QACjD,QAAQ,EAAE;;;;;;;;;gBASE;KACb;IAED,WAAW,EAAE;QACX,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,wCAAwC;QACrD,QAAQ,EAAE;;;;;;;;eAQC;KACZ;IAED,YAAY,EAAE;QACZ,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,+BAA+B;QAC5C,QAAQ,EAAE;;;;;;;;wDAQ0C;KACrD;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,kBAAkB;IAClB,YAAY;IACZ,eAAe;IACf,SAAS;IACT,QAAQ;IACR,aAAa;IACb,WAAW;IACX,cAAc;CACf,CAAC;AAEF,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,UAAkB,EAClB,SAAiC;IAEjC,MAAM,MAAM,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;IACvC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IAC/B,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACjD,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,KAAK,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Respira WordPress MCP Server
4
+ * Entry point
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;GAGG"}