webcake-storefront-mcp 1.31.3 → 1.31.5

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
@@ -1,4 +1,8 @@
1
- # 🏪 WebCake Storefront MCP
1
+ <p align="center">
2
+ <img src="./assets/logo.svg" alt="WebCake Storefront MCP" width="96" height="96">
3
+ </p>
4
+
5
+ <h1 align="center">WebCake Storefront MCP</h1>
2
6
 
3
7
  **English** · [Tiếng Việt](./README.vi.md)
4
8
 
@@ -78,7 +82,7 @@ An MCP (Model Context Protocol) server that teaches AI agents the **WebCake/Stor
78
82
  page source; `build_page` creates the page and saves it, and `publish_site` makes the whole site live.
79
83
 
80
84
  Beyond page authoring, it exposes your real store: pages & custom code, products, orders, collections,
81
- blog articles, promotions, combos, themes, customers, and automation — **~101 tools** in total.
85
+ blog articles, promotions, combos, themes, customers, and automation — **~280 tools** in total.
82
86
 
83
87
  | Method | Best for | Auth |
84
88
  |--------|----------|------|
@@ -166,7 +170,7 @@ in chat via `update_auth` and `switch_site` — saved to a local config file at
166
170
 
167
171
  ## 🧰 The tools at a glance
168
172
 
169
- ~101 tools. The headline group **builds pages**; the rest read and edit your live store.
173
+ ~280 tools. The headline group **builds pages**; the rest read and edit your live store.
170
174
 
171
175
  | Group | Tools | Needs |
172
176
  |-------|-------|-------|
package/README.vi.md CHANGED
@@ -1,4 +1,8 @@
1
- # 🏪 WebCake Storefront MCP
1
+ <p align="center">
2
+ <img src="./assets/logo.svg" alt="WebCake Storefront MCP" width="96" height="96">
3
+ </p>
4
+
5
+ <h1 align="center">WebCake Storefront MCP</h1>
2
6
 
3
7
  [English](./README.md) · **Tiếng Việt**
4
8
 
@@ -78,7 +82,7 @@ WebCake/StoreCake (BuilderX)** và kết nối tới backend. AI tạo nguồn t
78
82
  `build_page` tạo + lưu trang, `publish_site` đưa cả site lên live.
79
83
 
80
84
  Ngoài dựng trang, nó mở ra cả store thật: trang & custom code, sản phẩm, đơn hàng, collection,
81
- bài blog, khuyến mãi, combo, theme, khách hàng, automation — **~101 tool** tổng cộng.
85
+ bài blog, khuyến mãi, combo, theme, khách hàng, automation — **~280 tool** tổng cộng.
82
86
 
83
87
  | Cách | Hợp cho | Auth |
84
88
  |--------|----------|------|
@@ -165,7 +169,7 @@ trong chat bằng `update_auth` và `switch_site` — lưu vào file cấu hình
165
169
 
166
170
  ## 🧰 Bộ công cụ tổng quan
167
171
 
168
- ~101 tool. Nhóm chủ lực **dựng trang**; phần còn lại đọc và sửa store thật của bạn.
172
+ ~280 tool. Nhóm chủ lực **dựng trang**; phần còn lại đọc và sửa store thật của bạn.
169
173
 
170
174
  | Nhóm | Tool | Cần |
171
175
  |-------|-------|-------|
@@ -1,4 +1,18 @@
1
1
  [
2
+ {
3
+ "v": "1.31.5",
4
+ "d": "26/06/2026",
5
+ "type": "Added",
6
+ "en": "Column definitions accepted by create_collection and update_collection_columns now support five new optional fields: note (help text for the…",
7
+ "vi": "Định nghĩa cột được chấp nhận bởi create_collection và update_collection_columns nay hỗ trợ thêm năm trường tùy chọn mới: note (ghi chú/mô tả cho…"
8
+ },
9
+ {
10
+ "v": "1.31.4",
11
+ "d": "26/06/2026",
12
+ "type": "Added",
13
+ "en": "The guide returned by get_http_function and get_site_custom_code now includes a verified end-to-end \"Custom data TABLES (collections)\" section…",
14
+ "vi": "Hướng dẫn trả về bởi get_http_function và get_site_custom_code nay bổ sung phần \"Custom data TABLES (collections)\" đã được xác minh thực tế, ghi lại…"
15
+ },
2
16
  {
3
17
  "v": "1.31.3",
4
18
  "d": "26/06/2026",
@@ -26,19 +40,5 @@
26
40
  "type": "Added",
27
41
  "en": "New create_collection tool creates a custom data table by accepting a name and a schema array of field definitions (with types such as string,…",
28
42
  "vi": "Tool mới create_collection tạo bảng dữ liệu tùy chỉnh bằng cách nhận tham số name và mảng schema chứa định nghĩa các trường (với các kiểu dữ liệu…"
29
- },
30
- {
31
- "v": "1.30.0",
32
- "d": "26/06/2026",
33
- "type": "Added",
34
- "en": "New list_customers tool browses or searches the site's customer list; accepts page, limit, and term (name/phone/email keyword) and returns a compact…",
35
- "vi": "Tool mới list_customers duyệt hoặc tìm kiếm danh sách khách hàng của site; nhận các tham số page, limit và term (từ khóa tên/điện thoại/email) và…"
36
- },
37
- {
38
- "v": "1.29.0",
39
- "d": "26/06/2026",
40
- "type": "Added",
41
- "en": "scaffold_global_sections now accepts a logo parameter (hosted image URL) that renders an image element in the header instead of the brand-name text…",
42
- "vi": "scaffold_global_sections nay nhận thêm tham số logo (URL hình ảnh được host) để hiển thị phần tử image trong header thay vì node text tên thương hiệu."
43
43
  }
44
44
  ]
