@diviops/mcp-server 1.5.67 → 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 +53 -8
  2. package/dist/index.js +44 -10
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -8,6 +8,25 @@ The Node.js MCP server inside the DiviOps harness. It gives Claude Code, Codex,
8
8
  Claude Code <-> MCP Server (stdio) <-> WordPress REST API <-> DiviOps Agent plugin
9
9
  ```
10
10
 
11
+ ## 1.5.68 release note — named site-wide CSS blocks
12
+
13
+ With Free Agent 1.5.39, `diviops_custom_css_get`, `diviops_custom_css_upsert`
14
+ and `diviops_custom_css_restore` read, preview, update and restore named blocks
15
+ in the active theme's native Custom CSS. Writes default to preview and require
16
+ an explicit apply with a fresh checksum. Unrelated CSS and theme options are
17
+ preserved; writes retain a seven-day recovery snapshot.
18
+
19
+ Initialize or reconcile storage through **Divi > Theme Options > General >
20
+ Custom CSS**, save visibly, then read again before applying. Missing or divergent
21
+ native storage is refused. A Customizer save can leave Divi's legacy mirror out
22
+ of sync; the tools do not repair it automatically. CSS support is a bounded
23
+ subset, and changing themes requires a fresh read. Check state after a cancelled
24
+ or failed write before retrying; use the CSS-specific restore tool for recovery.
25
+
26
+ Native editing, frontend rendering, recovery and child-theme isolation were
27
+ verified on WordPress 7.1, PHP 8.3 and Divi 5.13.1. Update both components and
28
+ restart the MCP server.
29
+
11
30
  ## 1.5.67 release note — WP-CLI term metadata and assignments
12
31
 
13
32
  `term meta list <term-id> --format=json` is available as a default read alongside
@@ -467,15 +486,16 @@ The skill enforces the Divi block format, the design system, and the response co
467
486
 
468
487
  ## Tools at a glance
469
488
 
470
- The server exposes **97 always-on tools** across the categories below. Each category links to representative tools; the full table lives in [server-reference.md](../docs/server-reference.md).
489
+ The server exposes **100 always-on tools** across the categories below. Each category links to representative tools; the full table lives in [server-reference.md](../docs/server-reference.md).
471
490
 
472
491
  | Category | Use case | Tool prefixes |
473
492
  |----------|----------|---------------|
474
493
  | Page authoring | Create, edit, restructure pages | `page_*`, `section_*`, `module_*` |
475
494
  | Design system | Manage colors, fonts, variables, presets | `variable_*`, `global_color_*`, `global_font_*`, `preset_*` |
476
495
  | Library + templates | Reusable layouts + Theme Builder | `library_*`, `template_*`, `tb_*` |
496
+ | Native Custom CSS | Read, preview, update and restore named site-wide CSS blocks | `custom_css_*` |
477
497
  | WordPress menus | Author reusable nav menus and theme-location assignments | `menu_*` |
478
- | 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_*` |
479
499
  | Schema introspection | Module attribute discovery | `schema_*` |
480
500
  | Canvas / off-canvas | Popups, modals, menus | `canvas_*` |
481
501
  | SCF integration | Secure Custom Fields sync | `scf_*` |
@@ -774,12 +794,37 @@ permission, refuses content or supported Divi post-meta drift before mutation,
774
794
  uses the same full-content integrity/readback guard, and has no force override
775
795
  or second pre-restore snapshot in this MVP.
776
796
 
777
- `diviops_seo_metadata_update` is a separate explicit-metadata-only path. It
778
- accepts no raw provider keys, requires the checksum from
779
- `diviops_seo_metadata_get`, validates plain text before TSF sanitization,
780
- verifies exact stored readback, and performs request-local restoration on a
781
- mismatch. It does not create a persistent rollback snapshot; effective
782
- 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).
783
828
 
784
829
  ### `_meta.idempotent` markers
