@diviops/mcp-server 1.5.66 → 1.5.68

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 CHANGED
@@ -8,6 +8,38 @@ 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
+
30
+ ## 1.5.67 release note — WP-CLI term metadata and assignments
31
+
32
+ `term meta list <term-id> --format=json` is available as a default read alongside
33
+ `term meta get`. Term-meta `set`/`update` and post-term `add`/`set`/`remove` require
34
+ individual opt-ins through `DIVIOPS_WP_CLI_ALLOW`; they remain denied by default.
35
+ For example, `DIVIOPS_WP_CLI_ALLOW="term meta update,post term add"` enables only
36
+ those additional commands. Restart the MCP server after changing configuration.
37
+ Existing `*`/`all` configurations acquire the expanded extended set on update.
38
+
39
+ WP-CLI passthrough has no `dry_run`, checksum protection or automatic rollback.
40
+ Read current values before writing and check state before retrying a timed-out
41
+ write. See [WP-CLI security](../docs/wp-cli-security.md) for command tiers.
42
+
11
43
  ## 1.5.66 release note
12
44
 
13
45
  Cancellation now reaches pending HTTP requests for page listing, variable listing
@@ -454,13 +486,14 @@ The skill enforces the Divi block format, the design system, and the response co
454
486
 
455
487
  ## Tools at a glance
456
488
 
457
- 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).
458
490
 
459
491
  | Category | Use case | Tool prefixes |
460
492
  |----------|----------|---------------|
461
493
  | Page authoring | Create, edit, restructure pages | `page_*`, `section_*`, `module_*` |
462
494
  | Design system | Manage colors, fonts, variables, presets | `variable_*`, `global_color_*`, `global_font_*`, `preset_*` |