package/dist/guides.js CHANGED
@@ -101,6 +101,21 @@ await Members.updateOne({ id: created.id }, { tien_con_lai: 100000 });
101
101
  const userId = request.customer?.id ?? ""; if (!userId) return { mess: "NO_ACCOUNT_CALL" };
102
102
  try { /* … */ return { mess: "OK", ...data }; } catch (err) { console.error(err?.message || err); return { mess: "SYSTEM_ERROR" }; }
103
103
 
104
+ ## Custom data TABLES (collections) — end-to-end (VERIFIED flow)
105
+ A "collection" is a custom DB table. To stand one up and use it from a function:
106
+ 1. Create the table + columns with the MCP tools: create_collection({ name, columns:[{name,type},…] })
107
+ then update_collection_columns to change them. (Types: string|text|integer|float|boolean|
108
+ naive_datetime|binary_id|map|array.) The table always has id/inserted_at/updated_at/creator_id.
109
+ 2. READ rows directly with the MCP tool query_collection_records({ table_name, where, order_by }).
110
+ 3. WRITE rows from an HTTP function via webcake-data — db.model(table) gives full CRUD on it:
111
+ const T = db.model("my_table");
112
+ const row = await T.create({ email: "a@b.com" }); // insert
113
+ await T.updateOne({ id: row.id }, { email: "c@d.com" }); // update
114
+ await T.deleteMany({ email: "a@b.com" }); // delete
115
+ const rows = await T.find({ … }).select([…]).limit(50); // query
116
+ (There is NO direct dashboard record-INSERT API — record writes MUST go through a function.
117
+ Deploy the function with the update_http_function MCP tool, then call it with run_function.)
118
+
104
119
  ## Built-in @webcake/* modules (first arg is always request; they auth via global.token — these run
105
120
  ## INSIDE the function sandbox, so they reach the /cms_function endpoints the dashboard JWT can't)
106
121
  Thin wrappers over the backend's /cms_function/{site_id}/... endpoints. Pass request so
package/dist/server.js CHANGED
@@ -1,5 +1,16 @@
1
+ import { readFileSync } from "node:fs";
1
2
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
3
  import { installTools, buildToolGroupIndex } from "./tools/registry.js";
