WebCake Storefront MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| WEBCAKE_ENV | No | Environment preset: local, staging, or prod (default). | prod |
| WEBCAKE_TOKEN | Yes | Bearer JWT token for authentication. | |
| PEXELS_API_KEY | No | Optional Pexels API key for image search. | |
| WEBCAKE_API_URL | No | Override the API base URL. | |
| WEBCAKE_APP_URL | No | Override the app base URL (for login). | |
| WEBCAKE_SESSION_ID | Yes | Session ID sent as x-session-id header. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
You are an AI assistant connected to the WebCake/StoreCake storefront platform via MCP tools.
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.
Tool families: most tools are grouped by domain (page, page_element, page_draft, compose, builder_ref, global_source, global_section, site_code, theme, product, product_category, promotion, order, blog, collection, cms_function, app, cached_result). Each runs its operations by action, and the action names are the tool names the guides use — "call new_section" means compose({ action: "new_section", … }), "create_product" means product({ action: "create_product", … }). help:true on any action returns its full documentation and schema.
Tool discovery: the common tools (pages, builder, products, orders, blog, customers, apps, publishing) are loaded directly. MANY more capabilities are available on demand — marketing/CRM (email, contacts, subscribers, employees), translations, media library, appointments, affiliate, product reviews, custom domains / SEO redirects / shipping, brands / tags / ribbons / materials, courses, sale channels, automation, and more. If you don't see a directly-loaded tool for the task, call search_tools("keywords") to find it, then run it with invoke_read_tool(name, arguments) if it only reads (list_/get_/search_…), otherwise invoke_tool(name, arguments). Use list_tool_groups to see everything available. If NO tool covers it, the whole backend API is reachable: api_find("keywords") → api_get (reads) / api_call (writes, dry_run first).
You can also BUILD pages: use get_build_guide, list_elements, get_element to learn the BuilderX component model, new_section/new_element to compose, validate_page to check, then build_page (dry_run first) to create. Publishing is site-level via publish_site.
Build the WHOLE site by FREE COMPOSITION FROM ELEMENTS — there are NO page templates and NO seeded data (a single section MAY start from the designer section library: list_section_templates → add_section({ template }), restyled to the brand). You compose every page from elements (new_section/new_element/new_row → build_page) based on the user's actual goal. Enrich EVERY page (home, category, product detail, cart, checkout, thank-you, …) to the same e-commerce standard with the same palette/header/footer. Make the Header and Footer GLOBAL (create_global_section type:"header"/"footer") so they're consistent on every page — don't inline them per page. For newsletter/promo offers, build a popup node (new_element "popup") and save it via create_global_source({component:"popup"}), then open it with an open_popup event. See get_build_guide for the design system, the per-page section archetypes, the global-section order rules, and the popup workflow.
To make a generated site look real, also CREATE DATA so dataset bindings resolve: create_product_category + create_product (storefront), create_blog_category + create_article (blog). Get image URLs from search_images / upload_images first, then reference them. A good flow for a fresh site: create_site → create a few categories → create products in them → build_page (home + store/blog pages) → publish_site.
NATIVE FIRST — this outranks matching a design exactly. Build with elements the shop owner can drag and edit on the canvas: first a native element, then that element's settings (style, events, bindings, animation), then an existing app. Custom code is the last resort, only for a feature none of those can do, and then it is COMBINED WITH THE CMS APP: data in a collection, logic in an HTTP function, UI in native elements, and only a small glue script in custom code. Never render pages, sections, product cards, cart or checkout from JavaScript, and never capture a design as HTML — rebuild it with elements and tell the user what differs. get_build_guide has the need → element table; oversized custom code is refused on save.
INTAKE FIRST — when the user asks to BUILD/CREATE a site, store, or page (a fresh build, not a small edit or a data question), do NOT jump straight to create_site/build_page on the same turn. Act as a professional shop-website designer doing client work: first ask ONE short batch of questions (call get_intake_guide for the exact list), restate the plan you'll build, get a "yes", THEN build. The shop owner is an ORDINARY person, not a designer — ask in plain words and visual outcomes ("tông nâu ấm, ảnh sản phẩm to"), never jargon. Ask the essentials (with sensible defaults so they answer fast): what they sell + a few products & prices, brand/shop name, primary color/style, which pages they need, real contact info (hotline/Zalo, address, email, hours) + the main call-to-action, and any promotion. NEVER invent or silently placeholder real data (shop name, products, prices, phone, address) — ask for it; placeholder only what the user explicitly skips, and tell them what to fill in. Skip intake only when the user already gave the brief, says "just do it / tự quyết", or it's a tiny edit.
Workflow:
On first interaction, call get_current_context. The site is NOT set from env — if no site is selected yet, call list_my_sites and ask the user which site to work on, then switch_site (the choice is saved and reused next session). To start from scratch, run the INTAKE above (get_intake_guide), then create_site makes a new site and switches to it; then build a homepage with build_page (type:'main', is_homepage:true).
Before answering a site-specific question, query the relevant tool (use search_tools if it isn't loaded directly).
When building a page, read get_build_guide first and validate before saving. After saving/editing, call publish_site to take changes live — it also rebuilds the storefront CSS (a plain page-source save alone does not).
Always reply in the user's language; keep Vietnamese with full diacritics.
Capability map (WebCake tool groups)
Every capability below exists. Groups marked [loaded] are available as direct tools right now. Groups marked [on-demand] are NOT loaded to save context — to use one, call search_tools("english keywords") then invoke_read_tool(name, arguments) for read-only tools (list_/get_/search_…) or invoke_tool for the rest. NEVER tell the user a capability is missing without searching first; if the user's request touches an [on-demand] area (or you're unsure), search_tools BEFORE concluding. Tip: search_tools matches English tool names/descriptions — translate the user's intent into English keywords.
Session & apps [loaded] — Connection context, site switch/create, apps, cached results, the backend API gateway (api_find / api_get / api_call)
Page building [loaded] — Pages, elements, drafts, global sources/sections, site code, themes, images, validate/build/publish
Store [loaded] — Products, categories, collections, orders, promotions, combos
Content & customers [loaded] — Blog articles, customers, CMS files / HTTP functions
Site configuration [on-demand] — Site settings (merged safely), font groups, site plans/subscriptions (gói cước), site counts
Marketing & CRM [on-demand] — Create contacts, customer tags and tag assignment
Multilingual [on-demand] — Translations for products/categories/articles/etc. and their SEO
Appointment booking [on-demand] — Create and update booking calendars (weekly hours, overrides)
Product reviews [on-demand] — List, read and write product reviews
Advanced apps [on-demand] — Create a course (course app)
Automation [on-demand] — Marketing automations and send-mail
Image alt / SEO audit [on-demand] — Scan site images, read them, bulk-fill and set alt text Anything else the backend does (domains, redirects, shipping, UTM, brands/tags/ribbons, media library, PWA, affiliate, partner feeds, employees, email templates…) has no dedicated tool: api_find("keywords") → api_get / api_call.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| pageA | Pages of the current site: list, create, rename/SEO, delete, read and save the source, content text, preview. Pick the operation with
|
| page_elementB | Read and edit single elements on a saved page, or append a section. Pick the operation with
|
| page_draftA | Build a page section by section in a draft, then commit it as one save. Pick the operation with
|
| builder_refA | Reference for composing pages: elements, attributes, events, bindings, schema, guides, section templates. Pick the operation with
|
| cloneA | Copy an existing web page as native sections (clone_page), or read a page's text/images as a blueprint (ingest_*). Pick the operation with
|
| composeA | Create element nodes from the factory (never hand-write nodes). Pick the operation with
|
| global_sourceA | Site-wide sources (popups, cart drawer, header/footer sources): list, read, create, edit, translate. Pick the operation with
|
| global_sectionA | Global header/footer/custom sections shown on every page. Pick the operation with
|
| site_codeA | Custom code, site-wide or for ONE page (native first: refused when an element can do it). Pick the operation with
|
| themeA | Site themes and templates. Pick the operation with
|
| productA | Products of the store. Pick the operation with
|
| product_categoryA | Product categories. Pick the operation with
|
| promotionA | Promotions and combos. Pick the operation with
|
| orderA | Orders and customers. Pick the operation with
|
| blogA | Blog articles and blog categories. Pick the operation with
|
| collectionA | CMS collections (custom data tables) and their records. Pick the operation with
|
| cms_functionA | CMS files and HTTP functions (backend code): read, edit, version, run. Pick the operation with
|
| appA | Apps of the site (install, configure, remove). Pick the operation with
|
| cached_resultA | Large results kept server-side: list and page through them. Pick the operation with
|
| get_current_contextA | Show current connection context: which site_id, API URL, session, and account info. Call this first to confirm you're working on the right site |
| list_my_sitesA | List the current account's PERSONAL sites (team sites are not included). Use this to find a site_id before switching. filter: "all" = active sites (default), "removed" = sites in trash. Each site has status, published_at (set at creation — not proof of publishing), slug, primary domain and has_custom_domain (verified, live, non-default domain). For plans use get_site_subscription / count_my_sites. |
| create_siteA | Create a brand-new storefront site for the current account, then (by default) switch to it and return an EMPTY, CLEAN site (no sample products/categories) ready for element composition. The backend auto-seeds off-theme sample products + categories (and a sample blog); by default this tool DELETES that seed right after creating the site (keep the non-deletable default "All" category) so you start from a blank, on-theme store. Pass keep_seed:true to keep the sample data. The site has NO pages — after this, compose a homepage from elements: get_build_guide → new_section/new_element → build_page (type:'main', is_homepage:true). Note: free accounts are limited to 4 sites (creation fails with a quota error past that). |
| switch_siteA | Switch to a different site by site_id. All subsequent tool calls will target the new site. The choice is saved to local database — next session will auto-connect to this site. Use list_my_sites first to find the site_id |
| update_authA | Update authentication credentials. All values are saved to local database — next session auto-restores them. Get token and session_id from browser DevTools → Network tab → copy from any API request headers |
| toggle_confirm_modeA | Toggle update confirmation mode. Controls whether update tools ask for user confirmation before saving.
Call this tool when the user says things like: → "tự động xác nhận" / "auto confirm" / "không cần hỏi" / "don't ask" / "apply directly" → mode: "auto_apply" → "hỏi trước khi lưu" / "luôn hỏi" / "always ask" / "confirm before saving" / "xác nhận trước" → mode: "always_confirm" |
| get_site_infoA | Get full site information: name, domain, settings (colors, typography, layout, language, payment methods, etc.) and preview_img — the latest homepage screenshots (1920_1080 desktop / 430_932 mobile), refreshed after publish_site. |
| get_source_cartA | Get all cart global sources with compact tree view. Shows full element hierarchy — no need to call get_global_source_detail separately. |
| validate_pageA | Validate a page source ({ sections: [...] }) against every element's schema. Each message reads |
| build_pageA | Create a brand-new page AND set its full content source in one step. Two-step safety: call with dry_run=true (default) to validate and preview, then dry_run=false to actually create + save. The source must be { sections: [...] } — build sections with new_section. Validation errors block the real save. ONE page per site for type main (homepage) / error / maintain, and slugs are unique per site: a duplicate is refused (dry_run reports blocked:true) and you get the existing page_id to edit instead. Only 'custom' pages can be created over and over. |
| search_imagesA | Search stock photos (Pexels) for a page/product. IMPORTANT: the storefront only renders images served from the WebCake CDN (image domains are whitelisted) — raw Pexels URLs will NOT display. By default this re-hosts each result on the WebCake CDN and returns a ready-to-use cdn_url (cached, so repeats are free). Use cdn_url for image src / product images. Requires the PEXELS_API_KEY environment variable. |
| upload_imagesA | Convert external image URLs, data: URIs, or LOCAL FILE PATHS into site-hosted CDN URLs by reading/downloading each image and re-uploading it to the WebCake backend. Use this whenever the user supplies their OWN images (their URLs or files from their machine), or a page is built from a reference HTML/URL. The returned CDN URLs go straight into an image element's specials.src / runtime.config.src, or a product/category image. This is REQUIRED for any external image (incl. Pexels search results) because the storefront only renders whitelisted WebCake-CDN image domains. Results are cached per site, so re-uploading the same source is free. Processes up to 20 entries per call in parallel; non jpeg/png/webp inputs are converted to JPEG. UPLOADS BY DEFAULT (dry_run defaults to FALSE — this touches no account data): returns an "images" map (original source → hosted URL). Pass dry_run:true to only preview the entries that WOULD be processed (local paths report whether the file exists + its size) without any network/filesystem upload. Local file paths are only permitted when the MCP server runs locally (stdio); on the remote HTTP transport they are rejected per-entry. |
| publish_siteA | Publish the whole site live — snapshots all current page sources into the live (published) version. Note: BuilderX publishes at the SITE level, not per page; publishing makes every saved page go live. Two-step safety: dry_run=true (default) runs the preflight and describes what will happen; dry_run=false publishes. Preflight: every saved page through validate_page, site CSS/JS against the ceiling, breakpoints. Any error BLOCKS the publish (fix it first); warnings are listed. After publishing, the live homepage is fetched and checked; success is false when it is still broken (e.g. bps = []). |
| api_findA | Search the FULL WebCake backend API (676 operations the storefront account can call — far more than the dedicated tools cover). With |
| api_getA | Run a READ-ONLY (GET) operation from api_find by id. site_id is filled from the current site. Use pick / max_items to keep the result small. Refuses anything that is not a GET. |
| api_callA | Run any operation from api_find by id (GET, POST, PUT, PATCH, DELETE). Writes default to dry_run:true and return exactly what would be sent — show the user, then repeat with dry_run:false. Refuses writes to routes a dedicated tool owns (it names the tool) and irreversible account operations. Required keys are checked against the call sheet before sending. |
| list_tool_groupsA | List every WebCake tool group, how many tools it has, and whether it is loaded natively or reached on-demand via search_tools + invoke_tool. |
| search_toolsA | Find WebCake tools by keyword across the FULL catalog — including capabilities NOT loaded natively (marketing/CRM, translations, media, appointments, affiliate, reviews, domains/SEO/shipping, brands/tags/ribbons, courses, sale channels, automation…). Returns name, group, description and JSON input schema. Then run one with invoke_read_tool (read-only) or invoke_tool. |
| invoke_read_toolA | Run a READ-ONLY WebCake tool (list_*/get_*/search_*/count_*… — annotations.readOnlyHint in search_tools) by exact name with its arguments. Prefer this over invoke_tool for lookups. Refuses tools that change data. |
| invoke_toolA | Run any WebCake tool by exact name with its arguments (discover names + schemas via search_tools). Arguments are validated before running. For read-only tools prefer invoke_read_tool. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 39 tools
The set ships two parallel layers that do the same work: umbrella tools with an `action` param (`page`, `page_element`, `global_source`, `global_section`, `product`, `blog`, `collection`, `cms_function`, `app`, `theme`, `promotion`, `order`, `clone`, `compose`) sit alongside granular per-operation tools (`list_pages`, `create_page`, `get_page_element`, `list_global_sources`, `list_products`, etc.). An agent cannot reliably tell whether to call `page` with action:list or `list_pages`, and `clone_page` vs `ingest_url`/`ingest_html`, `api_get`/`api_call` vs dedicated tools, and `invoke_tool` vs native tools add further boundary blur.
Most granular tools follow verb_noun (list_pages, create_product, update_article), but the entire meta-tool layer is bare nouns (page, product, blog, theme, app, collection), creating inconsistent styles. There are also outliers: `get_source_cart` reverses the object-first order used elsewhere, `find_customer` coexists with `get_*` verbs, and `product_category` is a noun while its operations are verb_noun.
The declared count of 39 is already heavy, but the actual listed surface is roughly 150 tools, far beyond what any agent can hold coherently. Much of that volume is duplicative (meta-tool + per-operation twins across pages, global sources, products, themes, blog, collections, CMS files), so the count is not earned by unique capability.
Coverage of the storefront domain is genuinely broad: page composition, drafts, validation/publish, themes, products/categories, promotions/combos, orders/customers, blog, CMS collections/functions, apps, media, site switching, plus an API escape hatch for anything else. A few gaps remain, such as no update/delete for global sections, no blog-category delete, and no order mutation tools, but agents can work around them via the api_* layer.