@diviops/mcp-server 1.5.26 → 1.5.28

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
@@ -27,6 +27,8 @@ Three steps to your first tool call.
27
27
 
28
28
  Download and activate the **DiviOps Agent** plugin — [direct zip](https://github.com/oaris-dev/diviops/raw/main/diviops-agent.zip) or browse the [public distribution repo](https://github.com/oaris-dev/diviops). Requires Divi 5.1+ on WordPress 6.5+.
29
29
 
30
+ During beta, Free WordPress plugin updates are manual: download the latest `diviops-agent.zip` from the [Free GitHub release](https://github.com/oaris-dev/diviops/releases/latest), upload it via **WP Admin → Plugins → Add New → Upload Plugin**, and choose **Replace current with uploaded**. Native WordPress.org update notices are planned but not live yet.
31
+
30
32
  ### 2. Create an Application Password
31
33
 
32
34
  In **WP Admin → Users → Your Profile → Application Passwords**:
@@ -61,7 +63,7 @@ WP_APP_PASSWORD = "xxxxXXXXxxxxXXXXxxxxXXXX"
61
63
 
62
64
  Then ask your AI client: **"List the pages on my site."** It calls `diviops_page_list` and renders the result. You're authoring with the suite.
63
65
 
64
- For Claude Desktop JSON, use `"command": "npx"` with args `["-y", "--package", "@diviops/mcp-server", "diviops-mcp"]`. The package also ships `diviops-preset`, so the explicit package/bin form is required; `npx @diviops/mcp-server` cannot reliably infer which bin to run.
66
+ For Claude Desktop JSON, use `"command": "npx"` with args `["-y", "--package", "@diviops/mcp-server", "diviops-mcp"]`. The package also ships `diviops-preset`, so the explicit package/bin form is required; shorthand package invocation cannot reliably infer which bin to run.
65
67
 
66
68
  For a deeper walkthrough (containerized environments, WP-CLI configuration, troubleshooting installation), see [setup-guide.md](../docs/setup-guide.md).
67
69
 
@@ -102,7 +104,7 @@ Additional **conditionally-registered Pro tools** appear only on sites that have
102
104
  | FluentCart reads (V1) | Pro plugin + FluentCart installed + module enabled | `diviops_fc_product_list`, `diviops_fc_product_get` |
103
105
  | FluentCart simple product writes (V2) | Pro plugin + FluentCart installed + module enabled | `diviops_fc_product_create`, `diviops_fc_product_update`, `diviops_fc_product_delete` |
104
106
  | FluentCart variation read/write (V3) | Pro plugin + FluentCart installed + module enabled | `diviops_fc_variation_list`, `diviops_fc_variation_update` |
105
- | FluentCart license-settings read/write (V3) | Pro plugin + FluentCart Pro installed + module enabled | `diviops_fc_license_settings_get`, `diviops_fc_license_settings_update` |
107
+ | FluentCart license-settings read/write, incl. update-file pointer + readiness (V3/V3.3) | Pro plugin + FluentCart Pro installed + module enabled | `diviops_fc_license_settings_get`, `diviops_fc_license_settings_update` |
106
108
  | FluentCart order readback + guarded mark-paid (V3.1) | Pro plugin + FluentCart installed + module enabled | `diviops_fc_order_list`, `diviops_fc_order_get`, `diviops_fc_order_mark_paid` |
107
109
  | FluentCart license readback (V3.1) | Pro plugin + FluentCart Pro installed + module enabled | `diviops_fc_license_list`, `diviops_fc_license_get`, `diviops_fc_license_activations_list` |
108
110
  | FluentCart checkout readiness / gateway inspection (V3.2) | Pro plugin + FluentCart installed + module enabled | `diviops_fc_status`, `diviops_fc_gateway_list`, `diviops_fc_gateway_get` |
@@ -236,7 +238,7 @@ The server connects via standard WordPress REST API and works with any environme
236
238
  Common quick fixes — full reference in [troubleshooting.md](../docs/troubleshooting.md).
237
239
 
238
240
  - **"Missing required environment variable(s)"** — ensure `WP_URL`, `WP_USER`, `WP_APP_PASSWORD` are all set on `claude mcp add`.
239
- - **`npx @diviops/mcp-server` fails with "could not determine executable to run"** — use `npx -y --package @diviops/mcp-server diviops-mcp`; this explicitly selects the MCP server bin.
241
+ - **`npx` fails with "could not determine executable to run"** — use `npx -y --package @diviops/mcp-server diviops-mcp`; this explicitly selects the MCP server bin.
240
242
  - **"Connection failed"** — verify the plugin is active by visiting `{WP_URL}/wp-json/diviops/v1/schema/settings`; test the credentials with `curl -u "user:pass" …`.
241
243
  - **"This tool requires plugin capability"** — the plugin doesn't advertise the capability this tool needs. Update the plugin to the latest release.
242
244
  - **Preset edits not visible on the frontend** — Divi serves frontend CSS from `wp-content/et-cache/{post_id}/`, which `wp cache flush` doesn't touch. Use `diviops_meta_flush_cache` after preset writes.
package/dist/index.js CHANGED
@@ -2722,7 +2722,7 @@ registerPluginTool("diviops_variable_list", {
2722
2722
  description: "List all design token variables from the Divi Variable Manager. Colors (gcid-*) come from et_global_data, numbers/strings/etc (gvid-*) from et_divi_global_variables. Filter by type or ID prefix. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; invalid `type` returns ok:false with code 'invalid_input'.",
2723
2723
  inputSchema: {
2724
2724
  type: z
2725
- .enum(["colors", "numbers", "strings", "images", "links", "fonts"])
2725
+ .enum(["colors", "numbers", "strings", "images", "links", "fonts", "gradients"])
2726
2726
  .optional()
2727
2727
  .describe("Filter by variable type"),
2728
2728
  prefix: z
@@ -2750,7 +2750,7 @@ registerPluginTool("diviops_variable_create", {
2750
2750
  DRY_RUN_DESC_SUFFIX,
2751
2751
  inputSchema: {
2752
2752
  type: z
2753
- .enum(["colors", "numbers", "strings", "images", "links", "fonts"])
2753
+ .enum(["colors", "numbers", "strings", "images", "links", "fonts", "gradients"])
2754
2754
  .describe("Variable type"),
2755
2755
  id: z
2756
2756
  .string()
@@ -2762,7 +2762,25 @@ registerPluginTool("diviops_variable_create", {
2762
2762
  value: z
2763
2763
  .string()
2764
2764
  .optional()
2765
- .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")'),
2765
+ .describe('Variable value (required unless using fluid min/max/targets for type=numbers, OR the structured `gradient` object for type=gradients): hex color for colors (e.g. "#3a7a6a"), CSS value for numbers (e.g. "clamp(30px, 8vw, 100px)" or "2rem"), arbitrary text/URL for strings/links/images. For type=gradients do NOT pass a CSS gradient string here — it stores an unrenderable variable; use the `gradient` object instead (or pass a full $variable({"type":"gradient",…})$ token verbatim).'),
2766
+ gradient: z
2767
+ .object({
2768
+ stops: z
2769
+ .array(z.object({ position: z.union([z.string(), z.number()]), color: z.string() }))
2770
+ .min(2)
2771
+ .describe('Gradient color stops, min 2. position = unitless number 0–100 (string or number; PHP normalizes to string); color = hex or a $variable(gcid-…)$ token.'),
2772
+ type: z
2773
+ .enum(["linear", "circular", "elliptical", "conic"])
2774
+ .optional()
2775
+ .describe('Gradient type (default linear). circular/elliptical render as radial-gradient(circle|ellipse …); conic as conic-gradient. NOTE: the enum is circular/elliptical, NOT "radial".'),
2776
+ direction: z.string().optional().describe('CSS angle for linear/conic (default "180deg"), e.g. "90deg".'),
2777
+ directionRadial: z.string().optional().describe('Position keyword for circular/elliptical/conic (default "center"), e.g. "top left".'),
2778
+ length: z.string().optional().describe('Gradient length (default "100%").'),
2779
+ repeat: z.enum(["on", "off"]).optional().describe('Repeat the gradient (default "off").'),
2780
+ overlaysImage: z.enum(["on", "off"]).optional().describe('Place gradient above a background image (default "off").'),
2781
+ })
2782
+ .optional()
2783
+ .describe('Structured gradient settings for type="gradients" (5.7.4). The server serializes the canonical $variable({"type":"gradient",value:{name:"gradient",settings:{…}}})$ token that Divi resolves to a defined --gvid-* custom property. REQUIRED for a renderable gradient variable — a raw CSS-string `value` is rejected. Ignored for non-gradient types.'),
2766
2784
  min: z
2767
2785
  .string()
2768
2786
  .optional()
@@ -2791,10 +2809,18 @@ registerPluginTool("diviops_variable_create", {
2791
2809
  },
2792
2810
  annotations: { idempotentHint: false },
2793
2811
  _meta: { idempotent: "false" },
2794
- }, async ({ type, id, label, value, min, max, targets, output_unit, root_font_size_px, dry_run, }) => {
2812
+ }, async ({ type, id, label, value, gradient, min, max, targets, output_unit, root_font_size_px, dry_run, }) => {
2813
+ // Structured gradient serialization is a plugin-side capability (#921).
2814
+ // Gate it so a new server + old plugin fails with a clear "update plugin"
2815
+ // error instead of the confusing "value must be scalar" the old callback
2816
+ // would emit for a gradient-without-value request.
2817
+ if (gradient !== undefined)
2818
+ requireCapability("variable_create_gradient");
2795
2819
  const body = { type, label };
2796
2820
  if (value !== undefined)
2797
2821
  body.value = value;
2822
+ if (gradient !== undefined)
2823
+ body.gradient = gradient;
2798
2824
  if (id)
2799
2825
  body.id = id;
2800
2826
  if (min !== undefined)
@@ -3505,7 +3531,7 @@ function registerProTools() {
3505
3531
  }, { target: "fluentcart", capabilityKey: "fluentcart_variation_update" });
3506
3532
  // diviops_fc_license_settings_get — POST /diviops/v1/pro/fluentcart/products/{id}/license-settings
3507
3533
  registerProTool("diviops_fc_license_settings_get", {
3508
- description: "Read the per-product FluentCart Pro license-settings projection (Pro tier; V3; requires FluentCart Pro installed + activated). FluentCart Pro stores license settings in `ProductMeta` under meta_key='license_settings'; this tool reads that meta row and joins it against the product's variations so each variation surfaces with its current activation_limit + validity. Read-only. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; success payload is { product_id, enabled: boolean, version, prefix, variations: [ { variation_id, title, activation_limit, validity: { unit, value } | null } ] }. Storage semantics: `enabled` is stored as 'yes'/'no' in FCP and projected to boolean here. `activation_limit` is null/'' (unconfigured), 0 (unlimited per FluentCart Pro License::getActivationLimit), or a positive integer. `validity.unit` is one of lifetime/day/week/month/year. Variations the product has but license_settings doesn't mention surface with `activation_limit: null` and `validity: null`. Variations license_settings mentions that no longer exist on the product are filtered out — only the live variation set is returned. Error codes: invalid_input (400) when id is not a positive integer; not_found (404) when the product does not exist; fluentcart.module_inactive (412); fluentcart.query_failed (500). Idempotency: read-only.",
3534
+ description: "Read the per-product FluentCart Pro license-settings projection (Pro tier; V3/V3.3; requires FluentCart Pro installed + activated). FluentCart Pro stores license settings in `ProductMeta` under meta_key='license_settings'; this tool reads that meta row and joins it against the product's variations so each variation surfaces with its current activation_limit + validity. Read-only. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; success payload is { product_id, enabled: boolean, version, prefix, variations: [ { variation_id, title, activation_limit, validity: { unit, value } | null } ], update_file: { configured_id: string|null, resolved: DownloadRow|null }, downloads: DownloadRow[], update_file_readiness: { applicable: boolean, ready: boolean|null, problems: [ { code, message } ] } }. DownloadRow is { id, title, file_name, driver, file_size, type } — metadata only, never file paths or signed URLs. `update_file.configured_id` is the raw `global_update_file` pointer (the download-row ID FluentCart Pro's licensed-update path resolves); `resolved` is the matching download row or null. `update_file_readiness` is the updater-pointer verdict: applicable only when licensing is enabled (ready: null otherwise); problem codes are downloads_missing (no download rows at all), update_file_pointer_missing (downloads exist but no pointer persisted — fails even for single-download products because FCP Pro's signed-package-URL path resolves the pointer with no fallback), update_file_pointer_unresolved (pointer matches no download row on the product). The verdict does NOT judge whether the resolved file is the intended updater package — check resolved.file_name/title yourself (e.g. a plugin update ZIP vs a bundle/suite ZIP). The update_file/downloads/update_file_readiness fields require plugin capability `fluentcart_license_update_file_get`; older plugin builds omit them. Storage semantics: `enabled` is stored as 'yes'/'no' in FCP and projected to boolean here. `activation_limit` is null/'' (unconfigured), 0 (unlimited per FluentCart Pro License::getActivationLimit), or a positive integer. `validity.unit` is one of lifetime/day/week/month/year. Variations the product has but license_settings doesn't mention surface with `activation_limit: null` and `validity: null`. Variations license_settings mentions that no longer exist on the product are filtered out — only the live variation set is returned. Error codes: invalid_input (400) when id is not a positive integer; not_found (404) when the product does not exist; fluentcart.module_inactive (412); fluentcart.query_failed (500). Idempotency: read-only.",
3509
3535
  inputSchema: {
3510
3536
  product_id: z
3511
3537
  .number()
@@ -3528,7 +3554,7 @@ function registerProTools() {
3528
3554
  }, { target: "fluentcart", capabilityKey: "fluentcart_license_settings_get" });
3529
3555
  // diviops_fc_license_settings_update — POST /diviops/v1/pro/fluentcart/products/{id}/license-settings/update
3530
3556
  registerProTool("diviops_fc_license_settings_update", {
3531
- description: "Write the per-product FluentCart Pro license-settings ProductMeta row (Pro tier; V3; requires FluentCart Pro installed + activated). Authors `enabled`, `version`, `prefix`, and per-variation `activation_limit` + `validity` — the storage shape FluentCart Pro reads via LicenseGenerationHandler when an order is placed. V3 explicitly skips configuring update-ZIP `global_update_file`, `wp` readme/banner/icon, downloadables, and the license-activation API; those fields are preserved when present but not authored. Refuses bundle products with `fluentcart.unsupported_product_shape` (HTTP 422). Inputs (all optional except product_id; partial updates supported): `enabled` (boolean — projected to FCP's 'yes'/'no' on write), `version` (required when enabling; max 50 chars), `prefix` (max 20 chars), `variations` (array of { variation_id (required), activation_limit (integer ≥ 0 or null; 0 = unlimited per FluentCart Pro License::getActivationLimit), validity (optional { unit: lifetime/day/week/month/year, value: positive integer } or null to auto-derive) }). When `validity` is omitted on a variation, the validity is derived from the variation's payment_type: subscription+yearly → { unit: 'year', value: 1 }; onetime → { unit: 'lifetime', value: 1 }. When `enabled: true` and the product carries variations, every variation must end up with a non-empty validity.unit. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; apply-mode success payload is { product_id, changed_fields[], license_settings: <same shape as diviops_fc_license_settings_get> } (or { noop: true, product_id, license_settings } on no-op). Error codes: invalid_input (400) when any field violates the constraints (unknown variation_id, negative activation_limit, missing version when enabling, missing validity.unit when enabling, bad enum value); not_found (404) when the product does not exist; fluentcart.unsupported_product_shape (422) on bundle products; fluentcart.module_inactive (412); fluentcart.command_failed (500). Idempotency: conditional — identical repeat is a no-op." +
3557
+ description: "Write the per-product FluentCart Pro license-settings ProductMeta row (Pro tier; V3/V3.3; requires FluentCart Pro installed + activated). Authors `enabled`, `version`, `prefix`, per-variation `activation_limit` + `validity`, and (V3.3) the `global_update_file` updater pointer — the storage shape FluentCart Pro reads via LicenseGenerationHandler when an order is placed and via the licensed-update path when an installed plugin checks for updates. Still out of scope: `wp` readme/banner/icon config, download-asset CRUD/upload, and the license-activation API; the `wp` field is preserved when present but not authored. Refuses bundle products with `fluentcart.unsupported_product_shape` (HTTP 422). Inputs (all optional except product_id; partial updates supported): `enabled` (boolean — projected to FCP's 'yes'/'no' on write), `version` (required when enabling; max 50 chars), `prefix` (max 20 chars), `variations` (array of { variation_id (required), activation_limit (integer ≥ 0 or null; 0 = unlimited per FluentCart Pro License::getActivationLimit), validity (optional { unit: lifetime/day/week/month/year, value: positive integer } or null to auto-derive) }), `global_update_file` (positive integer download-row ID to point licensed updates at, or null to clear the pointer; the ID must match one of the product's download rows — read diviops_fc_license_settings_get's `downloads` array for valid IDs — and is rejected with invalid_input otherwise, never silently coerced; stored as a string to match FluentCart Pro's UI-authored shape; requires plugin capability `fluentcart_license_update_file_set`, otherwise this tool returns capability_missing without calling the plugin). Omitting `global_update_file` preserves the stored pointer — unlike FluentCart Pro's own UI save path, partial updates here never wipe it. When `validity` is omitted on a variation, the validity is derived from the variation's payment_type: subscription+yearly → { unit: 'year', value: 1 }; onetime → { unit: 'lifetime', value: 1 }. When `enabled: true` and the product carries variations, every variation must end up with a non-empty validity.unit. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; apply-mode success payload is { product_id, changed_fields[], license_settings: <same shape as diviops_fc_license_settings_get> } (or { noop: true, product_id, license_settings } on no-op). Error codes: invalid_input (400) when any field violates the constraints (unknown variation_id, negative activation_limit, missing version when enabling, missing validity.unit when enabling, bad enum value, global_update_file not matching a download row); not_found (404) when the product does not exist; fluentcart.unsupported_product_shape (422) on bundle products; fluentcart.module_inactive (412); fluentcart.command_failed (500); capability_missing when global_update_file is passed against a plugin build without the capability. Idempotency: conditional — identical repeat is a no-op." +
3532
3558
  DRY_RUN_DESC_SUFFIX,
3533
3559
  inputSchema: {
3534
3560
  product_id: z
@@ -3575,11 +3601,44 @@ function registerProTools() {
3575
3601
  }))
3576
3602
  .optional()
3577
3603
  .describe("Per-variation license configuration. Each entry's variation_id must belong to the product. Omitted variations preserve their existing license_settings."),
3604
+ global_update_file: z
3605
+ .number()
3606
+ .int()
3607
+ .positive()
3608
+ .nullable()
3609
+ .optional()
3610
+ .describe("Download-row ID to point licensed updates at (must match one of the product's download rows — see diviops_fc_license_settings_get's downloads array), or null to clear the pointer. Omit to preserve the stored pointer."),
3578
3611
  dry_run: DRY_RUN_FIELD,
3579
3612
  },
3580
3613
  annotations: { idempotentHint: false },
3581
3614
  _meta: { idempotent: "conditional" },
3582
- }, async ({ product_id, enabled, version, prefix, variations, dry_run, }) => {
3615
+ }, async ({ product_id, enabled, version, prefix, variations, global_update_file, dry_run, }) => {
3616
+ // Param-level capability gate (mirrors schema_get_module's dump_all
3617
+ // gate): the tool itself registers against older plugins via the V3
3618
+ // fluentcart_license_settings_update key, but those builds silently
3619
+ // ignore an undeclared global_update_file param — surface a typed
3620
+ // envelope error instead of a silent no-op.
3621
+ if (global_update_file !== undefined &&
3622
+ handshakeState.kind === "ok" &&
3623
+ !handshakeState.capabilities["fluentcart_license_update_file_set"]) {
3624
+ const err = new MissingCapabilityError("fluentcart_license_update_file_set", handshakeState.pluginVersion);
3625
+ const failure = {
3626
+ ok: false,
3627
+ error: {
3628
+ code: ErrorCodes.CAPABILITY_MISSING,
3629
+ message: err.message,
3630
+ hint: "Update the diviops-agent-pro WP plugin to a version that supports authoring the global_update_file pointer, or omit global_update_file from this call.",
3631
+ },
3632
+ };
3633
+ return {
3634
+ content: [
3635
+ {
3636
+ type: "text",
3637
+ text: serializeEnvelope(failure, "diviops_fc_license_settings_update"),
3638
+ },
3639
+ ],
3640
+ };
3641
+ }
3583
3642
  const body = {};
3584
3643
  if (enabled !== undefined)
3585
3644
  body.enabled = enabled;
@@ -3589,6 +3648,8 @@ function registerProTools() {
3589
3648
  body.prefix = prefix;
3590
3649
  if (variations !== undefined)
3591
3650
  body.variations = variations;
3651
+ if (global_update_file !== undefined)
3652
+ body.global_update_file = global_update_file;
3592
3653
  if (dry_run !== undefined)
3593
3654
  body.dry_run = dry_run;
3594
3655
  const result = await wp.requestEnveloped(`/pro/fluentcart/products/${product_id}/license-settings/update`, { method: "POST", body });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diviops/mcp-server",
3
- "version": "1.5.26",
3
+ "version": "1.5.28",
4
4
  "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",