@noleemits/vision-builder-control-mcp 4.37.0 → 4.38.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 (2) hide show
  1. package/index.js +47 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -107,7 +107,7 @@ process.on('SIGINT', () => {
107
107
  // CONFIG
108
108
  // ================================================================
109
109
 
110
- const VERSION = '4.37.0';
110
+ const VERSION = '4.38.1';
111
111
  const MIN_PLUGIN_VERSION = '4.13.0'; // Minimum WP plugin version required by this MCP server
112
112
 
113
113
  // ================================================================
@@ -2151,7 +2151,7 @@ function getToolDefinitions() {
2151
2151
  },
2152
2152
  {
2153
2153
  name: 'update_element',
2154
- 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.',
2154
+ 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.',
2155
2155
  inputSchema: {
2156
2156
  type: 'object',
2157
2157
  properties: {
@@ -2309,11 +2309,12 @@ function getToolDefinitions() {
2309
2309
  },
2310
2310
  {
2311
2311
  name: 'get_post',
2312
- description: 'Get a single WordPress post/page with ALL details: content, excerpt, Elementor status, RankMath SEO data (title, description, keywords, score), taxonomies (categories, tags), and featured image.',
2312
+ description: 'Get a single WordPress post/page with ALL details: content, excerpt, Elementor status, RankMath SEO data (title, description, keywords, score), taxonomies (categories, tags), and featured image. Pass full_content=true to return the complete raw post_content (default: 500-char preview).',
2313
2313
  inputSchema: {
2314
2314
  type: 'object',
2315
2315
  properties: {
2316
- post_id: { type: 'number', description: 'WordPress post/page ID' }
2316
+ post_id: { type: 'number', description: 'WordPress post/page ID' },
2317
+ full_content: { type: 'boolean', description: 'If true, return the complete raw post_content instead of a 500-char preview. Default: false.' }
2317
2318
  },
2318
2319
  required: ['post_id']
2319
2320
  }
@@ -3248,6 +3249,21 @@ function getToolDefinitions() {
3248
3249
  required: ['source_id', 'section_index', 'target_id']
3249
3250
  }
3250
3251
  },
3252
+ {
3253
+ name: 'clone_template',
3254
+ description: 'Clone an entire Theme Builder template (single, archive, loop-item, header, footer, popup) in one call. Auto-handles the elementor_library_type taxonomy, _elementor_template_type meta, edit-mode meta, and (optionally) display conditions. Saves 4-5 calls (create_post + copy_section × N + display_conditions) into one. Use this instead of stitching those calls together when you need a brand-new Theme Builder template based on an existing design.',
3255
+ inputSchema: {
3256
+ type: 'object',
3257
+ properties: {
3258
+ source_template_id: { type: 'number', description: 'Existing template ID to clone (must be a post of type elementor_library)' },
3259
+ title: { type: 'string', description: 'Title for the new template (e.g. "WAL Single Location")' },
3260
+ slug: { type: 'string', description: 'Optional URL slug. Auto-derived from title if omitted.' },
3261
+ conditions: { type: 'array', items: { type: 'string' }, description: 'Display conditions to set on the new template, e.g. ["include/singular/location"] or ["include/archive/location_archive"]. Omit to leave unset.' },
3262
+ status: { type: 'string', enum: ['publish', 'draft', 'private', 'pending'], description: 'Post status (default: publish)' }
3263
+ },
3264
+ required: ['source_template_id', 'title']
3265
+ }
3266
+ },
3251
3267
  {
3252
3268
  name: 'append_section',
3253
3269
  description: 'Append a section to an existing page or template without downloading the full template. Pass the section JSON directly — no need to export, merge, and re-upload. Useful for adding CTA sections, footers, or any reusable block.',
@@ -4313,8 +4329,8 @@ async function handleToolCall(name, args) {
4313
4329
  }
4314
4330
  }
4315
4331
  if (r.content) {
4316
- const preview = r.content.length > 500 ? r.content.slice(0, 500) + '...' : r.content;
4317
- out += `\n--- CONTENT (${r.content_length} chars) ---\n${preview}\n`;
4332
+ const body = args.full_content ? r.content : (r.content.length > 500 ? r.content.slice(0, 500) + '...' : r.content);
4333
+ out += `\n--- CONTENT (${r.content_length} chars) ---\n${body}\n`;
4318
4334
  }
4319
4335
  return ok(out);
4320
4336
  }
@@ -5619,6 +5635,31 @@ async function handleToolCall(name, args) {
5619
5635
  return ok(msg);
5620
5636
  }
5621
5637
 
5638
+ case 'clone_template': {
5639
+ const sourceId = args.source_template_id;
5640
+ if (!sourceId || !args.title) {
5641
+ return ok('Failed: source_template_id and title are required.');
5642
+ }
5643
+ const body = { title: args.title };
5644
+ if (args.slug) body.slug = args.slug;
5645
+ if (Array.isArray(args.conditions)) body.conditions = args.conditions;
5646
+ if (args.status) body.status = args.status;
5647
+ const r = await apiCall(`/templates/${sourceId}/clone`, 'POST', body);
5648
+ if (r.code || r.error) return ok(`Failed: ${r.message || r.error || 'Unknown error'}`);
5649
+ let msg = `Template cloned!\n`;
5650
+ msg += `Source: ID ${r.source_id}\n`;
5651
+ msg += `New template: ID ${r.new_id} ("${r.title}")\n`;
5652
+ msg += `Type: ${r.template_type || '(none — taxonomy missing on source)'}\n`;
5653
+ msg += `Sections copied: ${r.sections_copied} | Elements: ${r.elements_copied}\n`;
5654
+ if (r.conditions && r.conditions.length) {
5655
+ msg += `Conditions: ${r.conditions.join(', ')}\n`;
5656
+ } else {
5657
+ msg += `Conditions: (none — set via display_conditions if needed)\n`;
5658
+ }
5659
+ msg += `Edit URL: ${r.edit_url}`;
5660
+ return ok(msg);
5661
+ }
5662
+
5622
5663
  case 'append_section': {
5623
5664
  // Enforce root settings on appended sections
5624
5665
  if (args.section) addBoilerplate(args.section);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noleemits/vision-builder-control-mcp",
3
- "version": "4.37.0",
3
+ "version": "4.38.1",
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",