785
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}`, {
@@ -1365,6 +1369,36 @@ registerPluginTool("diviops_page_update_content", {
1365
1369
  pageContentCandidates.cancel(reservation.data.content_ref);
1366
1370
  }
1367
1371
  });
1372
+ registerPluginTool("diviops_custom_css_get", {
1373
+ description: "Read raw site-wide Additional CSS for the active stylesheet, its legacy Divi mirror and a complete state checksum. Requires admin and edit_css. Existing initialized native CSS post only; initialize or reconcile through Divi Theme Options > General > Custom CSS, then reread and verify the mirror agrees. Customizer alone may leave a divergent mirror. Refuses preprocessed CSS and unsupported data hooks. This is not computed browser CSS or generic Theme Options access.",
1374
+ inputSchema: {}, annotations: { readOnlyHint: true }, _meta: { idempotent: "true" },
1375
+ }, async (_args, context) => {
1376
+ const result = await wp.requestEnveloped("/custom-css", { signal: context?.signal });
1377
+ return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_custom_css_get") }] };
1378
+ });
1379
+ registerPluginTool("diviops_custom_css_upsert", {
1380
+ description: "Append or replace one named site-wide CSS block while preserving unrelated bytes. Read custom_css_get and pass checksum as expected_checksum. Defaults to preview; explicitly pass dry_run:false to commit the same proposal. Uses a mandatory seven-day CSS recovery snapshot and exact readback. Requires existing initialized active-theme CSS storage, admin and edit_css; no generic option writes or new CSS posts. Refuses ambiguous markers and raw unquoted URL grouping; use quoted or base64 URLs. A failure or cancellation does not prove no write: read state and inspect snapshot/recovered/record_verified before further action. Optimistic checksum is not a native-editor lock.",
1381
+ inputSchema: {
1382
+ name: z.string().regex(/^[a-z][a-z0-9-]{0,63}$/), css: z.string().max(262144),
1383
+ expected_checksum: z.string().regex(/^sha256:[a-f0-9]{64}$/),
1384
+ dry_run: z.boolean().optional().default(true),
1385
+ },
1386
+ annotations: { idempotentHint: false }, _meta: { idempotent: "false" },
1387
+ }, async ({ name, css, expected_checksum, dry_run }, context) => {
1388
+ const result = await wp.requestEnveloped("/custom-css/upsert", { method: "POST", body: { name, css, expected_checksum, dry_run: dry_run ?? true }, signal: context?.signal });
1389
+ return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_custom_css_upsert") }] };
1390
+ });
1391
+ registerPluginTool("diviops_custom_css_restore", {
1392
+ description: "Preview or restore only the CSS post/mirror owned by a custom_css_upsert snapshot. Read current custom_css_get and pass its checksum. Defaults to preview; dry_run:false commits. Requires admin and edit_css, matching active stylesheet/post identity and unexpired verified snapshot. Refuses conflicting third-party changes; no whole-option restore, CSS post deletion or cache/revision rollback. On incomplete recovery inspect recovered and record_verified; do not blindly retry.",
1393
+ inputSchema: {
1394
+ snapshot_id: z.string().regex(/^css_[a-f0-9-]{36}$/), expected_checksum: z.string().regex(/^sha256:[a-f0-9]{64}$/),
1395
+ dry_run: z.boolean().optional().default(true),
1396
+ },
1397
+ annotations: { idempotentHint: false }, _meta: { idempotent: "false" },
1398
+ }, async ({ snapshot_id, expected_checksum, dry_run }, context) => {
1399
+ const result = await wp.requestEnveloped("/custom-css/restore", { method: "POST", body: { snapshot_id, expected_checksum, dry_run: dry_run ?? true }, signal: context?.signal });
1400
+ return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_custom_css_restore") }] };
1401
+ });
1368
1402
  registerPluginTool("diviops_page_settings_get", {
1369
1403
  description: "Read ordinary WordPress page background settings: stored values/presence, native defaults and a settings_checksum. These are not computed browser colors. Requires edit permission. No Theme Builder layout or global Theme Options access.",
1370
1404
  inputSchema: { page_id: z.number().int().positive() },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diviops/mcp-server",
3
- "version": "1.5.67",
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",