@diviops/mcp-server 1.5.65 → 1.5.67

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,7 +8,34 @@ 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.65 release note
11
+ ## 1.5.67 release note — WP-CLI term metadata and assignments
12
+
13
+ `term meta list <term-id> --format=json` is available as a default read alongside
14
+ `term meta get`. Term-meta `set`/`update` and post-term `add`/`set`/`remove` require
15
+ individual opt-ins through `DIVIOPS_WP_CLI_ALLOW`; they remain denied by default.
16
+ For example, `DIVIOPS_WP_CLI_ALLOW="term meta update,post term add"` enables only
17
+ those additional commands. Restart the MCP server after changing configuration.
18
+ Existing `*`/`all` configurations acquire the expanded extended set on update.
19
+
20
+ WP-CLI passthrough has no `dry_run`, checksum protection or automatic rollback.
21
+ Read current values before writing and check state before retrying a timed-out
22
+ write. See [WP-CLI security](../docs/wp-cli-security.md) for command tiers.
23
+
24
+ ## 1.5.66 release note
25
+
26
+ Cancellation now reaches pending HTTP requests for page listing, variable listing
27
+ and creation, cache flushing, and Theme Builder template trash or preview.
28
+ Cancelling a dispatched write does not prove that WordPress stopped or rolled it
29
+ back; check the resulting state before retrying. This correction does not
30
+ establish the cause of the separately reported four-minute client timeouts.
31
+
32
+ WP-CLI rejection messages now identify the full opt-in command, such as
33
+ `post meta delete`. Existing permissions and opt-in guidance are preserved.
34
+
35
+ Update and restart the MCP server. These corrections require no Free Agent update;
36
+ Free Agent remains 1.5.38 and public builder remains 1.4.11.
37
+
38
+ ## Previous 1.5.65 release note
12
39
 
13
40
  Variable scans now report incompatible legacy non-color IDs, whether they are defined, and their known page/preset references. Scan coverage and truncation are explicit. Existing orphan and unused classifications are unchanged. Native page-usage detection is not proof of successful frontend rendering.
14
41
 
