bricks-builder-mcp 3.7.5 → 3.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/package.json +1 -1
  2. package/server.js +200 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "bricks-builder-mcp",
4
- "version": "3.7.5",
4
+ "version": "3.9.0",
5
5
  "description": "Serveur MCP pour piloter Bricks Builder (WordPress) depuis Claude — édition de pages, gestion d'éléments, réordonnancement des sections, vérification visuelle (verify_element), upload optimisé WebP. Communauté Discord : https://discord.gg/rX22zHRzH",
6
6
  "homepage": "https://discord.gg/rX22zHRzH",
7
7
  "main": "server.js",
package/server.js CHANGED
@@ -1102,6 +1102,126 @@ mcpServer.setRequestHandler(ListToolsRequestSchema, async () => {
1102
1102
  },
1103
1103
  },
1104
1104
 
1105
+ // ===== v3.9.0 — Custom Post Types =====
1106
+ {
1107
+ name: "list_post_types",
1108
+ description: "Liste tous les post types enregistrés sur le site (built-in pages/posts + CPT custom comme chantier, avis_client, produit). Retourne pour chaque : name, label, supports, taxonomies associées, hierarchical, public, showInRest. À appeler en premier pour découvrir ce qui est dispo.",
1109
+ inputSchema: { type: "object", properties: {} },
1110
+ },
1111
+ {
1112
+ name: "create_post",
1113
+ description: "Crée un post dans n'importe quel post_type (page, post, ou CPT custom). Supporte meta (ACF compatible — auto-route via update_field si ACF est chargé), taxonomies (slugs OU IDs, création à la volée des termes manquants), featuredImageId. Pour seeder un site avec CPT (galerie, blog, témoignages, etc.).",
1114
+ inputSchema: {
1115
+ type: "object",
1116
+ properties: {
1117
+ postType: { type: "string", description: "Slug du post_type (ex: 'chantier', 'avis_client', 'page')" },
1118
+ title: { type: "string", description: "Titre du post" },
1119
+ content: { type: "string", description: "Contenu HTML (optionnel)" },
1120
+ excerpt: { type: "string", description: "Extrait (optionnel)" },
1121
+ slug: { type: "string", description: "Slug URL (auto-généré depuis title si omis)" },
1122
+ status: { type: "string", enum: ["publish", "draft", "private", "pending", "future"], description: "Statut (défaut: publish)" },
1123
+ featuredImageId: { type: "number", description: "ID de l'image WP (depuis upload_media/upload_local_file)" },
1124
+ meta: { type: "object", description: "Champs personnalisés (ACF compatible). Format {field_name: value}. Pour gallery: array d'IDs. Pour repeater: array d'objects. Pour relationship: array d'IDs." },
1125
+ taxonomies: { type: "object", description: "Format {taxonomy_slug: [term_slug_or_id, ...]}. Crée le terme à la volée s'il n'existe pas." },
1126
+ date: { type: "string", description: "Date publication ISO 8601 (défaut: maintenant)" },
1127
+ author: { type: "number", description: "ID de l'auteur" },
1128
+ },
1129
+ required: ["postType", "title"],
1130
+ },
1131
+ },
1132
+ {
1133
+ name: "update_post",
1134
+ description: "Modifie un post existant (CPT ou natif). Pour modifier juste les ACF, passe uniquement 'meta'. Pour retirer la featured image, passe featuredImageId: 0.",
1135
+ inputSchema: {
1136
+ type: "object",
1137
+ properties: {
1138
+ postId: { type: "number", description: "ID du post à modifier" },
1139
+ title: { type: "string" },
1140
+ content: { type: "string" },
1141
+ excerpt: { type: "string" },
1142
+ slug: { type: "string" },
1143
+ status: { type: "string", enum: ["publish", "draft", "private", "pending"] },
1144
+ featuredImageId: { type: "number", description: "0 pour retirer" },
1145
+ meta: { type: "object" },
1146
+ taxonomies: { type: "object" },
1147
+ date: { type: "string" },
1148
+ },
1149
+ required: ["postId"],
1150
+ },
1151
+ },
1152
+ {
1153
+ name: "delete_post",
1154
+ description: "Supprime un post. Par défaut → corbeille. force: true → suppression définitive.",
1155
+ inputSchema: {
1156
+ type: "object",
1157
+ properties: {
1158
+ postId: { type: "number" },
1159
+ force: { type: "boolean", description: "Défaut false (corbeille)" },
1160
+ },
1161
+ required: ["postId"],
1162
+ },
1163
+ },
1164
+ {
1165
+ name: "get_post",
1166
+ description: "Récupère un post avec tous ses champs (incluant meta brute + champs ACF formatés + taxonomies + featured image URL).",
1167
+ inputSchema: {
1168
+ type: "object",
1169
+ properties: {
1170
+ postId: { type: "number" },
1171
+ },
1172
+ required: ["postId"],
1173
+ },
1174
+ },
1175
+ {
1176
+ name: "list_posts",
1177
+ description: "Liste les posts d'un type donné avec filtres taxonomie/meta/search/pagination/order. Pour les Query Loops Bricks et inventaires.",
1178
+ inputSchema: {
1179
+ type: "object",
1180
+ properties: {
1181
+ postType: { type: "string" },
1182
+ perPage: { type: "number", description: "Défaut 20, max 100" },
1183
+ page: { type: "number", description: "Défaut 1" },
1184
+ search: { type: "string" },
1185
+ status: { type: "string", description: "Défaut 'publish'" },
1186
+ taxonomyFilter: { type: "object", description: "Format {taxonomy_slug: 'term-slug'}" },
1187
+ metaQuery: { type: "array", description: "WP_Query meta_query compatible" },
1188
+ orderBy: { type: "string", enum: ["date", "title", "menu_order", "meta_value"], description: "Défaut 'date'" },
1189
+ order: { type: "string", enum: ["ASC", "DESC"], description: "Défaut 'DESC'" },
1190
+ },
1191
+ required: ["postType"],
1192
+ },
1193
+ },
1194
+ {
1195
+ name: "create_taxonomy_term",
1196
+ description: "Crée un terme de taxonomie (ex: catégorie 'Salle de bain' dans 'categorie_chantier'). Idempotent : si terme existe déjà avec ce slug/nom, retourne son ID au lieu d'erreurer.",
1197
+ inputSchema: {
1198
+ type: "object",
1199
+ properties: {
1200
+ taxonomy: { type: "string", description: "Slug de la taxonomy (ex: 'categorie_chantier')" },
1201
+ name: { type: "string", description: "Nom du terme (ex: 'Salle de bain')" },
1202
+ slug: { type: "string", description: "Slug URL (auto-généré si omis)" },
1203
+ description: { type: "string" },
1204
+ parentId: { type: "number", description: "ID du terme parent (pour taxos hiérarchiques)" },
1205
+ },
1206
+ required: ["taxonomy", "name"],
1207
+ },
1208
+ },
1209
+
1210
+ // ===== v3.7.0 — SKILL VERSIONING =====
1211
+ {
1212
+ name: "check_skill_version",
1213
+ description: "⭐ À APPELER AU DÉBUT DE CHAQUE CONVERSATION BRICKS. Compare ta version locale du skill (lue dans le frontmatter de SKILL.md, champ `version`) avec la version actuelle côté serveur. Si décalage, prévenir l'utilisateur de re-télécharger le .plugin depuis WP admin → Bricks MCP.",
1214
+ inputSchema: {
1215
+ type: "object",
1216
+ properties: {
1217
+ localVersion: {
1218
+ type: "string",
1219
+ description: "Version skill locale (ex: '1.0.0'), lue depuis le frontmatter du SKILL.md chargé dans ton contexte",
1220
+ },
1221
+ },
1222
+ },
1223
+ },
1224
+
1105
1225
  // ===== v3.6.0 — UPLOAD MEDIA BATCH =====
