@diviops/mcp-server 0.2.5 → 0.2.6

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
@@ -91,7 +91,7 @@ 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 (47)
94
+ ## Available Tools (48)
95
95
 
96
96
  ### Read (26)
97
97
  | Tool | Description |
@@ -147,10 +147,11 @@ The server connects via standard WordPress REST API and works with any environme
147
147
  | `diviops_update_canvas` | Update canvas content |
148
148
  | `diviops_delete_canvas` | Delete a canvas page |
149
149
 
150
- ### Utility (1)
150
+ ### Utility (2)
151
151
  | Tool | Description |
152
152
  |------|-------------|
153
153
  | `diviops_wp_cli` | Run WP-CLI commands (allowlisted, requires `WP_PATH` or `WP_CLI_CMD`) |
154
+ | `diviops_flush_static_cache` | Flush Divi's compiled CSS cache under `wp-content/et-cache/`. `wp cache flush` does NOT touch these files — the frontend can keep serving stale CSS after mutations. Delegates to Divi's native clearer (`ET_Core_PageResource::remove_static_resources`) when available — also clears Theme Builder / archive / taxonomy / home / notfound CSS, object cache, module features cache, post features cache, dynamic assets cache, Google Fonts cache, post meta caches. Falls back to a filesystem walk of numeric-named subdirs when Divi is inactive. Response includes `backend: "divi_native"` or `"fs_fallback"`. Exactly one selector required: `post_id`, `all`, or `after` (unix ts) — no default to `all` |
154
155
 
155
156
  ## WP-CLI Security
156
157
 
package/dist/index.js CHANGED
@@ -1348,6 +1348,45 @@ server.registerTool("diviops_variables_scan_orphans", {
1348
1348
  ],
1349
1349
  };
1350
1350
  });
1351
+ server.registerTool("diviops_flush_static_cache", {
1352
+ description: "Flush Divi's compiled static CSS cache under wp-content/et-cache/. wp cache flush does NOT touch these files — the frontend can keep serving stale CSS after a preset/variable/module mutation until the cache is cleared. Delegates to Divi's native ET_Core_PageResource::remove_static_resources when available (response backend: \"divi_native\"), which additionally clears Theme Builder CSS scattered across other post dirs, archive/taxonomy/home/notfound CSS, the object cache, module features cache, post features cache, Google Fonts cache, dynamic assets cache, and post meta caches. Falls back to a targeted filesystem walk of numeric-named et-cache subdirs when the Divi class is absent (backend: \"fs_fallback\"). Provide exactly one selector — no site-wide default to prevent accidental full flush. Idempotent: missing cache root returns 200 with empty list.",
1353
+ inputSchema: {
1354
+ post_id: z
1355
+ .number()
1356
+ .int()
1357
+ .positive()
1358
+ .optional()
1359
+ .describe("Flush cache for one post. Native backend also clears matching Theme Builder CSS in other post dirs; fs_fallback only clears wp-content/et-cache/{post_id}/."),
1360
+ all: z
1361
+ .boolean()
1362
+ .optional()
1363
+ .default(false)
1364
+ .describe("Flush every cached file. Native backend clears archive/taxonomy/home/notfound CSS + multi-layer WP caches; fs_fallback only clears numeric-named subdirs (siblings like .cache-cleared-at, global/, en_US/, notfound/, *.data are preserved in either mode)."),
1365
+ after: z
1366
+ .number()
1367
+ .int()
1368
+ .positive()
1369
+ .optional()
1370
+ .describe("Unix timestamp — iterate numeric subdirs with mtime greater than this value, flushing each. Useful for flushing entries touched since a known deployment or mutation batch. Native clearer runs once per matched post."),
1371
+ },
1372
+ }, async ({ post_id, all, after }) => {
1373
+ const body = {};
1374
+ if (post_id !== undefined)
1375
+ body.post_id = post_id;
1376
+ if (all)
1377
+ body.all = true;
1378
+ if (after !== undefined)
1379
+ body.after = after;
1380
+ const result = await wp.request("/flush-static-cache", {
1381
+ method: "POST",
1382
+ body,
1383
+ });
1384
+ return {
1385
+ content: [
1386
+ { type: "text", text: JSON.stringify(result, null, 2) },
1387
+ ],
1388
+ };
1389
+ });
1351
1390
  // ── Start ────────────────────────────────────────────────────────────
1352
1391
  async function main() {
1353
1392
  // Version handshake — verify plugin compatibility before accepting tool calls.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diviops/mcp-server",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",