@diviops/mcp-server 1.5.63 → 1.5.64

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 +10 -2
  2. package/dist/index.js +26 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -8,7 +8,15 @@ 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.63 release note
11
+ ## 1.5.64 release note
12
+
13
+ Adds `diviops_page_settings_get` and `diviops_page_settings_update` with Free
14
+ Agent 1.5.37. Read and update page-wide Content Area and Section backgrounds on ordinary Divi pages. Supports previews, literal colors, transparency and clearing to native defaults, with checksum checks and preservation of unrelated page data. Explicit per-section backgrounds remain intact.
15
+
16
+ Verified on WordPress 7.1, PHP 8.3 and Divi 5.13.1, including native settings
17
+ save/reopen and frontend rendering. Public builder and compatibility floors are unchanged.
18
+
19
+ ## Previous 1.5.63 release note
12
20
 
13
21
  With Free Agent 1.5.36, runtime schema discovery accepts registered third-party
14
22
  Divi modules and routes their namespaced identifiers without dropping the
@@ -424,7 +432,7 @@ The skill enforces the Divi block format, the design system, and the response co
424
432
 
425
433
  ## Tools at a glance
426
434
 
427
- The server exposes **95 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).
435
+ 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).
428
436
 
429
437
  | Category | Use case | Tool prefixes |
430
438
  |----------|----------|---------------|
package/dist/index.js CHANGED
@@ -1363,6 +1363,32 @@ registerPluginTool("diviops_page_update_content", {
1363
1363
  pageContentCandidates.cancel(reservation.data.content_ref);
1364
1364
  }
1365
1365
  });
1366
+ registerPluginTool("diviops_page_settings_get", {
1367
+ 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.",
1368
+ inputSchema: { page_id: z.number().int().positive() },
1369
+ annotations: { readOnlyHint: true },
1370
+ _meta: { idempotent: "true" },
1371
+ }, async ({ page_id }) => {
1372
+ const result = await wp.requestEnveloped(`/page/settings/${page_id}`);
1373
+ return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_page_settings_get") }] };
1374
+ });
1375
+ registerPluginTool("diviops_page_settings_update", {
1376
+ description: "Set/clear Content Area and Section backgrounds on ordinary WordPress pages. Read settings first and pass settings_checksum as expected_checksum. Omission preserves; null deletes the override; empty strings are rejected. Colors: #RGB/#RRGGBB, bounded rgb()/rgba(), or transparent. Existing dynamic values are preserved when omitted but new dynamic values are unsupported. Explicit defaults may be normalized away by native Divi save. Refuses native background drafts. Applies post-scoped CSS/dynamic-assets cache refresh, without canvas-reference cleanup; no-op does not flush. If cache_refresh_failed reports settings_applied, read state and retry cache flush, not the write. Optimistic checksum is not an editor lock." + DRY_RUN_DESC_SUFFIX,
1377
+ inputSchema: {
1378
+ page_id: z.number().int().positive(),
1379
+ expected_checksum: z.string().regex(/^sha256:[a-f0-9]{64}$/),
1380
+ settings: z.object({ content_area_background: z.string().nullable().optional(), section_background: z.string().nullable().optional() }).strict().refine(value => Object.keys(value).length > 0, "Provide at least one background field"),
1381
+ dry_run: DRY_RUN_FIELD,
1382
+ },
1383
+ annotations: { idempotentHint: false },
1384
+ _meta: { idempotent: "false" },
1385
+ }, async ({ page_id, expected_checksum, settings, dry_run }) => {
1386
+ const result = await wp.requestEnveloped(`/page/settings/${page_id}`, {
1387
+ method: "POST",
1388
+ body: { expected_checksum, settings, dry_run: dry_run ?? false },
1389
+ });
1390
+ return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_page_settings_update") }] };
1391
+ });
1366
1392
  registerPluginTool("diviops_page_update_meta", {
1367
1393
  description: "Update page/post metadata fields without touching post_content. Supports title, slug, parent, and menu_order; use diviops_page_update_status for status changes. Slug input must already be in sanitized WordPress post_name form. When a published post's slug changes, preserve_old_slug defaults to true and records the previous slug in _wp_old_slug so WordPress old-slug redirects can work. Returns readback fields after apply. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; missing page_id or invalid parent returns 'not_found', edit-permission failures return 'forbidden' (HTTP 403), invalid/empty slug or malformed field values return 'invalid_input' with `error.data` documenting the field and sanitized slug where relevant." +
1368
1394
  DRY_RUN_DESC_SUFFIX,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diviops/mcp-server",
3
- "version": "1.5.63",
3
+ "version": "1.5.64",
4
4
  "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",