package/dist/index.js CHANGED
@@ -554,8 +554,10 @@ registerPluginTool("diviops_page_list", {
554
554
  },
555
555
  annotations: { idempotentHint: true },
556
556
  _meta: { idempotent: "true" },
557
- }, async ({ post_type, per_page, page }) => {
557
+ }, async (args, context) => {
558
+ const { post_type, per_page, page } = args;
558
559
  const result = await wp.requestEnveloped("/page/list", {
560
+ signal: requestAbortSignal(args, context),
559
561
  params: {
560
562
  post_type: post_type ?? "page",
561
563
  per_page: String(per_page ?? 20),
@@ -2939,8 +2941,10 @@ registerPluginTool("diviops_tb_template_trash", {
2939
2941
  },
2940
2942
  annotations: { idempotentHint: false },
2941
2943
  _meta: { idempotent: "conditional" },
2942
- }, async ({ template_id, force, dry_run }) => {
2944
+ }, async (args, context) => {
2945
+ const { template_id, force, dry_run } = args;
2943
2946
  const result = await wp.requestEnveloped(`/theme-builder/template/trash/${template_id}`, {
2947
+ signal: requestAbortSignal(args, context),
2944
2948
  method: "POST",
2945
2949
  body: {
2946
2950
  force: force ?? false,
@@ -3209,7 +3213,7 @@ registerPluginTool("diviops_canvas_delete", {
3209
3213
  });
3210
3214
  // ── WP-CLI ──────────────────────────────────────────────────────────
3211
3215
  registerLocalTool("diviops_meta_wp_cli", {
3212
- 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.",
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/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.",
3213
3217
  inputSchema: {
3214
3218
  command: z
3215
3219
  .string()
@@ -3859,13 +3863,17 @@ registerPluginTool("diviops_variable_list", {
3859
3863
  },
3860
3864
  annotations: { idempotentHint: true },
3861
3865
  _meta: { idempotent: "true" },
3862
- }, async ({ type, prefix }) => {
3866
+ }, async (args, context) => {
3867
+ const { type, prefix } = args;
3863
3868
  const params = {};
3864
3869
  if (type)
3865
3870
  params.type = type;
3866
3871
  if (prefix)
3867
3872
  params.prefix = prefix;
3868
- const result = await wp.requestEnveloped("/variable/list", { params });
3873
+ const result = await wp.requestEnveloped("/variable/list", {
3874
+ params,
3875
+ signal: requestAbortSignal(args, context),
3876
+ });
3869
3877
  return {
3870
3878
  content: [
3871
3879
  { type: "text", text: serializeEnvelope(result, "diviops_variable_list") },
@@ -3936,7 +3944,8 @@ registerPluginTool("diviops_variable_create", {
3936
3944
  },
3937
3945
  annotations: { idempotentHint: false },
3938
3946
  _meta: { idempotent: "false" },
3939
- }, async ({ type, id, label, value, gradient, min, max, targets, output_unit, root_font_size_px, dry_run, }) => {
3947
+ }, async (args, context) => {
3948
+ const { type, id, label, value, gradient, min, max, targets, output_unit, root_font_size_px, dry_run, } = args;
3940
3949
  // Structured gradient serialization is a plugin-side capability (#921).
3941
3950
  // Gate it so a new server + old plugin fails with a clear "update plugin"
3942
3951
  // error instead of the confusing "value must be scalar" the old callback
@@ -3963,6 +3972,7 @@ registerPluginTool("diviops_variable_create", {
3963
3972
  if (dry_run)
3964
3973
  body.dry_run = true;
3965
3974
  const result = await wp.requestEnveloped("/variable/create", {
3975
+ signal: requestAbortSignal(args, context),
3966
3976
  method: "POST",
3967
3977
  body,
3968
3978
  });
@@ -4239,7 +4249,8 @@ registerPluginTool("diviops_meta_flush_cache", {
4239
4249
  },
4240
4250
  annotations: { idempotentHint: true },
4241
4251
  _meta: { idempotent: "true" },
4242
- }, async ({ post_id, all, after, dry_run, cleanup_dynamic_assets, cleanup_canvas_refs }) => {
4252
+ }, async (args, context) => {
4253
+ const { post_id, all, after, dry_run, cleanup_dynamic_assets, cleanup_canvas_refs } = args;
4243
4254
  const body = {};
4244
4255
  if (post_id !== undefined)
4245
4256
  body.post_id = post_id;
@@ -4254,6 +4265,7 @@ registerPluginTool("diviops_meta_flush_cache", {
4254
4265
  if (cleanup_canvas_refs)
4255
4266
  body.cleanup_canvas_refs = true;
4256
4267
  const result = await wp.requestEnveloped("/meta/flush-cache", {
4268
+ signal: requestAbortSignal(args, context),
4257
4269
  method: "POST",
4258
4270
  body,
4259
4271
  });
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
@@ -175,14 +180,15 @@ function isCommandAllowed(args) {
175
180
  }
176
181
  }
177
182
  const extendable = EXTENDED_COMMANDS.filter((c) => !ALLOWED_COMMANDS.includes(c));
178
- const hint = extendable.some((c) => twoWord === c || threeWord === c || oneWord === c)
183
+ const extendedCommand = extendable.find((c) => twoWord === c || threeWord === c || oneWord === c);
184
+ const hint = extendedCommand
179
185
  ? ` This command can be enabled via DIVIOPS_WP_CLI_ALLOW env var (see README).`
180
186
  : extendable.length > 0
181
187
  ? ` Opt-in commands available: ${extendable.join(', ')}.`
182
188
  : '';
183
189
  return {
184
190
  allowed: false,
185
- reason: `Command "${twoWord}" not in allowlist.${hint}`,
191
+ reason: `Command "${extendedCommand ?? twoWord}" not in allowlist.${hint}`,
186
192
  };
187
193
  }
188
194
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diviops/mcp-server",
3
- "version": "1.5.65",
3
+ "version": "1.5.67",
4
4
  "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",