bricks-mcp-server 0.7.0 → 0.9.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.
Files changed (2) hide show
  1. package/dist/index.js +50 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -33,8 +33,15 @@ if (subcommand === "doctor" || subcommand === "diagnose") {
33
33
  if (process.env.WP_URL) {
34
34
  console.error(`[bricks-mcp] target WP_URL=${process.env.WP_URL} WP_USER=${process.env.WP_USER ?? "?"}`);
35
35
  }
36
- const server = new Server({ name: "bricks-mcp-server", version: "0.7.0" }, { capabilities: { tools: {} } });
36
+ const server = new Server({ name: "bricks-mcp-server", version: "0.9.0" }, { capabilities: { tools: {} } });
37
37
  const tools = [
38
+ {
39
+ name: "bricks_start_here",
40
+ description: "CALL THIS FIRST, once per session, before any other bricks_* tool. Returns everything needed to work on this site safely: site identity, capabilities (dry-run state, ACF, query filters), the content model (post types + taxonomies + ACF fields), a design-system summary, existing templates, and the working rules that prevent the classic Bricks failure modes (write conflicts, wrong template fields, un-indexed filters, clobbered global classes).",
41
+ inputSchema: { type: "object", properties: {}, additionalProperties: false },
42
+ schema: z.object({}),
43
+ handler: async () => wpRequest("/start-here"),
44
+ },
38
45
  {
39
46
  name: "bricks_ping",
40
47
  description: "Verify the WordPress connection and report which site you're connected to (wp_url + site that answered), Bricks + WP version.",
@@ -140,6 +147,14 @@ const tools = [
140
147
  type: "object",
141
148
  description: "Taxonomy terms, e.g. { \"categoria_noticia\": [\"Difusión\"] }.",
142
149
  },
150
+ acf: {
151
+ type: "object",
152
+ description: "ACF fields by name, e.g. { \"anio\": \"2024\" }. Uses ACF update_field so {acf_*} dynamic tags render.",
153
+ },
154
+ meta: {
155
+ type: "object",
156
+ description: "Raw post meta by key (for non-ACF custom fields).",
157
+ },
143
158
  content: { type: "array", description: "Bricks elements array" },
144
159
  header: { type: "array" },
145
160
  footer: { type: "array" },
@@ -158,6 +173,8 @@ const tools = [
158
173
  date: z.string().optional(),
159
174
  featured_media: z.number().int().nonnegative().optional(),
160
175
  terms: z.record(z.any()).optional(),
176
+ acf: z.record(z.any()).optional(),
177
+ meta: z.record(z.any()).optional(),
161
178
  content: z.array(z.any()).optional(),
162
179
  header: z.array(z.any()).optional(),
163
180
  footer: z.array(z.any()).optional(),
@@ -201,6 +218,14 @@ const tools = [
201
218
  type: "object",
202
219
  description: "Taxonomy terms, e.g. { \"categoria_noticia\": [\"Difusión\"] }.",
203
220
  },
221
+ acf: {
222
+ type: "object",
223
+ description: "ACF fields by name, e.g. { \"anio\": \"2024\", \"autores\": \"Rojas, H.\" }. Uses ACF update_field so {acf_*} dynamic tags render.",
224
+ },
225
+ meta: {
226
+ type: "object",
227
+ description: "Raw post meta by key (for non-ACF custom fields).",
228
+ },
204
229
  content: { type: "array", description: "Bricks elements array (for Bricks-designed pages)" },
205
230
  settings: { type: "object" },
206
231
  },
@@ -217,6 +242,8 @@ const tools = [
217
242
  date: z.string().optional(),
218
243
  featured_media: z.number().int().positive().optional(),
219
244
  terms: z.record(z.any()).optional(),
245
+ acf: z.record(z.any()).optional(),
246
+ meta: z.record(z.any()).optional(),
220
247
  content: z.array(z.any()).optional(),
221
248
  settings: z.record(z.any()).optional(),
222
249
  }),
@@ -338,11 +365,33 @@ const tools = [
338
365
  handler: async () => wpRequest("/theme-styles"),
339
366
  },
340
367
  ];
368
+ // MCP tool annotations (readOnlyHint / destructiveHint / idempotentHint) so
369
+ // clients can calibrate approval prompts. "Destructive" here means the write
370
+ // overwrites or removes existing data (even though the plugin snapshots first);
371
+ // additive creates are non-destructive.
372
+ const TOOL_ANNOTATIONS = {
373
+ bricks_start_here: { readOnlyHint: true },
374
+ bricks_ping: { readOnlyHint: true },
375
+ bricks_get_schema: { readOnlyHint: true },
376
+ bricks_list_pages: { readOnlyHint: true },
377
+ bricks_get_page: { readOnlyHint: true },
378
+ bricks_list_templates: { readOnlyHint: true },
379
+ bricks_get_global_classes: { readOnlyHint: true },
380
+ bricks_get_theme_styles: { readOnlyHint: true },
381
+ bricks_list_media: { readOnlyHint: true },
382
+ bricks_create_page: { readOnlyHint: false, destructiveHint: false },
383
+ bricks_create_template: { readOnlyHint: false, destructiveHint: false },
384
+ bricks_reindex_query_filters: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },
385
+ bricks_update_page: { readOnlyHint: false, destructiveHint: true },
386
+ bricks_update_global_classes: { readOnlyHint: false, destructiveHint: true },
387
+ bricks_delete_page: { readOnlyHint: false, destructiveHint: true },
388
+ };
341
389
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
342
390
  tools: tools.map(({ name, description, inputSchema }) => ({
343
391
  name,
344
392
  description,
345
393
  inputSchema,
394
+ annotations: TOOL_ANNOTATIONS[name],
346
395
  })),
347
396
  }));
348
397
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bricks-mcp-server",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "Provider-agnostic MCP server that exposes Bricks Builder pages, templates, global classes and theme styles as tools. Works with any MCP-compatible client (Claude Code, Codex CLI, etc.).",
5
5
  "type": "module",
6
6
  "bin": {