463
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_*` |
464
497
  | WordPress menus | Author reusable nav menus and theme-location assignments | `menu_*` |
465
498
  | Semantic SEO metadata | Inspect provider support and author two explicit TSF text fields with checksum/readback guards | `seo_*` |
466
499
  | Schema introspection | Module attribute discovery | `schema_*` |
package/dist/index.js CHANGED
@@ -1365,6 +1365,36 @@ registerPluginTool("diviops_page_update_content", {
1365
1365
  pageContentCandidates.cancel(reservation.data.content_ref);
1366
1366
  }
1367
1367
  });
1368
+ registerPluginTool("diviops_custom_css_get", {
1369
+ 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.",
1370
+ inputSchema: {}, annotations: { readOnlyHint: true }, _meta: { idempotent: "true" },
1371
+ }, async (_args, context) => {
1372
+ const result = await wp.requestEnveloped("/custom-css", { signal: context?.signal });
1373
+ return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_custom_css_get") }] };
1374
+ });
1375
+ registerPluginTool("diviops_custom_css_upsert", {
1376
+ 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.",
1377
+ inputSchema: {
1378
+ name: z.string().regex(/^[a-z][a-z0-9-]{0,63}$/), css: z.string().max(262144),
1379
+ expected_checksum: z.string().regex(/^sha256:[a-f0-9]{64}$/),
1380
+ dry_run: z.boolean().optional().default(true),
1381
+ },
1382
+ annotations: { idempotentHint: false }, _meta: { idempotent: "false" },
1383
+ }, async ({ name, css, expected_checksum, dry_run }, context) => {
1384
+ const result = await wp.requestEnveloped("/custom-css/upsert", { method: "POST", body: { name, css, expected_checksum, dry_run: dry_run ?? true }, signal: context?.signal });
1385
+ return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_custom_css_upsert") }] };
1386
+ });
1387
+ registerPluginTool("diviops_custom_css_restore", {
1388
+ 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.",
1389
+ inputSchema: {
1390
+ snapshot_id: z.string().regex(/^css_[a-f0-9-]{36}$/), expected_checksum: z.string().regex(/^sha256:[a-f0-9]{64}$/),
1391
+ dry_run: z.boolean().optional().default(true),
1392
+ },
1393
+ annotations: { idempotentHint: false }, _meta: { idempotent: "false" },
1394
+ }, async ({ snapshot_id, expected_checksum, dry_run }, context) => {
1395
+ const result = await wp.requestEnveloped("/custom-css/restore", { method: "POST", body: { snapshot_id, expected_checksum, dry_run: dry_run ?? true }, signal: context?.signal });
1396
+ return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_custom_css_restore") }] };
1397
+ });
1368
1398
  registerPluginTool("diviops_page_settings_get", {
1369
1399
  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
1400
  inputSchema: { page_id: z.number().int().positive() },
@@ -3213,7 +3243,7 @@ registerPluginTool("diviops_canvas_delete", {
3213
3243
  });
3214
3244
  // ── WP-CLI ──────────────────────────────────────────────────────────
3215
3245
  registerLocalTool("diviops_meta_wp_cli", {
3216
- description: "Run a WP-CLI command on the WordPress site. Requires WP_PATH env var (LOCAL_SITE_ID auto-detected from Local by Flywheel), or WP_CLI_CMD for containerized wrappers. Commands validated against a safety allowlist. Default tier covers read ops across options/posts/post-types/taxonomies/users/info/core/db (including targeted `option pluck` and `term meta get` reads), non-destructive writes (post/term create+update, post meta read/write, cache/rewrite/transient flush, `plugin update` from authenticated sources), ACF/SCF schema ops (`acf export/import/field-group list/get` plus SCF 6.8.4+ `scf json {status,sync,import,export}` and the `acf json …` aliases), and WXR export. Extended tier (requires DIVIOPS_WP_CLI_ALLOW env var) adds destructive or bulk-modifying ops: option update, post/post meta/term delete, search-replace, import, plugin activate/deactivate, eval-file. Filesystem-touching commands (`wp export`, `acf export/import`, `scf|acf json export/import`) are additionally constrained: path arguments must resolve under a safe root (defaults to `<WP_PATH>/.diviops-tmp/`, overridable via DIVIOPS_WP_CLI_SAFE_FS_ROOT, disable via DIVIOPS_WP_CLI_UNSAFE_FS=1); `wp export` and `scf json export` require an explicit `--dir=<path>` (or `--stdout`). In WP_CLI_CMD wrapper mode, DIVIOPS_WP_CLI_SAFE_FS_ROOT is required for FS-sensitive commands. Prefer the typed `diviops_scf_*` wrappers for SCF round-trips — they're easier to invoke and accept the same safe-root scoping. Use --format=json for structured output. Full allowlist + tier rationale + filesystem semantics in the MCP server README. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }. Success payload: { stdout: string, stderr: string, exit_code: 0 }. Four failure modes converge on 'meta_wp_cli.command_failed' with error.data = { exit_code: number | null, stdout: string, stderr: string }: (a) numeric exit_code — wp-cli ran and exited non-zero; stdout/stderr are raw streams verbatim. (b) exit_code=null and message starts with 'wp-cli command terminated:' — execFile launched the child but it was killed (timeout or signal); stdout/stderr carry whatever streamed before the kill. (c) exit_code=null and message starts with 'wp-cli could not spawn:' — the OS refused to start the child (ENOENT/EACCES/EPERM); child never ran, stdout/stderr are empty. (d) exit_code=null and message is the rejection reason — pre-execution rejection by the allowlist / FS validator; rejection reason synthesized into error.data.stderr because the child never ran. A missing wp-cli configuration surfaces as 'meta_wp_cli.not_configured'. stdout is always passed through as a string (no server-side JSON parse) — pass --format=json and parse on the caller side when you want structured output.",
3246
+ description: "Run a WP-CLI command on the WordPress site. Requires WP_PATH env var (LOCAL_SITE_ID auto-detected from Local by Flywheel), or WP_CLI_CMD for containerized wrappers. Commands validated against a safety allowlist. Default tier covers read ops across options/posts/post-types/taxonomies/users/info/core/db (including targeted `option pluck` and `term meta get/list` reads), non-destructive writes (post/term create+update, post meta read/write, cache/rewrite/transient flush, `plugin update` from authenticated sources), ACF/SCF schema ops (`acf export/import/field-group list/get` plus SCF 6.8.4+ `scf json {status,sync,import,export}` and the `acf json …` aliases), and WXR export. Extended tier (requires DIVIOPS_WP_CLI_ALLOW env var) adds destructive or bulk-modifying ops: option update, post/post meta/term delete, term meta set/update, post term add/set/remove, search-replace, import, plugin activate/deactivate, eval-file. This passthrough has no dry_run, checksum protection or automatic backup/rollback; read back state before retrying a timed-out write. Filesystem-touching commands (`wp export`, `acf export/import`, `scf|acf json export/import`) are additionally constrained: path arguments must resolve under a safe root (defaults to `<WP_PATH>/.diviops-tmp/`, overridable via DIVIOPS_WP_CLI_SAFE_FS_ROOT, disable via DIVIOPS_WP_CLI_UNSAFE_FS=1); `wp export` and `scf json export` require an explicit `--dir=<path>` (or `--stdout`). In WP_CLI_CMD wrapper mode, DIVIOPS_WP_CLI_SAFE_FS_ROOT is required for FS-sensitive commands. Prefer the typed `diviops_scf_*` wrappers for SCF round-trips — they're easier to invoke and accept the same safe-root scoping. Use --format=json for structured output. Full allowlist + tier rationale + filesystem semantics in the MCP server README. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }. Success payload: { stdout: string, stderr: string, exit_code: 0 }. Four failure modes converge on 'meta_wp_cli.command_failed' with error.data = { exit_code: number | null, stdout: string, stderr: string }: (a) numeric exit_code — wp-cli ran and exited non-zero; stdout/stderr are raw streams verbatim. (b) exit_code=null and message starts with 'wp-cli command terminated:' — execFile launched the child but it was killed (timeout or signal); stdout/stderr carry whatever streamed before the kill. (c) exit_code=null and message starts with 'wp-cli could not spawn:' — the OS refused to start the child (ENOENT/EACCES/EPERM); child never ran, stdout/stderr are empty. (d) exit_code=null and message is the rejection reason — pre-execution rejection by the allowlist / FS validator; rejection reason synthesized into error.data.stderr because the child never ran. A missing wp-cli configuration surfaces as 'meta_wp_cli.not_configured'. stdout is always passed through as a string (no server-side JSON parse) — pass --format=json and parse on the caller side when you want structured output.",
3217
3247
  inputSchema: {
3218
3248
  command: z
3219
3249
  .string()
package/dist/wp-cli.js CHANGED
@@ -28,8 +28,7 @@ const DEFAULT_COMMANDS = [
28
28
  'post meta list',
29
29
  'post meta set',
30
30
  'post meta update',
31
- // Taxonomy assignments (read-only). Assignment writes (`post term add/set/remove`)
32
- // stay unsupported until a concrete workflow justifies a typed or extended path.
31
+ // Taxonomy assignment reads; assignment writes require explicit opt-in.
33
32
  'post term list',
34
33
  // Post types (read-only)
35
34
  'post-type list',
@@ -38,6 +37,7 @@ const DEFAULT_COMMANDS = [
38
37
  'taxonomy list',
39
38
  'term list',
40
39
  'term meta get',
40
+ 'term meta list',
41
41
  'term create',
42
42
  'term update',
43
43
  // ACF / SCF (schema ops — idempotent dev-time workflow)
@@ -117,6 +117,11 @@ const EXTENDED_COMMANDS = [
117
117
  'post delete', // Destructive — permanently removes content
118
118
  'post meta delete', // Destructive — removes metadata
119
119
  'term delete', // Destructive — removes taxonomy terms
120
+ 'term meta set', // Writes arbitrary term metadata
121
+ 'term meta update', // Writes arbitrary term metadata
122
+ 'post term add', // Adds taxonomy assignments
123
+ 'post term set', // Replaces taxonomy assignments
124
+ 'post term remove', // Removes taxonomy assignments
120
125
  'search-replace', // Bulk DB modification — highest-risk content op
121
126
  'import', // Bulk content ingestion from WXR files
122
127
  'plugin activate', // Can enable untrusted plugins
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diviops/mcp-server",
3
- "version": "1.5.66",
3
+ "version": "1.5.68",
4
4
  "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",