@diviops/mcp-server 1.0.0 → 1.1.0
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 -2
- package/dist/compatibility.d.ts +1 -1
- package/dist/compatibility.js +1 -1
- package/dist/index.js +63 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -96,7 +96,7 @@ The server connects via standard WordPress REST API and works with any environme
|
|
|
96
96
|
|
|
97
97
|
> **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.
|
|
98
98
|
|
|
99
|
-
## Available Tools (
|
|
99
|
+
## Available Tools (65)
|
|
100
100
|
|
|
101
101
|
### Read (30)
|
|
102
102
|
| Tool | Description |
|
|
@@ -132,11 +132,13 @@ The server connects via standard WordPress REST API and works with any environme
|
|
|
132
132
|
| `diviops_scf_field_group_list` | List all SCF/ACF field groups (post_name = ACF key, post_title, post_status, post_modified). Queries the `acf-field-group` post type via `wp post list` (works on SCF 6.8.4+ and older ACF) |
|
|
133
133
|
| `diviops_scf_field_group_get` | Fetch a single SCF/ACF field-group post by ACF key (`group_abc123` → post_name) or numeric WP post ID. For the parsed/structured field tree, use `diviops_scf_export --field-groups=<key> --stdout` |
|
|
134
134
|
|
|
135
|
-
### Write (
|
|
135
|
+
### Write (33)
|
|
136
136
|
| Tool | Description |
|
|
137
137
|
|------|-------------|
|
|
138
138
|
| `diviops_page_create` | Create a new page with optional Divi content |
|
|
139
139
|
| `diviops_page_update_content` | Full page content rewrite |
|
|
140
|
+
| `diviops_page_trash` | Trash (default) or permanently delete (`force=true`) a page. Idempotent on already-trashed posts. Supports `dry_run` |
|
|
141
|
+
| `diviops_page_update_status` | Update post_status (publish/draft/private/pending/future). `future` requires `date_gmt` (ISO 8601 UTC); `publish` clears stale future dates so re-publishing takes effect immediately. Supports `dry_run` |
|
|
140
142
|
| `diviops_section_append` | Append a section to existing page (start or end) |
|
|
141
143
|
| `diviops_section_replace` | Replace a section by admin label |
|
|
142
144
|
| `diviops_section_remove` | Remove a section by admin label |
|
package/dist/compatibility.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Version compatibility between MCP server and WP plugin.
|
|
3
3
|
*/
|
|
4
4
|
/** Minimum WP plugin version this server requires. */
|
|
5
|
-
export declare const MIN_PLUGIN_VERSION = "1.
|
|
5
|
+
export declare const MIN_PLUGIN_VERSION = "1.1.0";
|
|
6
6
|
/**
|
|
7
7
|
* Compare two semver-like version strings (supports pre-release tags).
|
|
8
8
|
*
|
package/dist/compatibility.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Version compatibility between MCP server and WP plugin.
|
|
3
3
|
*/
|
|
4
4
|
/** Minimum WP plugin version this server requires. */
|
|
5
|
-
export const MIN_PLUGIN_VERSION = '1.
|
|
5
|
+
export const MIN_PLUGIN_VERSION = '1.1.0';
|
|
6
6
|
/**
|
|
7
7
|
* Compare two semver-like version strings (supports pre-release tags).
|
|
8
8
|
*
|
package/dist/index.js
CHANGED
|
@@ -744,6 +744,69 @@ server.registerTool("diviops_page_create", {
|
|
|
744
744
|
],
|
|
745
745
|
};
|
|
746
746
|
});
|
|
747
|
+
server.registerTool("diviops_page_trash", {
|
|
748
|
+
description: "Trash or permanently delete a page/post. Defaults to trash (reversible via WP Admin → Trash). Pass force=true to permanently delete (wp_delete_post — irreversible). Idempotent: trashing an already-trashed post is a no-op. Pass dry_run=true to preview without mutating. Replaces wp-cli `post delete --force=0|1` routing for AI-agent callers (typed input, deterministic envelope).",
|
|
749
|
+
inputSchema: {
|
|
750
|
+
post_id: z.number().int().describe("WordPress post/page ID"),
|
|
751
|
+
force: z
|
|
752
|
+
.boolean()
|
|
753
|
+
.optional()
|
|
754
|
+
.default(false)
|
|
755
|
+
.describe("When true, permanently delete (skips trash). Default false moves to trash."),
|
|
756
|
+
dry_run: z
|
|
757
|
+
.boolean()
|
|
758
|
+
.optional()
|
|
759
|
+
.default(false)
|
|
760
|
+
.describe("When true, return the change plan without mutating state."),
|
|
761
|
+
},
|
|
762
|
+
}, async ({ post_id, force, dry_run }) => {
|
|
763
|
+
const result = await wp.request(`/page/trash/${post_id}`, {
|
|
764
|
+
method: "POST",
|
|
765
|
+
body: {
|
|
766
|
+
force: force ?? false,
|
|
767
|
+
dry_run: dry_run ?? false,
|
|
768
|
+
},
|
|
769
|
+
});
|
|
770
|
+
return {
|
|
771
|
+
content: [
|
|
772
|
+
{ type: "text", text: JSON.stringify(result) },
|
|
773
|
+
],
|
|
774
|
+
};
|
|
775
|
+
});
|
|
776
|
+
server.registerTool("diviops_page_update_status", {
|
|
777
|
+
description: "Update a page's post_status. Valid statuses: publish, draft, private, pending, future. status='future' requires date_gmt (ISO 8601 UTC, must be in the future) — server writes both post_date_gmt and the site-tz post_date so WP's scheduler picks it up. status='publish' on a previously-scheduled post clears the future date so it publishes immediately. Idempotent: same-status update is a no-op. Pass dry_run=true to preview. Replaces wp-cli `post update --post_status=...` routing.",
|
|
778
|
+
inputSchema: {
|
|
779
|
+
post_id: z.number().int().describe("WordPress post/page ID"),
|
|
780
|
+
status: z
|
|
781
|
+
.enum(["publish", "draft", "private", "pending", "future"])
|
|
782
|
+
.describe("Target post status"),
|
|
783
|
+
date_gmt: z
|
|
784
|
+
.string()
|
|
785
|
+
.optional()
|
|
786
|
+
.describe("Required when status='future'. ISO 8601 UTC datetime (e.g. '2026-06-01T09:00:00Z'). Must be in the future."),
|
|
787
|
+
dry_run: z
|
|
788
|
+
.boolean()
|
|
789
|
+
.optional()
|
|
790
|
+
.default(false)
|
|
791
|
+
.describe("When true, return the change plan without mutating state."),
|
|
792
|
+
},
|
|
793
|
+
}, async ({ post_id, status, date_gmt, dry_run }) => {
|
|
794
|
+
const body = {
|
|
795
|
+
status,
|
|
796
|
+
dry_run: dry_run ?? false,
|
|
797
|
+
};
|
|
798
|
+
if (date_gmt)
|
|
799
|
+
body.date_gmt = date_gmt;
|
|
800
|
+
const result = await wp.request(`/page/update-status/${post_id}`, {
|
|
801
|
+
method: "POST",
|
|
802
|
+
body,
|
|
803
|
+
});
|
|
804
|
+
return {
|
|
805
|
+
content: [
|
|
806
|
+
{ type: "text", text: JSON.stringify(result) },
|
|
807
|
+
],
|
|
808
|
+
};
|
|
809
|
+
});
|
|
747
810
|
// ── Preset Tools ────────────────────────────────────────────────────
|
|
748
811
|
server.registerTool("diviops_preset_audit", {
|
|
749
812
|
description: "Audit all Divi presets (module + group). Each entry reports `block_ref_count` (page-content refs via modulePreset / groupPreset block markup), `group_ref_count` (in-registry chain refs from other presets — module presets via top-level `groupPresets.<slot>.presetId`, group presets via `attrs.groupPreset.<slot>.presetId`), and `referenced` (true if either > 0). Group presets that are chain-referenced also expose `referenced_by_presets` (UUIDs of the presets that wire them in — typically module presets, but type-agnostic). Use this before deleting — orphan-cleanup based only on page refs would silently wipe load-bearing chain-wired group presets (font, border, box-shadow, spacing, button). Also reports `orphan_default_pointers`: per-bucket `default` pointers that reference a UUID no longer present in `items[]` (caused by past unsafe deletes). Render-safe but blocks Divi's lazy recreate-on-VB-use path; clear via diviops_preset_set_default with unset=true on the affected module/group.",
|