@diviops/mcp-server 1.5.39 → 1.5.40
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 +47 -10
- package/dist/cross-env-source-hints.d.ts +7 -0
- package/dist/cross-env-source-hints.js +22 -0
- package/dist/index.js +9 -18
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -21,7 +21,8 @@ DiviOps fits multiple WordPress workflows where AI-driven authoring + management
|
|
|
21
21
|
|
|
22
22
|
## Quick start
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
The first three steps prove connectivity. Native Divi authoring additionally
|
|
25
|
+
requires the client-side skill and first-run verification in steps 4 and 5.
|
|
25
26
|
|
|
26
27
|
### 1. Install the WordPress plugin
|
|
27
28
|
|
|
@@ -38,6 +39,19 @@ In **WP Admin → Users → Your Profile → Application Passwords**:
|
|
|
38
39
|
|
|
39
40
|
### 3. Register the MCP server
|
|
40
41
|
|
|
42
|
+
The successor server line requires Node.js 22 or newer. Upgrade Node before
|
|
43
|
+
selecting `@diviops/mcp-server@1.5.40` or a later release. Operators who must
|
|
44
|
+
remain on Node 18 can pin the previously shipped compatible server explicitly:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npx -y --package=@diviops/mcp-server@1.5.39 diviops-mcp
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
That pin affects only the MCP server. Free and Pro WordPress plugin versions
|
|
51
|
+
use independent version series and remain compatible through the advertised
|
|
52
|
+
per-capability handshake. Direct npm/stdio and MCP v1 remain supported on the
|
|
53
|
+
Node 22 successor; MCP v2 fixtures and the launcher sidecar are not published.
|
|
54
|
+
|
|
41
55
|
Claude Code:
|
|
42
56
|
|
|
43
57
|
```bash
|
|
@@ -61,7 +75,9 @@ WP_USER = "your-wp-username"
|
|
|
61
75
|
WP_APP_PASSWORD = "xxxxXXXXxxxxXXXXxxxxXXXX"
|
|
62
76
|
```
|
|
63
77
|
|
|
64
|
-
Then ask your AI client: **"List the pages on my site."** It calls
|
|
78
|
+
Then ask your AI client: **"List the pages on my site."** It calls
|
|
79
|
+
`diviops_page_list` and renders the result. This proves the plugin and MCP transport;
|
|
80
|
+
it does not prove that the client has loaded Divi authoring knowledge.
|
|
65
81
|
|
|
66
82
|
For Claude Desktop JSON, use `"command": "npx"` with args `["-y", "--package", "@diviops/mcp-server", "diviops-mcp"]`. The package also ships `diviops-preset`, so the explicit package/bin form is required; shorthand package invocation cannot reliably infer which bin to run.
|
|
67
83
|
|
|
@@ -74,6 +90,24 @@ change direct npm/stdio support.
|
|
|
74
90
|
|
|
75
91
|
For a deeper walkthrough (containerized environments, WP-CLI configuration, troubleshooting installation), see [setup-guide.md](../docs/setup-guide.md).
|
|
76
92
|
|
|
93
|
+
### 4. Load the `divi-5-builder` skill
|
|
94
|
+
|
|
95
|
+
Install it for Claude Code by running
|
|
96
|
+
`claude plugin marketplace add oaris-dev/diviops` and then
|
|
97
|
+
`claude plugin install divi-5-builder@diviops`, or copy the distribution's
|
|
98
|
+
`skills/*` into the supported skill directory for Codex/manual setups. WordPress
|
|
99
|
+
and npm updates do not update manual skill copies. Avoid simultaneous
|
|
100
|
+
plugin-managed and stale manual copies, then restart the client and confirm
|
|
101
|
+
`divi-5-builder` is visible.
|
|
102
|
+
|
|
103
|
+
### 5. Prove native module authoring
|
|
104
|
+
|
|
105
|
+
Run the disposable, fail-closed
|
|
106
|
+
[native Divi verification](../docs/setup-guide.md#first-run-native-divi-verification).
|
|
107
|
+
Stop if the skill or required tools are unavailable. Do not accept page-sized HTML,
|
|
108
|
+
Code modules, iframe layouts, or structural HTML in text/container fields as a
|
|
109
|
+
fallback for editable native Divi modules.
|
|
110
|
+
|
|
77
111
|
## Example workflow
|
|
78
112
|
|
|
79
113
|
> **You:** Create a hero section on a new page called "Spring Launch" with a heading, subheading, and a CTA button. Use my brand colors.
|
|
@@ -82,9 +116,10 @@ Claude orchestrates a few tool calls in sequence:
|
|
|
82
116
|
|
|
83
117
|
1. `diviops_global_color_list` — discovers your brand palette.
|
|
84
118
|
2. `diviops_template_list` / `diviops_template_get` — pulls a verified hero template that matches the request.
|
|
85
|
-
3. `
|
|
86
|
-
4. `
|
|
87
|
-
5. `
|
|
119
|
+
3. `diviops_validate_blocks` with inline `content` — confirms the constructed hero markup is well-formed before any write.
|
|
120
|
+
4. `diviops_page_create` — creates `Spring Launch` as a draft using those exact validated bytes.
|
|
121
|
+
5. `diviops_validate_blocks` with the saved `page_id` — verifies persisted readback.
|
|
122
|
+
6. `diviops_render_preview` — returns the rendered HTML so you can verify before publishing. Accepts inline `content` or a `page_id` to preview an existing page.
|
|
88
123
|
|
|
89
124
|
The skill enforces the Divi block format, the design system, and the response contract throughout — you stay at the prompt level.
|
|
90
125
|
|
|
@@ -226,10 +261,12 @@ plus checksum, not an arbitrary filesystem path.
|
|
|
226
261
|
To collect the target JSON from the target WordPress site, call the Free/core
|
|
227
262
|
read-only MCP tool `diviops_cross_env_target_context_get` against the target
|
|
228
263
|
server and save the returned `data` object as `target.json`. Optional
|
|
229
|
-
`source_asset_hints` and `source_attachment_ids` let the
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
264
|
+
`source_asset_hints`, `source_upload_paths`, and `source_attachment_ids` let the
|
|
265
|
+
target site search for media-library candidates. `source_upload_paths` preserves
|
|
266
|
+
exact path provenance, including for root-level filenames; basename-only hints
|
|
267
|
+
remain ambiguous when multiple target paths share a filename. No media is
|
|
268
|
+
uploaded and no global colors or layouts are created. The export includes a
|
|
269
|
+
SHA-256 checksum of the current target layout
|
|
233
270
|
`post_content` as `destination_checksum` so preflight can bind the reviewed plan
|
|
234
271
|
to the target state without exposing the raw target content. It also includes
|
|
235
272
|
`global_color_value_evidence`, a deterministic SHA-256 digest map for resolved
|
|
@@ -380,7 +417,7 @@ Common quick fixes — full reference in [troubleshooting.md](../docs/troublesho
|
|
|
380
417
|
|
|
381
418
|
## Requirements
|
|
382
419
|
|
|
383
|
-
- Node.js >=
|
|
420
|
+
- Node.js >= 22.0.0
|
|
384
421
|
- PHP >= 7.4
|
|
385
422
|
- WordPress >= 6.5
|
|
386
423
|
- Divi 5 theme active
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SourceLayoutPayload } from "./cross-env-preflight/header-preflight.js";
|
|
2
|
+
export interface CrossEnvSourceHints {
|
|
3
|
+
source_asset_hints?: string[];
|
|
4
|
+
source_upload_paths?: string[];
|
|
5
|
+
source_attachment_ids?: number[];
|
|
6
|
+
}
|
|
7
|
+
export declare function sourceHintsFromPayload(source: SourceLayoutPayload): CrossEnvSourceHints;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function sourceHintsFromPayload(source) {
|
|
2
|
+
const hints = new Set();
|
|
3
|
+
const uploadPaths = new Set();
|
|
4
|
+
const ids = new Set();
|
|
5
|
+
for (const attachment of source.attachments ?? []) {
|
|
6
|
+
if (typeof attachment.id === "number" && Number.isInteger(attachment.id) && attachment.id > 0) {
|
|
7
|
+
ids.add(attachment.id);
|
|
8
|
+
}
|
|
9
|
+
for (const value of [attachment.path, attachment.url, attachment.filename]) {
|
|
10
|
+
if (typeof value === "string" && value.trim())
|
|
11
|
+
hints.add(value.trim());
|
|
12
|
+
}
|
|
13
|
+
if (typeof attachment.path === "string" && attachment.path.trim()) {
|
|
14
|
+
uploadPaths.add(attachment.path.trim());
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
...(hints.size > 0 ? { source_asset_hints: [...hints].sort((a, b) => a.localeCompare(b)) } : {}),
|
|
19
|
+
...(uploadPaths.size > 0 ? { source_upload_paths: [...uploadPaths].sort((a, b) => a.localeCompare(b)) } : {}),
|
|
20
|
+
...(ids.size > 0 ? { source_attachment_ids: [...ids].sort((a, b) => a - b) } : {}),
|
|
21
|
+
};
|
|
22
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ import { ErrorCodes, envelopeMap, recordIdempotent, serializeEnvelope, withCode,
|
|
|
18
18
|
import { preflightCrossEnvHeaderSync, } from "./cross-env-preflight/header-preflight.js";
|
|
19
19
|
import { preflightCrossEnvThemeBuilderLayoutSync, } from "./cross-env-preflight/layout-preflight.js";
|
|
20
20
|
import { crossEnvEvidenceLayoutKinds } from "./cross-env-preflight/layout-capability.js";
|
|
21
|
+
import { sourceHintsFromPayload } from "./cross-env-source-hints.js";
|
|
21
22
|
import { createSourcePayloadRef, loadSourcePayloadRef, } from "./cross-env-preflight/source-payload-ref.js";
|
|
22
23
|
import { optimizeSchema } from "./schema-optimizer.js";
|
|
23
24
|
import { schemaModuleRoute } from "./schema-route.js";
|
|
@@ -2530,6 +2531,10 @@ function registerCrossEnvEvidenceTools() {
|
|
|
2530
2531
|
.array(z.string())
|
|
2531
2532
|
.optional()
|
|
2532
2533
|
.describe("Optional source upload paths, asset URLs, or basenames used to search target media candidates. Query strings, fragments, and credentials are stripped from output."),
|
|
2534
|
+
source_upload_paths: z
|
|
2535
|
+
.array(z.string())
|
|
2536
|
+
.optional()
|
|
2537
|
+
.describe("Optional source-export attachment paths with exact-path provenance, including root-level filenames."),
|
|
2533
2538
|
source_attachment_ids: z
|
|
2534
2539
|
.array(z.number())
|
|
2535
2540
|
.optional()
|
|
@@ -2542,7 +2547,7 @@ function registerCrossEnvEvidenceTools() {
|
|
|
2542
2547
|
},
|
|
2543
2548
|
annotations: { idempotentHint: true },
|
|
2544
2549
|
_meta: { idempotent: "true" },
|
|
2545
|
-
}, async ({ destination_id, destination_kind, source_asset_hints, source_attachment_ids, }) => {
|
|
2550
|
+
}, async ({ destination_id, destination_kind, source_asset_hints, source_upload_paths, source_attachment_ids, }) => {
|
|
2546
2551
|
const body = {
|
|
2547
2552
|
destination_id,
|
|
2548
2553
|
destination_kind: destination_kind ?? "tb_header_layout",
|
|
@@ -2550,6 +2555,9 @@ function registerCrossEnvEvidenceTools() {
|
|
|
2550
2555
|
if (source_asset_hints && source_asset_hints.length > 0) {
|
|
2551
2556
|
body.source_asset_hints = source_asset_hints;
|
|
2552
2557
|
}
|
|
2558
|
+
if (source_upload_paths && source_upload_paths.length > 0) {
|
|
2559
|
+
body.source_upload_paths = source_upload_paths;
|
|
2560
|
+
}
|
|
2553
2561
|
if (source_attachment_ids && source_attachment_ids.length > 0) {
|
|
2554
2562
|
body.source_attachment_ids = source_attachment_ids;
|
|
2555
2563
|
}
|
|
@@ -4133,23 +4141,6 @@ const CrossEnvSourcePayloadRefSchema = z
|
|
|
4133
4141
|
function normalizeReviewedFingerprint(value) {
|
|
4134
4142
|
return value.trim().replace(/^sha256:/i, "").toLowerCase();
|
|
4135
4143
|
}
|
|
4136
|
-
function sourceHintsFromPayload(source) {
|
|
4137
|
-
const hints = new Set();
|
|
4138
|
-
const ids = new Set();
|
|
4139
|
-
for (const attachment of source.attachments ?? []) {
|
|
4140
|
-
if (typeof attachment.id === "number" && Number.isInteger(attachment.id) && attachment.id > 0) {
|
|
4141
|
-
ids.add(attachment.id);
|
|
4142
|
-
}
|
|
4143
|
-
for (const value of [attachment.path, attachment.url, attachment.filename]) {
|
|
4144
|
-
if (typeof value === "string" && value.trim())
|
|
4145
|
-
hints.add(value.trim());
|
|
4146
|
-
}
|
|
4147
|
-
}
|
|
4148
|
-
return {
|
|
4149
|
-
...(hints.size > 0 ? { source_asset_hints: [...hints].sort((a, b) => a.localeCompare(b)) } : {}),
|
|
4150
|
-
...(ids.size > 0 ? { source_attachment_ids: [...ids].sort((a, b) => a - b) } : {}),
|
|
4151
|
-
};
|
|
4152
|
-
}
|
|
4153
4144
|
const ManagedRecoveryPolicySchema = z
|
|
4154
4145
|
.object({
|
|
4155
4146
|
version: z.literal(1),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diviops/mcp-server",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.40",
|
|
4
4
|
"description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -48,10 +48,15 @@
|
|
|
48
48
|
},
|
|
49
49
|
"homepage": "https://github.com/oaris-dev/diviops/tree/main/diviops-server#readme",
|
|
50
50
|
"engines": {
|
|
51
|
-
"node": ">=
|
|
51
|
+
"node": ">=22.0.0"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@
|
|
54
|
+
"@hono/node-server": "2.1.0",
|
|
55
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
56
|
+
"body-parser": "2.3.0",
|
|
57
|
+
"fast-uri": "3.1.5",
|
|
58
|
+
"hono": "4.13.1",
|
|
59
|
+
"ip-address": "10.5.0",
|
|
55
60
|
"zod": "^4.3.6"
|
|
56
61
|
},
|
|
57
62
|
"devDependencies": {
|