@noleemits/vision-builder-control-mcp 4.43.0 → 4.44.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.
Files changed (2) hide show
  1. package/index.js +61 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -108,7 +108,7 @@ process.on('SIGINT', () => {
108
108
  // CONFIG
109
109
  // ================================================================
110
110
 
111
- const VERSION = '4.43.0';
111
+ const VERSION = '4.44.0';
112
112
  const MIN_PLUGIN_VERSION = '4.13.0'; // Minimum WP plugin version required by this MCP server
113
113
 
114
114
  // ================================================================
@@ -2150,9 +2150,41 @@ function getToolDefinitions() {
2150
2150
  required: ['page_id', 'element_id', 'target_parent_id']
2151
2151
  }
2152
2152
  },
2153
+ {
2154
+ name: 'set_container_layout',
2155
+ description: 'Set a container\'s layout (flex/grid) from a clean intent — prefer this over raw update_element when you want WYSIWYG-editable native Elementor layout instead of custom_css workarounds. Translates {mode, columns, gap, responsive} into the full Elementor schema (container_type, grid_columns_grid object, gap object shape, _tablet/_mobile variants, etc.). Modes: "grid" (uses Elementor native CSS Grid — best for card layouts), "flex-row" (horizontal flex), "flex-column" (vertical stack). Defaults: gap=24px, responsive=auto (tablet halves columns, mobile = 1 col). Pass responsive: false to skip responsive variants. Only operates on containers (rejected with invalid_target if you target a widget). The resulting layout shows up in Elementor\'s Layout panel as if a human set it, so non-technical editors can modify it through the UI. v4.44.0+.',
2156
+ inputSchema: {
2157
+ type: 'object',
2158
+ properties: {
2159
+ page_id: { type: 'number', description: 'WordPress page ID' },
2160
+ container_id: { type: 'string', description: 'Elementor ID of the container to configure' },
2161
+ mode: { type: 'string', enum: ['grid', 'flex-row', 'flex-column'], description: 'Layout mode' },
2162
+ columns: { type: 'number', description: 'Grid mode: number of columns (default 3). Ignored for flex modes.' },
2163
+ rows: { type: 'number', description: 'Grid mode: number of explicit rows (default 1).' },
2164
+ gap: { description: 'Gap in px (number) or object {row, column, unit?}. Default 24.' },
2165
+ auto_flow: { type: 'string', enum: ['row', 'column', 'dense'], description: 'Grid auto-flow direction.' },
2166
+ align_items: {
2167
+ type: 'string',
2168
+ description: 'Cross-axis alignment. Grid: start|center|end|stretch. Flex: flex-start|center|flex-end|stretch|baseline.',
2169
+ },
2170
+ justify_items: { type: 'string', enum: ['start', 'center', 'end', 'stretch'], description: 'Grid-only: per-item main-axis alignment.' },
2171
+ justify_content: {
2172
+ type: 'string',
2173
+ enum: ['flex-start', 'center', 'flex-end', 'space-between', 'space-around', 'space-evenly'],
2174
+ description: 'Flex-only: main-axis distribution.',
2175
+ },
2176
+ wrap: { type: 'string', enum: ['wrap', 'nowrap'], description: 'Flex-only: wrap behavior.' },
2177
+ responsive: {
2178
+ description: 'Responsive variants. Default = true (auto: tablet halved, mobile 1 col). Pass false to skip variants. Or pass { tablet: {columns, gap}, mobile: {columns, gap} } for explicit values.',
2179
+ },
2180
+ force: { type: 'boolean', description: 'Override edit locks (default: false)' }
2181
+ },
2182
+ required: ['page_id', 'container_id', 'mode']
2183
+ }
2184
+ },
2153
2185
  {
2154
2186
  name: 'update_element',
2155
- description: 'Update any element\'s settings by its Elementor ID or path. Patch widget properties like hover_color, background_color, __globals__ overrides, text, link URLs, etc. Supports dot-notation for nested keys (e.g. "__globals__.hover_color"). Supports element_path as alternative to element_id (e.g. "sectionId/1/0" = section → child 1 → child 0). Use list_elements or export_page first to find the element ID and current settings. IMPORTANT: Prefer settings_json (JSON string) over settings (object) for reliable MCP transport. AUTO-INJECTED KEYS: background_background:"classic" auto-set when you set background_color; typography_typography:"custom" auto-set when you set font properties; flex_grow expands to all 3 required keys; grid column strings auto-wrapped in object format. ICON WIDGET: For view="default" use "icon_size" for dimensions. For view="stacked" or "framed" (circle/square background) use "size" instead — "icon_size" is silently ignored in stacked/framed mode. LOOP-GRID WIDGET: query settings use the prefix "post_query_" (post_query_post_type, post_query_orderby, post_query_order, post_query_posts_per_page) — NOT "posts_post_type". Setting "posts_post_type" is silently accepted but ignored. RACE CONDITION: when patching multiple elements on the SAME page in parallel, use batch_update_elements instead — parallel update_element calls can clobber each other. ATOMIC SCHEMA VALIDATION (v4.42.5+): writes that violate the Elementor V4 atomic schema are rejected up front (HTTP 400 invalid_atomic_setting) instead of silently corrupting the page. Currently enforced: e-heading.tag ∈ {h1..h6}, e-paragraph.tag ∈ {p, span}. If you need a non-heading visual element styled like an eyebrow, use e-paragraph (tag=p or span) — not e-heading with tag=div.',
2187
+ description: 'Update any element\'s settings by its Elementor ID or path. Patch widget properties like hover_color, background_color, __globals__ overrides, text, link URLs, etc. Supports dot-notation for nested keys (e.g. "__globals__.hover_color"). Supports element_path as alternative to element_id (e.g. "sectionId/1/0" = section → child 1 → child 0). Use list_elements or export_page first to find the element ID and current settings. IMPORTANT: Prefer settings_json (JSON string) over settings (object) for reliable MCP transport. AUTO-INJECTED KEYS: background_background:"classic" auto-set when you set background_color; typography_typography:"custom" auto-set when you set font properties; flex_grow expands to all 3 required keys; grid column strings auto-wrapped in object format. ICON WIDGET: For view="default" use "icon_size" for dimensions. For view="stacked" or "framed" (circle/square background) use "size" instead — "icon_size" is silently ignored in stacked/framed mode. LOOP-GRID WIDGET: query settings use the prefix "post_query_" (post_query_post_type, post_query_orderby, post_query_order, post_query_posts_per_page) — NOT "posts_post_type". Setting "posts_post_type" is silently accepted but ignored. RACE CONDITION: when patching multiple elements on the SAME page in parallel, use batch_update_elements instead — parallel update_element calls can clobber each other. ATOMIC SCHEMA VALIDATION (v4.42.5+): writes that violate the Elementor V4 atomic schema are rejected up front (HTTP 400 invalid_atomic_setting) instead of silently corrupting the page. Currently enforced: e-heading.tag ∈ {h1..h6}, e-paragraph.tag ∈ {p, span}. If you need a non-heading visual element styled like an eyebrow, use e-paragraph (tag=p or span) — not e-heading with tag=div. NATIVE GRID/FLEX TIP: for container layout (grid columns, flex direction, gap), prefer set_container_layout — it produces WYSIWYG-editable native settings instead of forcing you to assemble the raw Elementor schema.',
2156
2188
  inputSchema: {
2157
2189
  type: 'object',
2158
2190
  properties: {
@@ -4096,6 +4128,33 @@ async function handleToolCall(name, args) {
4096
4128
  return ok(`Moved ${r.element_type} (${r.element_id}) to parent ${r.target_parent_id}${r.position !== null ? ` at position ${r.position}` : ''}`);
4097
4129
  }
4098
4130
 
4131
+ case 'set_container_layout': {
4132
+ try {
4133
+ const body = {
4134
+ container_id: args.container_id,
4135
+ mode: args.mode,
4136
+ };
4137
+ if (args.columns !== undefined) body.columns = args.columns;
4138
+ if (args.rows !== undefined) body.rows = args.rows;
4139
+ if (args.gap !== undefined) body.gap = args.gap;
4140
+ if (args.auto_flow) body.auto_flow = args.auto_flow;
4141
+ if (args.align_items) body.align_items = args.align_items;
4142
+ if (args.justify_items) body.justify_items = args.justify_items;
4143
+ if (args.justify_content) body.justify_content = args.justify_content;
4144
+ if (args.wrap) body.wrap = args.wrap;
4145
+ if (args.responsive !== undefined) body.responsive = args.responsive;
4146
+ if (args.force) body.force = true;
4147
+ const r = await apiCall(`/pages/${args.page_id}/set-container-layout`, 'POST', body);
4148
+ if (r.code || r.error) return ok(`Failed: ${r.message || r.error || 'Unknown error'}`);
4149
+ return ok(
4150
+ `Container ${r.container_id} set to ${r.mode} on page ${r.page_id}.\n` +
4151
+ `Applied keys: ${(r.applied_keys || []).join(', ')}`
4152
+ );
4153
+ } catch (err) {
4154
+ return ok(`Failed: ${err.message}`);
4155
+ }
4156
+ }
4157
+
4099
4158
  case 'update_element': {
4100
4159
  // Resolve settings: prefer settings_json (string) for reliable MCP transport, fall back to settings (object)
4101
4160
  let settings = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noleemits/vision-builder-control-mcp",
3
- "version": "4.43.0",
3
+ "version": "4.44.0",
4
4
  "description": "Vision Builder Control MCP server - design token-driven page builder tools for WordPress/Elementor websites",
5
5
  "type": "module",
6
6
  "main": "index.js",