@diviops/mcp-server 0.2.4 → 0.2.5
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 +4 -3
- package/dist/index.js +18 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -91,9 +91,9 @@ The server connects via standard WordPress REST API and works with any environme
|
|
|
91
91
|
|
|
92
92
|
> **WP-CLI note:** `WP_PATH` keeps the existing Local by Flywheel behavior by running `wp` directly on the host filesystem. For Docker-based environments (DDEV, wp-env, DevKinsta, WordPress Studio), set `WP_CLI_CMD` to the wrapper command instead. When `WP_CLI_CMD` is set, the server executes the wrapper from `WP_PATH` if provided, otherwise from its current working directory. The MCP server still validates the requested WP-CLI subcommand against its allowlist before executing either path.
|
|
93
93
|
|
|
94
|
-
## Available Tools (
|
|
94
|
+
## Available Tools (47)
|
|
95
95
|
|
|
96
|
-
### Read (
|
|
96
|
+
### Read (26)
|
|
97
97
|
| Tool | Description |
|
|
98
98
|
|------|-------------|
|
|
99
99
|
| `diviops_test_connection` | Test WordPress connection and Divi version |
|
|
@@ -119,6 +119,7 @@ The server connects via standard WordPress REST API and works with any environme
|
|
|
119
119
|
| `diviops_list_tb_templates` | List Theme Builder templates with conditions and layout IDs |
|
|
120
120
|
| `diviops_get_tb_layout` | Get a Theme Builder layout's block markup (header/body/footer) |
|
|
121
121
|
| `diviops_list_variables` | List design token variables (filter by type or prefix) |
|
|
122
|
+
| `diviops_variables_scan_orphans` | Find `gvid-`/`gcid-` refs with no backing Variable Manager entry (orphans render as invalid CSS) + unused variables (defined, never referenced). Scans pages, Theme Builder layouts (header/body/footer), Divi Library items, canvas pages, and the preset registry |
|
|
122
123
|
| `diviops_list_canvases` | List all canvas pages |
|
|
123
124
|
| `diviops_get_canvas` | Get canvas content |
|
|
124
125
|
|
|
@@ -141,7 +142,7 @@ The server connects via standard WordPress REST API and works with any environme
|
|
|
141
142
|
| `diviops_update_tb_layout` | Update a Theme Builder layout's block markup |
|
|
142
143
|
| `diviops_create_tb_template` | Create Theme Builder template with header/footer and conditions |
|
|
143
144
|
| `diviops_create_variable` | Create a design token variable |
|
|
144
|
-
| `diviops_delete_variable` | Delete a variable by ID |
|
|
145
|
+
| `diviops_delete_variable` | Delete a variable by ID. Returns HTTP 409 when live references exist unless `force=true` (use `diviops_variables_scan_orphans` to find reference locations). Returns HTTP 403 for Divi's customizer-bound defaults (`gcid-primary-color`, `gcid-secondary-color`, `gcid-heading-color`, `gcid-body-color`, `gcid-link-color` — managed via WP Customizer) |
|
|
145
146
|
| `diviops_create_canvas` | Create a canvas page |
|
|
146
147
|
| `diviops_update_canvas` | Update canvas content |
|
|
147
148
|
| `diviops_delete_canvas` | Delete a canvas page |
|
package/dist/index.js
CHANGED
|
@@ -1316,16 +1316,21 @@ server.registerTool("diviops_create_variable", {
|
|
|
1316
1316
|
};
|
|
1317
1317
|
});
|
|
1318
1318
|
server.registerTool("diviops_delete_variable", {
|
|
1319
|
-
description: "Delete a design token variable by ID. Auto-detects storage from ID prefix (gcid-* = colors, gvid-* = numbers/strings/etc).",
|
|
1319
|
+
description: "Delete a design token variable by ID. Auto-detects storage from ID prefix (gcid-* = colors, gvid-* = numbers/strings/etc). Returns HTTP 409 when live references exist unless force=true — run diviops_variables_scan_orphans to see where the references live. Returns HTTP 403 for Divi's customizer-bound defaults (gcid-primary-color, gcid-secondary-color, gcid-heading-color, gcid-body-color, gcid-link-color); those are managed via WP Customizer theme options and can't be deleted via this tool.",
|
|
1320
1320
|
inputSchema: {
|
|
1321
1321
|
id: z
|
|
1322
1322
|
.string()
|
|
1323
1323
|
.describe('Variable ID to delete (e.g. "gcid-oa-accent" or "gvid-oa-size-xl")'),
|
|
1324
|
+
force: z
|
|
1325
|
+
.boolean()
|
|
1326
|
+
.optional()
|
|
1327
|
+
.default(false)
|
|
1328
|
+
.describe("Delete even if live references exist. Orphans will remain in page/preset content and render as invalid CSS on the frontend — run diviops_variables_scan_orphans afterwards to audit."),
|
|
1324
1329
|
},
|
|
1325
|
-
}, async ({ id }) => {
|
|
1330
|
+
}, async ({ id, force }) => {
|
|
1326
1331
|
const result = await wp.request("/variable/delete", {
|
|
1327
1332
|
method: "POST",
|
|
1328
|
-
body: { id },
|
|
1333
|
+
body: { id, force },
|
|
1329
1334
|
});
|
|
1330
1335
|
return {
|
|
1331
1336
|
content: [
|
|
@@ -1333,6 +1338,16 @@ server.registerTool("diviops_delete_variable", {
|
|
|
1333
1338
|
],
|
|
1334
1339
|
};
|
|
1335
1340
|
});
|
|
1341
|
+
server.registerTool("diviops_variables_scan_orphans", {
|
|
1342
|
+
description: "Scan pages, Theme Builder layouts (header/body/footer), Divi Library items, canvas pages, and the preset registry for gvid-/gcid- references that have no backing entry in the Variable Manager (orphans), plus variables defined but referenced nowhere (unused). Orphans render as invalid CSS on the frontend — the $variable()$ resolver falls through with no fallback. Use after a deletion with force=true, or periodically as a hygiene check. Symmetric to diviops_preset_scan_orphans.",
|
|
1343
|
+
}, async () => {
|
|
1344
|
+
const result = await wp.request("/variables-scan-orphans");
|
|
1345
|
+
return {
|
|
1346
|
+
content: [
|
|
1347
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
1348
|
+
],
|
|
1349
|
+
};
|
|
1350
|
+
});
|
|
1336
1351
|
// ── Start ────────────────────────────────────────────────────────────
|
|
1337
1352
|
async function main() {
|
|
1338
1353
|
// Version handshake — verify plugin compatibility before accepting tool calls.
|