1106
1226
  {
1107
1227
  name: "upload_media_batch",
@@ -1825,6 +1945,86 @@ mcpServer.setRequestHandler(CallToolRequestSchema, async (request) => {
1825
1945
  });
1826
1946
  break;
1827
1947
 
1948
+ // ===== v3.7.0 — SKILL VERSIONING =====
1949
+ case "check_skill_version": {
1950
+ const qs = args.localVersion ? `?localVersion=${encodeURIComponent(args.localVersion)}` : "";
1951
+ result = await callWordPressAPI("/skill-version" + qs, "GET");
1952
+ break;
1953
+ }
1954
+
1955
+ // ===== v3.9.0 — CUSTOM POST TYPES =====
1956
+ case "list_post_types":
1957
+ result = await callWordPressAPI("/list-post-types", "GET");
1958
+ break;
1959
+
1960
+ case "create_post":
1961
+ result = await callWordPressAPI("/create-post", "POST", {
1962
+ postType: args.postType,
1963
+ title: args.title,
1964
+ content: args.content,
1965
+ excerpt: args.excerpt,
1966
+ slug: args.slug,
1967
+ status: args.status,
1968
+ featuredImageId: args.featuredImageId,
1969
+ meta: args.meta,
1970
+ taxonomies: args.taxonomies,
1971
+ date: args.date,
1972
+ author: args.author,
1973
+ });
1974
+ break;
1975
+
1976
+ case "update_post":
1977
+ result = await callWordPressAPI("/update-post", "POST", {
1978
+ postId: args.postId,
1979
+ title: args.title,
1980
+ content: args.content,
1981
+ excerpt: args.excerpt,
1982
+ slug: args.slug,
1983
+ status: args.status,
1984
+ featuredImageId: args.featuredImageId,
1985
+ meta: args.meta,
1986
+ taxonomies: args.taxonomies,
1987
+ date: args.date,
1988
+ });
1989
+ break;
1990
+
1991
+ case "delete_post":
1992
+ result = await callWordPressAPI("/delete-post", "POST", {
1993
+ postId: args.postId,
1994
+ force: args.force,
1995
+ });
1996
+ break;
1997
+
1998
+ case "get_post":
1999
+ result = await callWordPressAPI("/get-post", "POST", {
2000
+ postId: args.postId,
2001
+ });
2002
+ break;
2003
+
2004
+ case "list_posts":
2005
+ result = await callWordPressAPI("/list-posts", "POST", {
2006
+ postType: args.postType,
2007
+ perPage: args.perPage,
2008
+ page: args.page,
2009
+ search: args.search,
2010
+ status: args.status,
2011
+ taxonomyFilter: args.taxonomyFilter,
2012
+ metaQuery: args.metaQuery,
2013
+ orderBy: args.orderBy,
2014
+ order: args.order,
2015
+ });
2016
+ break;
2017
+
2018
+ case "create_taxonomy_term":
2019
+ result = await callWordPressAPI("/create-taxonomy-term", "POST", {
2020
+ taxonomy: args.taxonomy,
2021
+ name: args.name,
2022
+ slug: args.slug,
2023
+ description: args.description,
2024
+ parentId: args.parentId,
2025
+ });
2026
+ break;
2027
+
1828
2028
  // ===== v3.7.0 — UPLOAD FROM LOCAL FILESYSTEM =====
1829
2029
  case "upload_local_file": {
1830
2030
  try {