@diviops/mcp-server 1.5.68 → 1.5.69

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 +32 -7
  2. package/dist/index.js +14 -10
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -495,7 +495,7 @@ The server exposes **100 always-on tools** across the categories below. Each cat
495
495
  | Library + templates | Reusable layouts + Theme Builder | `library_*`, `template_*`, `tb_*` |
496
496
  | Native Custom CSS | Read, preview, update and restore named site-wide CSS blocks | `custom_css_*` |
497
497
  | WordPress menus | Author reusable nav menus and theme-location assignments | `menu_*` |
498
- | Semantic SEO metadata | Inspect provider support and author two explicit TSF text fields with checksum/readback guards | `seo_*` |
498
+ | Semantic SEO metadata | Inspect provider support; TSF title/description and Rank Math canonical/noindex with checksum/readback guards | `seo_*` |
499
499
  | Schema introspection | Module attribute discovery | `schema_*` |
500
500
  | Canvas / off-canvas | Popups, modals, menus | `canvas_*` |
501
501
  | SCF integration | Secure Custom Fields sync | `scf_*` |
@@ -794,12 +794,37 @@ permission, refuses content or supported Divi post-meta drift before mutation,
794
794
  uses the same full-content integrity/readback guard, and has no force override
795
795
  or second pre-restore snapshot in this MVP.
796
796
 
797
- `diviops_seo_metadata_update` is a separate explicit-metadata-only path. It
798
- accepts no raw provider keys, requires the checksum from
799
- `diviops_seo_metadata_get`, validates plain text before TSF sanitization,
800
- verifies exact stored readback, and performs request-local restoration on a
801
- mismatch. It does not create a persistent rollback snapshot; effective
802
- provider output is verified through a follow-up get request.
797
+ `diviops_seo_metadata_update` accepts fixed semantic fields and requires the
798
+ checksum from `diviops_seo_metadata_get`. TSF retains its title/description
799
+ set/clear contract and request-local rollback. The Rank Math
800
+ 1.0.279 adapter adds `canonical_url` set/clear and `noindex` set with the string
801
+ value `noindex`, on pages only. It requires per-page edit permission and Rank
802
+ Math general/advanced metadata capabilities. Other robots writes are refused.
803
+
804
+ Preview with `dry_run:true`. Rank Math noindex preserves other directives;
805
+ when those directives were inherited, the preview explains that the local
806
+ robots array will pin them. A computed canonical is not proof of an emitted
807
+ tag: Rank Math suppresses canonical output under noindex. Frontend filters and
808
+ query context require separate verification.
809
+
810
+ Every non-noop Rank Math apply saves a private typed recovery record and returns
811
+ `snapshot_id`. To preview or apply restoration, call the same update tool with
812
+ `restore_snapshot_id`, a fresh `expected_checksum`, and no `changes`. Restore
813
+ checks the provider/version/page and current permissions, refuses third-party
814
+ changes to affected fields, and preserves later changes to untouched fields.
815
+ Records use non-autoloaded options, have no automatic expiry and remain until
816
+ operator cleanup; they are not listed or restored by the page-content snapshot
817
+ tools. A failed or uncertain response can include applied changes: retain its
818
+ snapshot ID and inspect state rather than retrying blindly. Provider sitemap
819
+ invalidation does not establish external cache eviction.
820
+
821
+ Pair MCP 1.5.69 with Free Agent 1.5.40 and restart the server. Native Classic
822
+ editor save/reopen, frontend canonical/robots, primed sitemap exclusion and
823
+ restoration, defaults drift and permission refusal passed on WordPress 7.1,
824
+ PHP 8.3, Divi 5.13.1 and Rank Math 1.0.279. Block editor and other provider
825
+ versions are outside this qualification. TSF canonical/noindex and persistent
826
+ recovery, Rank Math title/description, Yoast, social/schema and bulk edits are
827
+ not part of this change. See [the adapter contract](../docs/rank-math-seo-adapter.md).
803
828
 
804
829
  ### `_meta.idempotent` markers
805
830
 