4
+ /** Server version, read from package.json so it always tracks the published release. */
5
+ export const SERVER_VERSION = (() => {
6
+ try {
7
+ const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
8
+ return typeof pkg.version === "string" ? pkg.version : "0.0.0";
9
+ }
10
+ catch {
11
+ return "0.0.0";
12
+ }
13
+ })();
3
14
  const INSTRUCTIONS = `You are an AI assistant connected to the WebCake/StoreCake storefront platform via MCP tools.
4
15
 
5
16
  IMPORTANT: When the user asks ANY question about their website, store, products, orders, pages, or code — you MUST use the available tools to look up real data before answering. Never guess.
@@ -25,7 +36,7 @@ function makeResult(data) {
25
36
  /** Build a fully-wired MCP server bound to the given API client. */
26
37
  export function createServer(api, opts = {}) {
27
38
  const toolsSpec = opts.tools ?? process.env.WEBCAKE_TOOLS;
28
- const server = new McpServer({ name: "webcake-storefront", version: "1.0.0" }, { instructions: `${INSTRUCTIONS}\n\n${buildToolGroupIndex(toolsSpec)}` });
39
+ const server = new McpServer({ name: "webcake-storefront", version: SERVER_VERSION }, { instructions: `${INSTRUCTIONS}\n\n${buildToolGroupIndex(toolsSpec)}` });
29
40
  const handle = async (fn) => {
30
41
  try {
31
42
  return makeResult(await fn());
@@ -40,18 +40,39 @@ export function registerCollectionTools(server, api, handle) {
40
40
  return api.queryCollectionRecords(table_name, query);
41
41
  }));
42
42
  // ── Table-management tools (VERIFIED live: create table, edit columns, delete table). ──
43
- // Field type string | text | integer | float | boolean | naive_datetime | binary_id | map | array.
43
+ // Custom-column types (matches the builderx_spa column editor; backend accepts these + more):
44
+ // text | rich_text | url | integer | float | decimal | boolean | reference | color |
45
+ // image | media_gallery | video | audio | document | date | naive_datetime | time |
46
+ // address | object | array.
47
+ // (string/binary_id/map are backend aliases of text/reference/object; binary_id & naive_datetime
48
+ // are reserved for SYSTEM columns like id/inserted_at — don't pick them for custom fields.)
44
49
  const COLUMN = z.object({
45
50
  name: z.string().describe("Column name (snake_case)."),
46
- type: z.string().describe("string | text | integer | float | boolean | naive_datetime | binary_id | map | array"),
51
+ type: z
52
+ .string()
53
+ .describe("text | rich_text | url | integer | float | decimal | boolean | reference | color | image | media_gallery | video | audio | document | date | naive_datetime | time | address | object | array"),
47
54
  display_name: z.string().optional(),
48
55
  is_required: z.boolean().optional(),
49
56
  is_unique: z.boolean().optional(),
57
+ note: z.string().optional().describe("Help text / description for the column."),
58
+ default: z.any().optional().describe("Default value for the column."),
59
+ reference: z
60
+ .string()
61
+ .optional()
62
+ .describe("For type 'reference' only: the referenced table_name, or a system entity (customer | product | article | blog | variation)."),
63
+ reference_type: z
64
+ .enum(["system", "collection"])
65
+ .optional()
66
+ .describe("For type 'reference' only: 'system' (built-in entity) or 'collection' (another custom table)."),
67
+ date_default_type: z
68
+ .enum(["empty", "added", "specific"])
69
+ .optional()
70
+ .describe("For type 'date'/'naive_datetime' only: how the default date is set."),
50
71
  });
51
72
  server.tool("create_collection", "Create a new collection (custom data TABLE). It starts with the system columns (id/inserted_at/updated_at/creator_id); pass `columns` to add custom fields. NOTE: to WRITE records into it, use an HTTP function (webcake-data: db.model(table).create({...})) — the dashboard has no direct record-insert API. See get_http_function for the SDK guide.", {
52
73
  name: z.string().describe("Display name."),
53
74
  table_name: z.string().optional().describe("Table name (snake_case, unique). Defaults to name."),
54
- columns: z.array(COLUMN).optional().describe("Custom columns to add, e.g. [{name:'email',type:'string'},{name:'amount',type:'integer'}]."),
75
+ columns: z.array(COLUMN).optional().describe("Custom columns to add, e.g. [{name:'email',type:'text'},{name:'amount',type:'integer'}]."),
55
76
  }, ({ name, table_name, columns }) => handle(async () => {
56
77
  const tn = (table_name || name).trim();
57
78
  const created = await api.createCollection({ name, table_name: tn });
package/dist/web-guide.js CHANGED
@@ -872,7 +872,7 @@ export function guideHtml(origin, lang = "vi") {
872
872
  <details style="margin-top:18px;padding:0">
873
873
  <summary>${L === "vi" ? "Dành cho người dùng nâng cao / lập trình viên" : "For advanced users / developers"}</summary>
874
874
  <p>${L === "vi" ? "Danh sách đầy đủ các công cụ và lệnh kỹ thuật:" : "Full list of tools and technical commands:"}</p>
875
- <pre>${L === "vi" ? "~101 tool: get_build_guide · list_elements · get_element · new_element · new_section · new_page_skeleton · validate_page · build_page · add_section · list_pages · get_page_source · search_page_elements · update_page_element · create_page · update_page · update_page_source · publish_site · list_cms_files · get_http_function · edit_http_function · run_function · debug_function · get_current_context · list_my_sites · switch_site · update_auth · toggle_confirm_mode · send_mail · …và nhiều hơn nữa" : "~101 tools: get_build_guide · list_elements · get_element · new_element · new_section · new_page_skeleton · validate_page · build_page · add_section · list_pages · get_page_source · search_page_elements · update_page_element · create_page · update_page · update_page_source · publish_site · list_cms_files · get_http_function · edit_http_function · run_function · debug_function · get_current_context · list_my_sites · switch_site · update_auth · toggle_confirm_mode · send_mail · …and more"}</pre>
875
+ <pre>${L === "vi" ? "~280 tool: get_build_guide · list_elements · get_element · new_element · new_section · new_page_skeleton · validate_page · build_page · add_section · list_pages · get_page_source · search_page_elements · update_page_element · create_page · update_page · update_page_source · publish_site · list_cms_files · get_http_function · edit_http_function · run_function · debug_function · get_current_context · list_my_sites · switch_site · update_auth · toggle_confirm_mode · send_mail · …và nhiều hơn nữa" : "~280 tools: get_build_guide · list_elements · get_element · new_element · new_section · new_page_skeleton · validate_page · build_page · add_section · list_pages · get_page_source · search_page_elements · update_page_element · create_page · update_page · update_page_source · publish_site · list_cms_files · get_http_function · edit_http_function · run_function · debug_function · get_current_context · list_my_sites · switch_site · update_auth · toggle_confirm_mode · send_mail · …and more"}</pre>
876
876
  </details>
877
877
  </div>
878
878
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webcake-storefront-mcp",
3
- "version": "1.31.3",
3
+ "version": "1.31.5",
4
4
  "description": "MCP server for the WebCake/StoreCake storefront builder — page CRUD, page authoring, products, orders, and more",
5
5
  "mcpName": "io.github.vuluu2k/webcake-storefront-mcp",
6
6
  "license": "MIT",