@diviops/mcp-server 1.5.58 → 1.5.60
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 +28 -5
- package/dist/index.js +1 -1
- package/dist/wp-cli.d.ts +2 -1
- package/dist/wp-cli.js +11 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,7 +8,32 @@ 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.
|
|
11
|
+
## 1.5.60 release note
|
|
12
|
+
|
|
13
|
+
When WP-CLI is configured, `diviops_meta_info` now includes `wp_cli.ignored`:
|
|
14
|
+
the unique, trimmed entries from `DIVIOPS_WP_CLI_ALLOW` that were not recognized
|
|
15
|
+
at startup. Clients can inspect these alongside `allowed` and `extendable`
|
|
16
|
+
even when startup warnings are hidden. Command permissions and matching are
|
|
17
|
+
unchanged. Restart the MCP server after changing the environment configuration.
|
|
18
|
+
|
|
19
|
+
The MCP SDK dependency now requires v1.31.0 or later within v1, incorporating
|
|
20
|
+
its OAuth client credential-routing fix. This package uses the SDK server/stdio
|
|
21
|
+
path. Free remains 1.5.30, public builder remains 1.4.11, and compatibility floors
|
|
22
|
+
are unchanged.
|
|
23
|
+
|
|
24
|
+
## Previous 1.5.59 release note
|
|
25
|
+
|
|
26
|
+
Adds two default WP-CLI reads: `option pluck <option> <key-path>...` for a nested
|
|
27
|
+
option value, and `term meta get <term-id> <key>` for a term-meta field. Existing
|
|
28
|
+
write permissions are unchanged. Restart the MCP client connection after updating
|
|
29
|
+
to refresh the effective command list.
|
|
30
|
+
|
|
31
|
+
Public builder companion 1.4.11 corrects admin-label examples to use
|
|
32
|
+
`module.meta.adminLabel.desktop.value`. Updating npm does not update independently
|
|
33
|
+
installed skills or instructions already read by an agent. Free remains 1.5.30;
|
|
34
|
+
dependencies and compatibility floors are unchanged.
|
|
35
|
+
|
|
36
|
+
## Previous 1.5.58 release note
|
|
12
37
|
|
|
13
38
|
With Free 1.5.30, module preset create/update accepts `group_presets` for native
|
|
14
39
|
root composition, and inspection exposes stored links. The supplied map replaces
|
|
@@ -23,10 +48,8 @@ heading levels according to document hierarchy, without changing typography or
|
|
|
23
48
|
warning detection. Updating npm or WordPress does not update independently
|
|
24
49
|
installed skills or instructions already read by an agent.
|
|
25
50
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
are unchanged. Package qualification and publication remain separate from
|
|
29
|
-
source acceptance.
|
|
51
|
+
Free 1.5.30, MCP 1.5.58 and public builder 1.4.10 were delivered together.
|
|
52
|
+
Dependencies and compatibility floors were unchanged.
|
|
30
53
|
|
|
31
54
|
## Previous 1.5.57 candidate release note
|
|
32
55
|
|
package/dist/index.js
CHANGED
|
@@ -3182,7 +3182,7 @@ registerPluginTool("diviops_canvas_delete", {
|
|
|
3182
3182
|
});
|
|
3183
3183
|
// ── WP-CLI ──────────────────────────────────────────────────────────
|
|
3184
3184
|
registerLocalTool("diviops_meta_wp_cli", {
|
|
3185
|
-
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, 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.",
|
|
3185
|
+
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.",
|
|
3186
3186
|
inputSchema: {
|
|
3187
3187
|
command: z
|
|
3188
3188
|
.string()
|
package/dist/wp-cli.d.ts
CHANGED
|
@@ -68,10 +68,11 @@ export declare function createWpCli(config: WpCliConfig): {
|
|
|
68
68
|
exitCode: number | null;
|
|
69
69
|
failureKind?: "rejected" | "spawn_failed" | "killed" | "exited";
|
|
70
70
|
}>;
|
|
71
|
-
/** Return
|
|
71
|
+
/** Return startup permissions and ignored opt-ins for meta_info diagnostics. */
|
|
72
72
|
getAllowedCommands(): {
|
|
73
73
|
allowed: string[];
|
|
74
74
|
extendable: string[];
|
|
75
|
+
ignored: string[];
|
|
75
76
|
};
|
|
76
77
|
};
|
|
77
78
|
export {};
|
package/dist/wp-cli.js
CHANGED
|
@@ -17,6 +17,7 @@ import { resolveSafeFsRoot, fsValidationDisabled, ensureSafeFsRoot, matchFsSensi
|
|
|
17
17
|
const DEFAULT_COMMANDS = [
|
|
18
18
|
// Options (read-only)
|
|
19
19
|
'option get',
|
|
20
|
+
'option pluck',
|
|
20
21
|
'option list',
|
|
21
22
|
// Posts (read + create/update)
|
|
22
23
|
'post list',
|
|
@@ -36,6 +37,7 @@ const DEFAULT_COMMANDS = [
|
|
|
36
37
|
// Taxonomies (read + non-destructive write)
|
|
37
38
|
'taxonomy list',
|
|
38
39
|
'term list',
|
|
40
|
+
'term meta get',
|
|
39
41
|
'term create',
|
|
40
42
|
'term update',
|
|
41
43
|
// ACF / SCF (schema ops — idempotent dev-time workflow)
|
|
@@ -125,28 +127,31 @@ const EXTENDED_COMMANDS = [
|
|
|
125
127
|
function buildAllowlist() {
|
|
126
128
|
const extra = process.env.DIVIOPS_WP_CLI_ALLOW?.trim();
|
|
127
129
|
if (!extra)
|
|
128
|
-
return DEFAULT_COMMANDS;
|
|
130
|
+
return { allowed: DEFAULT_COMMANDS, ignored: [] };
|
|
129
131
|
// Wildcard sentinel — convenience for trusted local-dev environments. Grants
|
|
130
132
|
// every entry in EXTENDED_COMMANDS but does NOT unlock anything beyond it
|
|
131
133
|
// (notably: `db query` stays out — see #361 Chunk B). Always emits a startup
|
|
132
134
|
// warning so the broad grant is never silent.
|
|
133
135
|
if (extra === '*' || extra === 'all') {
|
|
134
136
|
console.warn(`[diviops] DIVIOPS_WP_CLI_ALLOW="${extra}" — granting ALL ${EXTENDED_COMMANDS.length} extended commands. Intended for trusted local-dev only.`);
|
|
135
|
-
return [...DEFAULT_COMMANDS, ...EXTENDED_COMMANDS];
|
|
137
|
+
return { allowed: [...DEFAULT_COMMANDS, ...EXTENDED_COMMANDS], ignored: [] };
|
|
136
138
|
}
|
|
137
139
|
const requested = extra.split(',').map((s) => s.trim()).filter(Boolean);
|
|
138
140
|
const granted = new Set(DEFAULT_COMMANDS);
|
|
141
|
+
const ignored = new Set();
|
|
139
142
|
for (const cmd of requested) {
|
|
140
143
|
if (EXTENDED_COMMANDS.includes(cmd)) {
|
|
141
144
|
granted.add(cmd);
|
|
142
145
|
}
|
|
143
146
|
else if (!granted.has(cmd)) {
|
|
147
|
+
ignored.add(cmd);
|
|
144
148
|
console.warn(`[diviops] Ignoring unknown WP-CLI allow entry: "${cmd}"`);
|
|
145
149
|
}
|
|
146
150
|
}
|
|
147
|
-
return [...granted];
|
|
151
|
+
return { allowed: [...granted], ignored: [...ignored] };
|
|
148
152
|
}
|
|
149
|
-
|
|
153
|
+
// Diagnostics and permissions describe the same startup configuration.
|
|
154
|
+
const { allowed: ALLOWED_COMMANDS, ignored: IGNORED_COMMANDS } = buildAllowlist();
|
|
150
155
|
/**
|
|
151
156
|
* Validate a parsed command against the allowlist.
|
|
152
157
|
* Checks the first 1-3 args against allowed command prefixes (supports
|
|
@@ -589,10 +594,11 @@ export function createWpCli(config) {
|
|
|
589
594
|
async runArgs(args) {
|
|
590
595
|
return runArgv(args);
|
|
591
596
|
},
|
|
592
|
-
/** Return
|
|
597
|
+
/** Return startup permissions and ignored opt-ins for meta_info diagnostics. */
|
|
593
598
|
getAllowedCommands() {
|
|
594
599
|
return {
|
|
595
600
|
allowed: [...ALLOWED_COMMANDS],
|
|
601
|
+
ignored: [...IGNORED_COMMANDS],
|
|
596
602
|
extendable: EXTENDED_COMMANDS.filter((c) => !ALLOWED_COMMANDS.includes(c)),
|
|
597
603
|
};
|
|
598
604
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diviops/mcp-server",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.60",
|
|
4
4
|
"description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@hono/node-server": "2.1.0",
|
|
64
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
64
|
+
"@modelcontextprotocol/sdk": "^1.31.0",
|
|
65
65
|
"body-parser": "2.3.0",
|
|
66
66
|
"fast-uri": "3.1.8",
|
|
67
67
|
"hono": "4.13.7",
|