package/dist/index.js CHANGED
@@ -476,8 +476,8 @@ const BACKUP_FIELD = z
476
476
  .optional()
477
477
  .default(false)
478
478
  .describe("When true on supported content writes, capture a rollback snapshot before applying. dry_run + backup only reports the planned snapshot and does not create one.");
479
- const SEO_FIELD = z.enum(["seo_title", "meta_description"]);
480
- const SEO_PROVIDER = z.enum(["auto", "tsf"]);
479
+ const SEO_FIELD = z.enum(["seo_title", "meta_description", "canonical_url", "noindex"]);
480
+ const SEO_PROVIDER = z.enum(["auto", "tsf", "rank_math"]);
481
481
  const SEO_CHANGE = z.discriminatedUnion("action", [
482
482
  z.strictObject({
483
483
  field: SEO_FIELD,
@@ -508,7 +508,7 @@ const SEO_CHANGES = z
508
508
  });
509
509
  // ── Read Tools ───────────────────────────────────────────────────────
510
510
  registerPluginTool("diviops_seo_provider_list", {
511
- description: "List the Free/core semantic SEO provider adapters and their installed, active, version, compatibility, field, and capability evidence. The first MVP reports only The SEO Framework and never loads an inactive provider. This is discovery only: it returns no post payload and provides no provider installation or activation path. Returns the standardized envelope.",
511
+ description: "List the Free/core semantic SEO provider adapters and their installed, active, version, compatibility, field, and capability evidence. Reports TSF text fields and Rank Math canonical/noindex capabilities; never loads an inactive provider. Rank Math is source-assessed and requires native qualification. This is discovery only: it returns no post payload and provides no provider installation or activation path. Returns the standardized envelope.",
512
512
  inputSchema: {},
513
513
  annotations: { idempotentHint: true },
514
514
  _meta: { idempotent: "true" },
@@ -521,10 +521,10 @@ registerPluginTool("diviops_seo_provider_list", {
521
521
  };
522
522
  });
523
523
  registerPluginTool("diviops_seo_metadata_get", {
524
- description: "Read explicit and effective semantic SEO metadata for one provider-supported post. Free/core and explicit-metadata-only: caller-visible fields are fixed to seo_title and meta_description; no raw metadata keys or provider maps are accepted or returned. Requires edit_post before stored payload exposure. Returns exact explicit presence/value, effective provider output, deterministic checksum, provider lifecycle/capability evidence, canonical WordPress identity evidence, and cache status. Error codes include not_found, forbidden, seo.provider_absent, seo.provider_incompatible, seo.provider_unsupported, and seo.post_type_unsupported. Returns the standardized envelope.",
524
+ description: "Read explicit and effective semantic SEO metadata for one provider-supported post. Free/core and explicit-metadata-only: fields depend on provider: TSF seo_title/meta_description or Rank Math canonical_url/noindex; no raw metadata keys or provider maps are accepted or returned. Requires edit_post before stored payload exposure. Returns exact explicit presence/value, effective provider output, deterministic checksum, provider lifecycle/capability evidence, canonical WordPress identity evidence, and cache status. Error codes include not_found, forbidden, seo.provider_absent, seo.provider_incompatible, seo.provider_unsupported, and seo.post_type_unsupported. Returns the standardized envelope.",
525
525
  inputSchema: {
526
526
  post_id: z.number().int().positive().describe("WordPress post/page ID to inspect. Requires edit_post on this exact target."),
527
- provider: SEO_PROVIDER.optional().default("auto").describe("Provider selector. auto resolves only the active supported TSF adapter in V1."),
527
+ provider: SEO_PROVIDER.optional().default("auto").describe("Provider selector. auto refuses ambiguity when both providers are active."),
528
528
  },
529
529
  annotations: { idempotentHint: true },
530
530
  _meta: { idempotent: "true" },
@@ -1256,26 +1256,30 @@ registerPluginTool("diviops_meta_find_icon", {
1256
1256
  });
1257
1257
  // ── Write Tools ──────────────────────────────────────────────────────
1258
1258
  registerPluginTool("diviops_seo_metadata_update", {
1259
- description: "Update explicit TSF SEO metadata on one provider-supported post through the Free/core semantic contract. Explicit metadata only: changes is a strict one-or-two-item discriminated list for seo_title and meta_description; set requires a plain-text value and clear forbids one. Unknown properties, duplicate fields, HTML/markup, control or invalid UTF-8 bytes, serialized/non-scalar values, secret-like values, and unresolved Divi/global/provider/dynamic tokens are refused before mutation. Requires edit_post and expected_checksum; drift refuses before mutation with no force path. Uses TSF's public sanitize/write/clear lifecycle, exact stored readback, request-local rollback on error/mismatch, and reports before/after checksums, readback, lifecycle, cache, rollback, no-op, and write evidence. Effective output must be verified by a follow-up diviops_seo_metadata_get. No persistent snapshot, canonical override, robots, social, schema, redirect, bulk, cross-site, or automatic Divi extraction path exists." +
1259
+ description: "Update one page/post using fixed provider fields and expected_checksum. TSF retains seo_title/meta_description set/clear with request-local rollback. Rank Math 1.0.279 supports canonical_url set/clear and noindex set with value='noindex' on pages; it preserves other robots directives and previews inherited defaults that become pinned. No generic robots arrays, force-index or noindex clear. Rank Math creates a persistent typed recovery record before apply and returns snapshot_id. To restore, omit changes and pass restore_snapshot_id with a fresh expected_checksum; restore refuses third-party changes and preserves untouched fields. Use dry_run to preview. Reads return provider-computed values, not verified frontend tags; Rank Math suppresses canonical output under noindex. TSF persistent restore, other providers, social/schema/bulk edits are unsupported. Runtime qualification remains separate." +
1260
1260
  DRY_RUN_DESC_SUFFIX,
1261
1261
  inputSchema: {
1262
1262
  post_id: z.number().int().positive().describe("WordPress post/page ID to update. Requires edit_post on this exact target."),
1263
- provider: SEO_PROVIDER.optional().default("auto").describe("Provider selector. Use auto or tsf."),
1263
+ provider: SEO_PROVIDER.optional().default("auto").describe("Provider selector. Use auto, tsf, or rank_math."),
1264
1264
  expected_checksum: z
1265
1265
  .string()
1266
1266
  .regex(/^sha256:[a-f0-9]{64}$/)
1267
1267
  .describe("Exact checksum returned by diviops_seo_metadata_get. Required; there is no force path."),
1268
- changes: SEO_CHANGES.describe("Strict semantic set/clear operations. Each field may appear at most once."),
1268
+ changes: SEO_CHANGES.optional().describe("Provide changes OR restore_snapshot_id. Rank Math noindex set value must be noindex."),
1269
+ restore_snapshot_id: z.string().regex(/^rm_[a-f0-9-]{36}$/).optional().describe("Restore one Rank Math operation; omit changes. Not a content snapshot."),
1269
1270
  dry_run: DRY_RUN_FIELD,
1270
1271
  },
1271
1272
  annotations: { idempotentHint: false },
1272
1273
  _meta: { idempotent: "conditional" },
1273
- }, async ({ post_id, provider, expected_checksum, changes, dry_run }) => {
1274
+ }, async ({ post_id, provider, expected_checksum, changes, restore_snapshot_id, dry_run }) => {
1274
1275
  const body = {
1275
1276
  provider: provider ?? "auto",
1276
1277
  expected_checksum,
1277
- changes,
1278
1278
  };
1279
+ if (changes !== undefined)
1280
+ body.changes = changes;
1281
+ if (restore_snapshot_id !== undefined)
1282
+ body.restore_snapshot_id = restore_snapshot_id;
1279
1283
  if (dry_run)
1280
1284
  body.dry_run = true;
1281
1285
  const result = await wp.requestEnveloped(`/seo/metadata/${post_id}`, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diviops/mcp-server",
3
- "version": "1.5.68",
3
+ "version": "1.5.69",
4
4
  "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",