@noleemits/vision-builder-control-mcp 4.32.1 → 4.34.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 +106 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -2,7 +2,9 @@
2
2
  /**
3
3
  * Noleemits Vision Builder Control MCP Server
4
4
  *
5
- * Provides 65 tools for building and managing WordPress/Elementor sites.
5
+ * Provides 67 tools for building and managing WordPress/Elementor sites.
6
+ * v4.34.0: Design tokens auto-inject as CSS custom properties (--nvbc-color-*, --nvbc-fs-*, --nvbc-space-*) site-wide via wp_head; kit global CSS tools (get_kit_global_css, set_kit_global_css); get_kit_settings formatter handles gap-style objects.
7
+ * v4.33.0: Elementor kit layout settings (get_kit_settings, set_kit_settings) — read/write container_width, viewports, gutter.
6
8
  * v4.15.0: Injection engine v2 — icon-list injection, unfilled slot clearing.
7
9
  * v4.14.0: Pipeline quality fixes — smart counter parsing, post-processing, quality scores in browse, injection completeness.
8
10
  * v4.13.0: Phase 3 DX — display_conditions, null filter fix, garbage HTML cleanup, icon key docs, auto-inject convenience docs.
@@ -104,7 +106,7 @@ process.on('SIGINT', () => {
104
106
  // CONFIG
105
107
  // ================================================================
106
108
 
107
- const VERSION = '4.32.0';
109
+ const VERSION = '4.34.0';
108
110
  const MIN_PLUGIN_VERSION = '4.13.0'; // Minimum WP plugin version required by this MCP server
109
111
 
110
112
  // ================================================================
@@ -3050,6 +3052,41 @@ function getToolDefinitions() {
3050
3052
  }
3051
3053
  }
3052
3054
  },
3055
+ {
3056
+ name: 'get_kit_settings',
3057
+ description: 'Read Elementor kit layout settings (container_width, viewport_md, viewport_lg, space_between_widgets, etc.) from the active kit. Slider values come back as {unit, size, sizes} objects.',
3058
+ inputSchema: { type: 'object', properties: {} }
3059
+ },
3060
+ {
3061
+ name: 'set_kit_settings',
3062
+ description: 'Update Elementor kit layout settings on the active kit. Pass a settings object with any whitelisted keys: container_width (px), container_width_tablet, container_width_mobile, space_between_widgets, viewport_md, viewport_lg, viewport_mobile, viewport_tablet. Slider values accept either a plain number (treated as px) or {size, unit, sizes?}. Clears Elementor CSS cache after applying. Always dry_run=true first.',
3063
+ inputSchema: {
3064
+ type: 'object',
3065
+ properties: {
3066
+ settings: { type: 'object', description: 'Map of kit setting keys to values. Numbers auto-wrap into {unit:"px", size:N} for slider keys. Example: {"container_width": 1280}' },
3067
+ dry_run: { type: 'boolean', description: 'Preview without saving (default: true).' }
3068
+ },
3069
+ required: ['settings']
3070
+ }
3071
+ },
3072
+ {
3073
+ name: 'get_kit_global_css',
3074
+ description: 'Read the active kit\'s custom_css (Elementor "Custom CSS" field). This CSS is output site-wide via Elementor\'s own stylesheet pipeline. Use to inspect site-wide CSS variables, base styles, etc.',
3075
+ inputSchema: { type: 'object', properties: {} }
3076
+ },
3077
+ {
3078
+ name: 'set_kit_global_css',
3079
+ description: 'Write to the active kit\'s custom_css. Modes: "replace" (default — overwrites), "append" (adds to end), "prepend" (adds to start). Output goes through Elementor\'s stylesheet pipeline (no HTML widget needed). Always dry_run=true first.',
3080
+ inputSchema: {
3081
+ type: 'object',
3082
+ properties: {
3083
+ css: { type: 'string', description: 'CSS text. Will be wrapped in <style> by Elementor — do not include style tags.' },
3084
+ mode: { type: 'string', enum: ['replace', 'append', 'prepend'], description: 'How to combine with existing CSS (default: replace).' },
3085
+ dry_run: { type: 'boolean', description: 'Preview without saving (default: true).' }
3086
+ },
3087
+ required: ['css']
3088
+ }
3089
+ },
3053
3090
  {
3054
3091
  name: 'audit_broken_images',
3055
3092
  description: 'Scan all published posts and Elementor pages for broken images (non-200 HTTP responses). Checks <img> tags in post_content and image/image-box widgets + background images in Elementor data. Returns broken URLs with HTTP status, error details, and which posts are affected.',
@@ -5178,6 +5215,73 @@ async function handleToolCall(name, args) {
5178
5215
  return ok(out);
5179
5216
  }
5180
5217
 
5218
+ case 'get_kit_settings': {
5219
+ const r = await apiCall('/kit-settings');
5220
+ if (r.code || r.error) return ok(`Failed: ${r.message || r.error}`);
5221
+ let out = `=== ELEMENTOR KIT SETTINGS ===\nKit ID: ${r.kit_id}\n\n`;
5222
+ for (const [k, v] of Object.entries(r.settings || {})) {
5223
+ if (v === null || v === '') { out += ` ${k}: (unset)\n`; continue; }
5224
+ if (typeof v === 'object') {
5225
+ const unit = v.unit || 'px';
5226
+ if ('size' in v && v.size !== '' && v.size !== null) {
5227
+ out += ` ${k}: ${v.size}${unit}\n`;
5228
+ } else if ('column' in v || 'row' in v) {
5229
+ const col = v.column ?? '';
5230
+ const row = v.row ?? '';
5231
+ out += ` ${k}: column=${col}${unit}, row=${row}${unit}\n`;
5232
+ } else {
5233
+ out += ` ${k}: ${JSON.stringify(v)}\n`;
5234
+ }
5235
+ } else {
5236
+ out += ` ${k}: ${v}\n`;
5237
+ }
5238
+ }
5239
+ return ok(out);
5240
+ }
5241
+
5242
+ case 'set_kit_settings': {
5243
+ const body = { settings: args.settings || {} };
5244
+ if (args.dry_run !== undefined) body.dry_run = args.dry_run;
5245
+ const r = await apiCall('/kit-settings', 'POST', body);
5246
+ if (r.code || r.error) return ok(`Failed: ${r.message || r.error}`);
5247
+ let out = r.dry_run ? `=== SET KIT SETTINGS (DRY RUN) ===\n` : `=== SET KIT SETTINGS ===\n`;
5248
+ out += `Kit ID: ${r.kit_id}\n`;
5249
+ if (r.changes?.length) {
5250
+ r.changes.forEach(c => { out += ` • ${c}\n`; });
5251
+ } else {
5252
+ out += ' No changes detected.\n';
5253
+ }
5254
+ if (r.rejected && Object.keys(r.rejected).length) {
5255
+ out += `\nRejected:\n`;
5256
+ for (const [k, why] of Object.entries(r.rejected)) {
5257
+ out += ` ✗ ${k}: ${why}\n`;
5258
+ }
5259
+ }
5260
+ out += `\n${r.note}`;
5261
+ return ok(out);
5262
+ }
5263
+
5264
+ case 'get_kit_global_css': {
5265
+ const r = await apiCall('/kit-global-css');
5266
+ if (r.code || r.error) return ok(`Failed: ${r.message || r.error}`);
5267
+ let out = `=== KIT GLOBAL CSS ===\nKit ID: ${r.kit_id}\nLength: ${r.length} bytes\n\n`;
5268
+ out += r.css || '(empty)';
5269
+ return ok(out);
5270
+ }
5271
+
5272
+ case 'set_kit_global_css': {
5273
+ const body = { css: args.css ?? '' };
5274
+ if (args.mode !== undefined) body.mode = args.mode;
5275
+ if (args.dry_run !== undefined) body.dry_run = args.dry_run;
5276
+ const r = await apiCall('/kit-global-css', 'POST', body);
5277
+ if (r.code || r.error) return ok(`Failed: ${r.message || r.error}`);
5278
+ let out = r.dry_run ? `=== SET KIT GLOBAL CSS (DRY RUN) ===\n` : `=== SET KIT GLOBAL CSS ===\n`;
5279
+ out += `Kit ID: ${r.kit_id}\n`;
5280
+ out += `Mode: ${r.mode}\n`;
5281
+ out += `${r.summary}\n\n${r.note}`;
5282
+ return ok(out);
5283
+ }
5284
+
5181
5285
  case 'audit_broken_images': {
5182
5286
  const params = new URLSearchParams();
5183
5287
  if (args.page_id) params.set('page_id', args.page_id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noleemits/vision-builder-control-mcp",
3
- "version": "4.32.1",
3
+ "version": "4.34.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",