@diviops/mcp-server 1.5.26 → 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.
- package/README.md +5 -3
- package/dist/index.js +38 -3
- package/package.json +1 -1
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;
|
|
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
|
|
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
|
@@ -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`,
|
|
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 });
|