@diviops/mcp-server 1.5.25 → 1.5.27

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 (3) hide show
  1. package/README.md +24 -7
  2. package/dist/index.js +38 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **An AI harness for WordPress site authoring — Divi-native today, WordPress-wide by design.**
4
4
 
5
- The Node.js MCP server inside the DiviOps harness. It gives Claude Code, Claude Desktop, and other MCP clients a typed control layer over WordPress site state, dispatching to the DiviOps Agent plugin for Divi 5 page authoring, SCF and CPT data models, design tokens, presets, library and Theme Builder templates, site audits, and safe WP-CLI passthrough. Pairs with the `divi-5-builder` Claude skill so the agent applies Divi's block format and design rules correctly.
5
+ The Node.js MCP server inside the DiviOps harness. It gives Claude Code, Codex, Claude Desktop, and other MCP clients a typed control layer over WordPress site state, dispatching to the DiviOps Agent plugin for Divi 5 page authoring, SCF and CPT data models, design tokens, presets, library and Theme Builder templates, site audits, and safe WP-CLI passthrough. Pairs with the `divi-5-builder` skill so the agent applies Divi's block format and design rules correctly.
6
6
 
7
7
  ```
8
8
  Claude Code <-> MCP Server (stdio) <-> WordPress REST API <-> DiviOps Agent plugin
@@ -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**:
@@ -34,7 +36,9 @@ In **WP Admin → Users → Your Profile → Application Passwords**:
34
36
  - Click "Add New Application Password"
35
37
  - Copy the generated password and strip the spaces
36
38
 
37
- ### 3. Register the MCP server with Claude
39
+ ### 3. Register the MCP server
40
+
41
+ Claude Code:
38
42
 
39
43
  ```bash
40
44
  claude mcp add diviops-mcp \
@@ -44,9 +48,22 @@ claude mcp add diviops-mcp \
44
48
  -- npx -y --package @diviops/mcp-server diviops-mcp
45
49
  ```
46
50
 
47
- Then ask Claude: **"List the pages on my site."** Claude calls `diviops_page_list` and renders the result. You're authoring with the suite.
51
+ Codex `~/.codex/config.toml`:
52
+
53
+ ```toml
54
+ [mcp_servers.diviops-mcp]
55
+ command = "npx"
56
+ args = ["-y", "--package", "@diviops/mcp-server", "diviops-mcp"]
57
+
58
+ [mcp_servers.diviops-mcp.env]
59
+ WP_URL = "http://your-site.local"
60
+ WP_USER = "your-wp-username"
61
+ WP_APP_PASSWORD = "xxxxXXXXxxxxXXXXxxxxXXXX"
62
+ ```
63
+
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.
48
65
 
49
- 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.
50
67
 
51
68
  For a deeper walkthrough (containerized environments, WP-CLI configuration, troubleshooting installation), see [setup-guide.md](../docs/setup-guide.md).
52
69
 
@@ -87,7 +104,7 @@ Additional **conditionally-registered Pro tools** appear only on sites that have
87
104
  | FluentCart reads (V1) | Pro plugin + FluentCart installed + module enabled | `diviops_fc_product_list`, `diviops_fc_product_get` |
88
105
  | FluentCart simple product writes (V2) | Pro plugin + FluentCart installed + module enabled | `diviops_fc_product_create`, `diviops_fc_product_update`, `diviops_fc_product_delete` |
89
106
  | FluentCart variation read/write (V3) | Pro plugin + FluentCart installed + module enabled | `diviops_fc_variation_list`, `diviops_fc_variation_update` |
90
- | 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` |
91
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` |
92
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` |
93
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` |
@@ -221,7 +238,7 @@ The server connects via standard WordPress REST API and works with any environme
221
238
  Common quick fixes — full reference in [troubleshooting.md](../docs/troubleshooting.md).
222
239
 
223
240
  - **"Missing required environment variable(s)"** — ensure `WP_URL`, `WP_USER`, `WP_APP_PASSWORD` are all set on `claude mcp add`.
224
- - **`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.
225
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" …`.
226
243
  - **"This tool requires plugin capability"** — the plugin doesn't advertise the capability this tool needs. Update the plugin to the latest release.
