@diviops/mcp-server 0.2.6 → 0.2.7

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 CHANGED
@@ -141,7 +141,7 @@ The server connects via standard WordPress REST API and works with any environme
141
141
  | `diviops_save_to_library` | Save block markup to Divi Library |
142
142
  | `diviops_update_tb_layout` | Update a Theme Builder layout's block markup |
143
143
  | `diviops_create_tb_template` | Create Theme Builder template with header/footer and conditions |
144
- | `diviops_create_variable` | Create a design token variable |
144
+ | `diviops_create_variable` | Create a design token variable. For `type=numbers` fluid tokens, pass `min`+`max` shorthand (anchors default to 320px/1920px) or explicit `targets` like `{"320px":"20px","1920px":"60px"}` — server generates arithmetically-correct `clamp()` instead of hand-written math that silently under-reaches the stated max. Px inputs only in this MVP; rem inputs should be converted to px (1rem=16px) before calling |
145
145
  | `diviops_delete_variable` | Delete a variable by ID. Returns HTTP 409 when live references exist unless `force=true` (use `diviops_variables_scan_orphans` to find reference locations). Returns HTTP 403 for Divi's customizer-bound defaults (`gcid-primary-color`, `gcid-secondary-color`, `gcid-heading-color`, `gcid-body-color`, `gcid-link-color` — managed via WP Customizer) |
146
146
  | `diviops_create_canvas` | Create a canvas page |
147
147
  | `diviops_update_canvas` | Update canvas content |
@@ -2,7 +2,7 @@
2
2
  * Version compatibility between MCP server and WP plugin.
3
3
  */
4
4
  /** Minimum WP plugin version this server requires. */
5
- export declare const MIN_PLUGIN_VERSION = "1.0.0-beta.22";
5
+ export declare const MIN_PLUGIN_VERSION = "1.0.0-beta.28";
6
6
  /**
7
7
  * Compare two semver-like version strings (supports pre-release tags).
8
8
  *
@@ -2,7 +2,7 @@
2
2
  * Version compatibility between MCP server and WP plugin.
3
3
  */
4
4
  /** Minimum WP plugin version this server requires. */
5
- export const MIN_PLUGIN_VERSION = '1.0.0-beta.22';
5
+ export const MIN_PLUGIN_VERSION = '1.0.0-beta.28';
6
6
  /**
7
7
  * Compare two semver-like version strings (supports pre-release tags).
8
8
  *
package/dist/index.js CHANGED
@@ -1285,7 +1285,7 @@ server.registerTool("diviops_list_variables", {
1285
1285
  };
1286
1286
  });
1287
1287
  server.registerTool("diviops_create_variable", {
1288
- description: 'Create a design token variable in the Divi Variable Manager. Colors (type "colors") use gcid-* IDs and hex values. Numbers/strings/etc use gvid-* IDs.',
1288
+ description: 'Create a design token variable in the Divi Variable Manager. Colors (type "colors") use gcid-* IDs and hex values. Numbers/strings/etc use gvid-* IDs. For type="numbers" fluid tokens, pass min+max shorthand (anchors default to 320px/1920px) or explicit targets — server generates arithmetically-correct clamp() formulas. Px inputs only in this MVP; rem inputs must be converted to px (1rem=16px) before calling. Mutually exclusive with value.',
1289
1289
  inputSchema: {
1290
1290
  type: z
1291
1291
  .enum(["colors", "numbers", "strings", "images", "links", "fonts"])
@@ -1299,12 +1299,36 @@ server.registerTool("diviops_create_variable", {
1299
1299
  .describe("Human-readable label shown in the VB Variable Manager"),
1300
1300
  value: z
1301
1301
  .string()
1302
- .describe('Variable value: hex color for colors (e.g. "#3a7a6a"), CSS value for numbers (e.g. "clamp(30px, 8vw, 100px)")'),
1302
+ .optional()
1303
+ .describe('Variable value (required unless using fluid min/max/targets for type=numbers): hex color for colors (e.g. "#3a7a6a"), CSS value for numbers (e.g. "clamp(30px, 8vw, 100px)" or "2rem")'),
1304
+ min: z
1305
+ .string()
1306
+ .optional()
1307
+ .describe('Fluid minimum value in px (e.g. "20px"). Paired with max. Anchors default to 320px/1920px. type="numbers" only. Rem not supported — convert to px (1rem=16px) before calling.'),
1308
+ max: z
1309
+ .string()
1310
+ .optional()
1311
+ .describe('Fluid maximum value in px (e.g. "60px"). Paired with min.'),
1312
+ targets: z
1313
+ .record(z.string(), z.string())
1314
+ .refine((m) => !m || Object.keys(m).length === 2, {
1315
+ message: "targets must contain exactly 2 viewport entries",
1316
+ })
1317
+ .optional()
1318
+ .describe('Explicit two-anchor fluid spec, px only. Example: {"320px":"20px","1920px":"60px"} → clamp(20px, 12px + 2.5vw, 60px). Exactly 2 entries required. type="numbers" only. Mutually exclusive with min/max.'),
1303
1319
  },
1304
- }, async ({ type, id, label, value }) => {
1305
- const body = { type, label, value };
1320
+ }, async ({ type, id, label, value, min, max, targets }) => {
1321
+ const body = { type, label };
1322
+ if (value !== undefined)
1323
+ body.value = value;
1306
1324
  if (id)
1307
1325
  body.id = id;
1326
+ if (min !== undefined)
1327
+ body.min = min;
1328
+ if (max !== undefined)
1329
+ body.max = max;
1330
+ if (targets !== undefined)
1331
+ body.targets = targets;
1308
1332
  const result = await wp.request("/variable/create", {
1309
1333
  method: "POST",
1310
1334
  body,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diviops/mcp-server",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",