@diviops/mcp-server 1.3.0 → 1.4.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 CHANGED
@@ -108,7 +108,7 @@ The server connects via standard WordPress REST API and works with any environme
108
108
  | `diviops_page_get_layout` | Get parsed block tree (layout structure) |
109
109
  | `diviops_section_get` | Get a single section's markup by admin label |
110
110
  | `diviops_schema_list_modules` | List all available Divi modules |
111
- | `diviops_schema_get_module` | Get attribute schema for a module (optimized by default, `raw: true` for full) |
111
+ | `diviops_schema_get_module` | Get attribute schema for a module. Default `mode: "single"` returns one module's schema (optimized; `raw: true` for full). `mode: "dump_all"` snapshots every Divi module in one call along with a `schema_version` hash over `*PresetAttrsMap.php` and a `divi_version` field — build-time entry point for the skill regen pipeline. |
112
112
  | `diviops_schema_get_settings` | Get Divi site settings and theme options |
113
113
  | `diviops_global_color_list` | Get global color palette |
114
114
  | `diviops_global_font_list` | Get global font definitions |
package/dist/index.js CHANGED
@@ -198,18 +198,53 @@ registerPluginTool("diviops_schema_list_modules", {
198
198
  };
199
199
  });
200
200
  registerPluginTool("diviops_schema_get_module", {
201
- description: "Get the attribute schema for a Divi module. Returns optimized schema by default (~70% smaller) with content-relevant fields only. Use raw: true for the full schema including CSS selectors and VB metadata.",
201
+ description: "Get the attribute schema for a Divi module. Default mode 'single' returns one module's schema (optimized, ~70% smaller; pass raw: true for full). Mode 'dump_all' snapshots every Divi module in one call and includes a `schema_version` hash over the canonical *PresetAttrsMap.php files build-time entry point for the skill regen pipeline; ignores `module_name` and `raw`.",
202
202
  inputSchema: {
203
+ mode: z
204
+ .enum(["single", "dump_all"])
205
+ .optional()
206
+ .default("single")
207
+ .describe("'single' (default): return one module's schema. 'dump_all': return every module keyed by name plus schema_version + divi_version."),
203
208
  module_name: z
204
209
  .string()
205
- .describe('Module name, e.g. "text", "image", "accordion", or full "divi/text"'),
210
+ .optional()
211
+ .describe('Module name, e.g. "text", "image", "accordion", or full "divi/text". Required when mode="single"; ignored when mode="dump_all".'),
206
212
  raw: z
207
213
  .boolean()
208
214
  .optional()
209
215
  .default(false)
210
- .describe("Return full schema including CSS selectors and VB metadata"),
216
+ .describe("Return full schema including CSS selectors and VB metadata. Applies to mode='single' only."),
211
217
  },
212
- }, async ({ module_name, raw }) => {
218
+ }, async ({ mode, module_name, raw }) => {
219
+ if (mode === "dump_all") {
220
+ // Capability gate for the dump-all surface: handled here (rather
221
+ // than the wrapper's auto-derived `schema_get_module` key) so older
222
+ // plugins without /schema/module/dump-all surface a clean upgrade
223
+ // hint instead of a 404 from wp.request.
224
+ if (handshakeState.kind === "ok" &&
225
+ !handshakeState.capabilities["schema_get_module_dump_all"]) {
226
+ const err = new MissingCapabilityError("schema_get_module_dump_all", handshakeState.pluginVersion);
227
+ return {
228
+ content: [{ type: "text", text: err.message }],
229
+ isError: true,
230
+ };
231
+ }
232
+ const result = await wp.request("/schema/module/dump-all");
233
+ return {
234
+ content: [{ type: "text", text: JSON.stringify(result) }],
235
+ };
236
+ }
237
+ if (!module_name) {
238
+ return {
239
+ content: [
240
+ {
241
+ type: "text",
242
+ text: "module_name is required when mode='single'",
243
+ },
244
+ ],
245
+ isError: true,
246
+ };
247
+ }
213
248
  const result = await wp.request(`/schema/module/${encodeURIComponent(module_name)}`);
214
249
  const output = raw ? result : optimizeSchema(result);
215
250
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diviops/mcp-server",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -16,7 +16,8 @@
16
16
  "build": "tsc",
17
17
  "start": "node dist/index.js",
18
18
  "dev": "tsc --watch",
19
- "prepublishOnly": "npm run build"
19
+ "prepublishOnly": "npm run build",
20
+ "regen:skill": "node scripts/regen-module-formats.mjs"
20
21
  },
21
22
  "keywords": [
22
23
  "mcp",