227
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.
@@ -234,7 +251,7 @@ Common quick fixes — full reference in [troubleshooting.md](../docs/troublesho
234
251
  - [safety-patterns.md](../docs/safety-patterns.md) — Pattern A (refuse-with-override) + Pattern B (preview-then-commit) + universal `dry_run`
235
252
  - [troubleshooting.md](../docs/troubleshooting.md) — common errors and resolutions
236
253
  - [idempotency-audit.md](../docs/idempotency-audit.md) — repeat-call semantics per tool
237
- - **`divi-5-builder` Claude skill** — block format rules, design patterns, workflow guidance (ships in the dist repo)
254
+ - **`divi-5-builder` skill** — block format rules, design patterns, workflow guidance (ships in the dist repo)
238
255
 
239
256
  ## Requirements
240
257
 
package/dist/index.js CHANGED
@@ -3505,7 +3505,7 @@ function registerProTools() {
3505
3505
  }, { target: "fluentcart", capabilityKey: "fluentcart_variation_update" });
3506
3506
  // diviops_fc_license_settings_get — POST /diviops/v1/pro/fluentcart/products/{id}/license-settings
3507
3507
  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.",
3508
+ 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
3509
  inputSchema: {
3510
3510
  product_id: z
3511
3511
  .number()
@@ -3528,7 +3528,7 @@ function registerProTools() {
3528
3528
  }, { target: "fluentcart", capabilityKey: "fluentcart_license_settings_get" });
3529
3529
  // diviops_fc_license_settings_update — POST /diviops/v1/pro/fluentcart/products/{id}/license-settings/update
3530
3530
  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." +
3531
+ 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
3532
  DRY_RUN_DESC_SUFFIX,
3533
3533
  inputSchema: {
3534
3534
  product_id: z
@@ -3575,11 +3575,44 @@ function registerProTools() {
3575
3575
  }))
3576
3576
  .optional()
3577
3577
  .describe("Per-variation license configuration. Each entry's variation_id must belong to the product. Omitted variations preserve their existing license_settings."),
3578
+ global_update_file: z
3579
+ .number()
3580
+ .int()
3581
+ .positive()
3582
+ .nullable()
3583
+ .optional()
3584
+ .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
3585
  dry_run: DRY_RUN_FIELD,
3579
3586
  },
3580
3587
  annotations: { idempotentHint: false },
3581
3588
  _meta: { idempotent: "conditional" },
3582
- }, async ({ product_id, enabled, version, prefix, variations, dry_run, }) => {
3589
+ }, async ({ product_id, enabled, version, prefix, variations, global_update_file, dry_run, }) => {
3590
+ // Param-level capability gate (mirrors schema_get_module's dump_all
3591
+ // gate): the tool itself registers against older plugins via the V3
3592
+ // fluentcart_license_settings_update key, but those builds silently
3593
+ // ignore an undeclared global_update_file param — surface a typed
3594
+ // envelope error instead of a silent no-op.
3595
+ if (global_update_file !== undefined &&
3596
+ handshakeState.kind === "ok" &&
3597
+ !handshakeState.capabilities["fluentcart_license_update_file_set"]) {
3598
+ const err = new MissingCapabilityError("fluentcart_license_update_file_set", handshakeState.pluginVersion);
3599
+ const failure = {
3600
+ ok: false,
3601
+ error: {
3602
+ code: ErrorCodes.CAPABILITY_MISSING,
3603
+ message: err.message,
3604
+ 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.",
3605
+ },
3606
+ };
3607
+ return {
3608
+ content: [
3609
+ {
3610
+ type: "text",
3611
+ text: serializeEnvelope(failure, "diviops_fc_license_settings_update"),
3612
+ },
3613
+ ],
3614
+ };
3615
+ }
3583
3616
  const body = {};
3584
3617
  if (enabled !== undefined)
3585
3618
  body.enabled = enabled;
@@ -3589,6 +3622,8 @@ function registerProTools() {
3589
3622
  body.prefix = prefix;
3590
3623
  if (variations !== undefined)
3591
3624
  body.variations = variations;
3625
+ if (global_update_file !== undefined)
3626
+ body.global_update_file = global_update_file;
3592
3627
  if (dry_run !== undefined)
3593
3628
  body.dry_run = dry_run;
3594
3629
  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.25",
3
+ "version": "1.5.27",
4
4
  "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",