@wix/mcp 1.0.92 → 1.0.94

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 (38) hide show
  1. package/build/bin-standalone.js +180 -212
  2. package/build/cjs/index.cjs +757 -216
  3. package/build/cjs/toolkit.cjs +725 -209
  4. package/build/dts/api-call/index.js +6 -3
  5. package/build/dts/api-call/site-files.d.ts +28 -0
  6. package/build/dts/api-call/site-files.js +194 -0
  7. package/build/dts/api-call/upload-headless-website-files.d.ts +35 -0
  8. package/build/dts/api-call/upload-headless-website-files.js +171 -0
  9. package/build/dts/bin.js +3 -6
  10. package/build/dts/code-mode/attachments.d.ts +37 -0
  11. package/build/dts/code-mode/attachments.js +218 -0
  12. package/build/dts/code-mode/index.js +53 -6
  13. package/build/dts/config/default-config.d.ts +0 -4
  14. package/build/dts/config/default-config.js +48 -56
  15. package/build/dts/config/param-descriptions.js +5 -5
  16. package/build/dts/docs/docs.d.ts +4 -2
  17. package/build/dts/docs/docs.js +25 -15
  18. package/build/dts/docs/fetch-article.js +4 -1
  19. package/build/dts/docs/get-to-know.js +1 -1
  20. package/build/dts/docs/semanticSearch.d.ts +2 -1
  21. package/build/dts/docs/semanticSearch.js +12 -5
  22. package/build/dts/docs/start-headless-build.d.ts +19 -0
  23. package/build/dts/docs/start-headless-build.js +74 -0
  24. package/build/dts/graphql/index.js +3 -1
  25. package/build/dts/import-claude-design-tool/index.js +2 -2
  26. package/build/dts/index.d.ts +1 -0
  27. package/build/dts/index.js +1 -0
  28. package/build/dts/site-widget-tools/search-site-templates-tool/index.js +17 -7
  29. package/build/dts/toolkit-entry.d.cts +4 -2
  30. package/build/dts/toolkit-entry.d.ts +4 -2
  31. package/build/dts/toolkit.js +9 -0
  32. package/build/dts/wix-mcp-server.d.ts +2 -0
  33. package/build/dts/wix-mcp-server.js +4 -0
  34. package/build/esm/index.js +755 -216
  35. package/build/esm/toolkit.js +725 -209
  36. package/package.json +2 -2
  37. package/build/dts/docs/create-site-guide.d.ts +0 -3
  38. package/build/dts/docs/create-site-guide.js +0 -109
@@ -71098,9 +71098,12 @@ var runSemanticSearch = async (toolName, toolParams, maxResults = 20, rerank = f
71098
71098
  );
71099
71099
  return data?.results;
71100
71100
  };
71101
- var runPlatformizedSemanticSearch = async (toolName, searchTerm, maxResults = 20, linesInEachResult) => {
71101
+ var runPlatformizedSemanticSearch = async (toolName, searchTerm, maxResults = 20, linesInEachResult, extraDocumentTypes) => {
71102
71102
  const startTime = Date.now();
71103
- logger2.log(`[SemanticSearch/v2] Tool: ${toolName}, Query: "${searchTerm}"`);
71103
+ const documentTypes = extraDocumentTypes?.length ? [toolName, ...extraDocumentTypes] : void 0;
71104
+ logger2.log(
71105
+ `[SemanticSearch/v2] Tool: ${documentTypes ? documentTypes.join("+") : toolName}, Query: "${searchTerm}"`
71106
+ );
71104
71107
  const response = await fetch(
71105
71108
  "https://www.wixapis.com/mcp-docs-search/v1/docs/search/markdown",
71106
71109
  {
@@ -71111,7 +71114,7 @@ var runPlatformizedSemanticSearch = async (toolName, searchTerm, maxResults = 20
71111
71114
  },
71112
71115
  body: JSON.stringify({
71113
71116
  search_term: searchTerm,
71114
- document_type: toolName,
71117
+ ...documentTypes ? { document_types: documentTypes } : { document_type: toolName },
71115
71118
  maximum_results: maxResults,
71116
71119
  lines_in_each_result: linesInEachResult
71117
71120
  })
@@ -71140,14 +71143,16 @@ var runSemanticSearchAndFormat = async ({
71140
71143
  maxResults = DEFAULT_MAX_RESULTS,
71141
71144
  rerank,
71142
71145
  linesInEachResult,
71143
- usePlatformizedSearch = true
71146
+ usePlatformizedSearch = true,
71147
+ extraDocumentTypes
71144
71148
  }) => {
71145
71149
  if (usePlatformizedSearch) {
71146
71150
  return runPlatformizedSemanticSearch(
71147
71151
  toolName,
71148
71152
  toolParams.searchTerm,
71149
71153
  maxResults,
71150
- linesInEachResult
71154
+ linesInEachResult,
71155
+ extraDocumentTypes
71151
71156
  );
71152
71157
  } else {
71153
71158
  const results = await runSemanticSearch(
@@ -71172,7 +71177,7 @@ var REST_PORTAL_ID = "d1972c09-74e2-4d36-a6f2-54e3310d4ad9";
71172
71177
  var RECIPES_INDEX_URL = "https://dev.wix.com/docs/api-reference/articles/ai-tools/wix-mcp/skills/wix-management-recipes-index";
71173
71178
  var DOCS_URL_PREFIX = "https://dev.wix.com/docs/";
71174
71179
  var SKILLS_REGISTRY_URL = new RegExp(
71175
- "^https://(?:dev\\.wix\\.com(?:/docs)?|www\\.wix\\.com(?:/velo/reference)?)/skills(?:[/.?#]|$)"
71180
+ "^https://(?:dev\\.wix\\.com(?:/docs)?|www\\.wix\\.com(?:/velo/reference)?)/skills(?:[/.?#]|$)|^https://www\\.wix\\.com/headless/"
71176
71181
  );
71177
71182
  function isSkillsRegistryUrl(url) {
71178
71183
  return SKILLS_REGISTRY_URL.test(url.trim());
@@ -71597,10 +71602,8 @@ function buildSystemReminderGuidelines(includeReadme, includeImageUploadGuidance
71597
71602
  if (includeReadme) {
71598
71603
  lines.push(
71599
71604
  "if the WixREADME tool is available to you, YOU MUST USE IT AT THE BEGINNING OF ANY CONVERSATION and then continue with calling the other tools and calling the Wix APIs until the task is completed.",
71600
- "**Exception \u2014 creating a new Wix site/website:** For a normal creation request \u2014 and only then \u2014 skip WixREADME and the docs search, and route straight to the Wix site-creation tools available to you; their descriptions carry the routing rules. Everything else starts with WixREADME as usual.",
71601
- "If the user explicitly asks for a headless site, Wix Classic Editor site, or manual account/API-based site creation, call CreateWixBusinessGuide right away \u2014 these don't need the site's purpose first.",
71602
- "If the user \u2014 or you, earlier in this conversation \u2014 already have a finished page or site in any form (HTML/CSS/JS files, a static build, a zip, another builder's export, a design you can export to HTML) and want it live on Wix, call StartDeployWebsite right away \u2014 not a site-creation tool, not the docs.",
71603
- "Never default to AI or search templates unless the user explicitly requests it. When the user named no creation method - let the user make that choice as the site-creation tools' descriptions direct. Never route normal site creation through ManageWixSite, CallWixSiteAPI, or ExecuteWixAPI."
71605
+ "**Creating a new Wix site \u2014 and only then \u2014 skip WixREADME and the docs.** First settle one thing: will the user keep working on this site with you, in code, or design it themselves in Wix's editor? In code \u2014 you or the user have code, the two of you designed it here, they asked you to build it, they asked for a headless site, or it is an app: StartDeployWebsite if the code exists in any form, StartHeadlessBuild if not, called right away (it only returns the guide; the site's purpose is not needed first). In Wix's editor: the site-creation tools; their descriptions carry the rules. Everything else starts with WixREADME as usual.",
71606
+ "Never default to AI or search templates unless the user explicitly requests it. When the user named no creation method - let the user make that choice as the site-creation tools' descriptions direct. Never route site creation through ManageWixSite, CallWixSiteAPI, or ExecuteWixAPI."
71604
71607
  );
71605
71608
  }
71606
71609
  lines.push(
@@ -71648,9 +71651,8 @@ function buildSystemReminder(includeReadme, includeImageUploadGuidance = true) {
71648
71651
  );
71649
71652
  const flows = buildSystemReminderFlows(includeReadme);
71650
71653
  return dedent_default`
71651
- <agent-mandatory-instructions>
71652
- YOU MUST READ AND FOLLOW THE AGENT-MANDATORY-INSTRUCTIONS BELOW
71653
- A FAILURE TO DO SO WILL RESULT IN ERRORS AND CRITICAL ISSUES.
71654
+ <wix-usage-guide>
71655
+ How to work with Wix through these tools. Following these steps avoids failed or incorrect API calls.
71654
71656
  <goal>
71655
71657
  ${AGENT_GOAL}
71656
71658
  </goal>
@@ -71660,7 +71662,7 @@ function buildSystemReminder(includeReadme, includeImageUploadGuidance = true) {
71660
71662
  <flow-description>
71661
71663
  ${flows}
71662
71664
  </flow-description>
71663
- </agent-mandatory-instructions>
71665
+ </wix-usage-guide>
71664
71666
  `;
71665
71667
  }
71666
71668
  var SYSTEM_REMINDER = buildSystemReminder(true);
@@ -71672,18 +71674,14 @@ var SITE_CREATION_COPY = {
71672
71674
  unstatedMethod: {
71673
71675
  nonWidget: "you MUST ask whether they want to build with AI or start from a template, and create nothing and show nothing until they answer",
71674
71676
  widget: "you MUST call `WixSiteCreation` and let them choose"
71675
- },
71676
- normalCreationRoute: {
71677
- nonWidget: "route those through `WixSiteBuilder` or `SearchSiteTemplates`",
71678
- widget: "route those through `WixSiteCreation`"
71679
71677
  }
71680
71678
  };
71681
71679
  var SITE_GUIDANCE = dedent_default`
71682
- First decide which of two different things is being asked for:
71683
- - The site is code the user or you control — hand-written HTML/CSS/JS, a static build, a zip, another AI builder's export, or a page or design you made earlier in this conversation — and it should go live on Wix. This is also the route whenever the user wants to keep working on the site here, with you: a Wix Headless site is a regular coded site, so you keep full control of the design and can change and redeploy it from this conversation at any time, and Wix business capabilities can be added to it as a backend when they are needed. Call StartDeployWebsite: it returns the recipe to host those exact files as a Wix Headless site (updates reuse the same site and URL; the drop page is only its fallback). Do not offer AI or templates for this and do not call any site-creation tool.
71684
- - Wix should create the site — generated with AI from a description, or started from a template — and the user will design and edit it in Wix rather than through you. That is what the site-creation tools do; they never take files you already have.
71680
+ First decide who keeps building the site:
71681
+ - **You, in code**: a Wix Headless site, with full control of the design, changed and redeployed from this conversation, Wix business features added as a backend. This is the case when you or the user have code (hand-written files, a static build, a zip, another builder's export, a page you made here): call StartDeployWebsite. It is also the case when nothing is coded yet but the user asked you to build it or asked for a headless site, the two of you worked out its design in this conversation, or it is an app (a game, a dashboard, a tool): call StartHeadlessBuild right away, before asking what the site is for. Do not offer AI or templates for either.
71682
+ - **The user, in Wix's editor**: Wix generates it with AI or starts it from a template, and the user designs it in Wix. That is what the site-creation tools do; they never take files you already have.
71685
71683
 
71686
- For a new site there are two things to settle: what the site is for, and how to build it. The how is AI generation vs. starting from a template, so naming templates, a template id or Wix Studio (Wix Studio is also the template side) already settles it.
71684
+ For a new site in Wix's editor there are two things to settle: what the site is for, and how to build it. The how is AI generation vs. starting from a template, so naming templates, a template id or Wix Studio (Wix Studio is also the template side) already settles it.
71687
71685
 
71688
71686
  Settle what the site is for first: its purpose, topic, business type, audience, or main visitor action. Naming a method is not a description of the site, and neither is the business or industry on its own.
71689
71687
  If you can't tell yet, ask the preferred question below and nothing else — one question, no creation-method question in the same reply, and no internal tool names.
@@ -71703,6 +71701,7 @@ var toWidget = (text) => Object.values(SITE_CREATION_COPY).reduce(
71703
71701
  );
71704
71702
  var EXECUTE_WIX_API_INTRO = dedent_default`
71705
71703
  Execute JavaScript code against the Wix REST API when code is useful for chaining related calls, pagination, loops, branching, or in-memory transformation.
71704
+ Putting a site live or changing a headless site's files starts with StartDeployWebsite; building a new site in code with StartHeadlessBuild.
71706
71705
 
71707
71706
  CODE CONTRACT:
71708
71707
  - Pass an async function expression: \`async function() { ... }\` or \`async () => { ... }\`. Put every declaration, \`await\`, and \`return\` inside it, and do not invoke it yourself.
@@ -71780,13 +71779,14 @@ var ACCOUNT_SITE_EXECUTE_SCOPE = dedent_default`
71780
71779
  unzip(input: string | Uint8Array): Promise<Array<{ path: string; bytes: Uint8Array; text(): string }>>;
71781
71780
  };
71782
71781
  declare const siteId: string | undefined;
71783
- // Files from the ExecuteWixAPI \`files\` param. Text entries have \`content\`;
71784
- // an entry tagged \`=== FILE: <path> base64 ===\` has encoding:'base64' and
71785
- // base64 \`content\` (a binary file — image, font).
71782
+ // Files from the ExecuteWixAPI \`files\` param, followed by the resolved
71783
+ // \`attachments\`. Text entries have \`content\`; an entry tagged
71784
+ // \`=== FILE: <path> base64 ===\` — and every attachment, path = its file name —
71785
+ // has encoding:'base64' and base64 \`content\`.
71786
71786
  declare const files: Array<{ path: string; content: string; encoding?: "base64" }>;
71787
71787
  \`\`\`
71788
71788
 
71789
- FILE UPLOADS: put every file in the \`files\` param (never inline in \`code\`). Text goes raw; a small binary (icon, logo, font) rides as a \`base64\`-tagged entry — large images/video are referenced by URL (\`<img src="https://...">\`), not bundled. \`wix.multipart()\` turns the whole set into one upload body (bytes, so binary is safe):
71789
+ FILE UPLOADS: files never go inline in \`code\`; two params feed the \`files\` global. \`attachments\` works in ChatGPT only: pass files attached in the chat or created in your sandbox (any type, up to 10 MB per call: a zip of a whole site, HTML, images, PDFs) as you have them, by file id or /mnt/data path, all in one call. ChatGPT swaps each for \`{ download_url, file_id, file_name?, mime_type? }\` before the call reaches Wix, and the bytes arrive as base64 entries named by file name. Other clients send the value unchanged and the call fails before running; there, leave \`attachments\` out, or upload from your shell if it reaches the internet. The \`files\` param takes content you have as text here: text goes raw; a small binary (icon, logo, font) rides as a \`base64\`-tagged entry — large images/video are referenced by URL (\`<img src="https://...">\`), not bundled. \`wix.multipart()\` turns the whole set into one upload body (bytes, so binary is safe):
71790
71790
  \`\`\`javascript
71791
71791
  // files param:
71792
71792
  // === FILE: index.html ===
@@ -71801,6 +71801,12 @@ var ACCOUNT_SITE_EXECUTE_SCOPE = dedent_default`
71801
71801
  return res.data;
71802
71802
  }
71803
71803
  \`\`\`
71804
+ A site zip passed through \`attachments\` is one base64 entry; unzip it and upload the entries:
71805
+ \`\`\`javascript
71806
+ // attachments: [site.zip] → files = [{ path: "site.zip", content: "<base64>", encoding: "base64" }]
71807
+ const entries = await wix.unzip(files[0].content); // [{ path, bytes, text() }]
71808
+ const mp = wix.multipart(entries);
71809
+ \`\`\`
71804
71810
  DOWNLOAD + EDIT + RE-UPLOAD: fetch the zip as base64, \`wix.unzip()\` it, edit text via \`entry.text()\`, keep binary as bytes, and hand the entries back to \`wix.multipart()\`:
71805
71811
  \`\`\`javascript
71806
71812
  const r = await wix.request({ scope: "account", method: "GET", responseType: "base64", url: zipUrl });
@@ -71941,7 +71947,7 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
71941
71947
  ReadFullDocsArticle: dedent_default`
71942
71948
  Fetches the full Wix docs article or method article with code examples for using the method.
71943
71949
  Docs articles looks like this: https://dev.wix.com/docs/... and they can either be general docs articles or method articles.
71944
- Also reads Wix skills pages — https://www.wix.com/skills/<skill>, https://dev.wix.com/docs/skills/<skill>, and the files they link (e.g. .../<skill>/references/<file>.md) — exactly as served.
71950
+ Also reads Wix skills pages — https://www.wix.com/skills/<skill>, https://dev.wix.com/docs/skills/<skill>, and the files they link (e.g. .../<skill>/references/<file>.md) — and Wix Headless agent pages under https://www.wix.com/headless/ (e.g. https://www.wix.com/headless/skill.md), exactly as served.
71945
71951
  Take the URL from the user's message or an earlier tool result. To reach an article you have no URL for, search or browse the docs first.
71946
71952
  For REST docs, use the URL as-is. For SDK docs, the URL SHOULD include ?apiView=SDK.
71947
71953
  ${reminder}
@@ -71989,7 +71995,7 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
71989
71995
  ${reminder}
71990
71996
  `,
71991
71997
  ManageWixSite: dedent_default`
71992
- Use account level API in order to create a site and update a site.
71998
+ Use account level API in order to update a site.
71993
71999
  Account-level only: this tool acts on the account itself, or on sites as objects within it, and sends no site context. Anything that reads or writes inside a site is site-level and does not belong here — use a site-level tool with that site's \`siteId\`.
71994
72000
  For POST/PATCH/PUT requests, pass the request body as a JSON object or array in the "body" parameter with all the required fields and values as described in the API schema, code examples, or docs you retrieved (e.g. body: {"name": "value", "nested": {"key": "value"}} or body: [{"key": "value"}]).
71995
72001
  The API endpoint url param MUST ALWAYS be taken from the conversation context.
@@ -72005,12 +72011,12 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
72005
72011
  NEVER call this tool with a missing, empty, or guessed siteId — ask first instead.
72006
72012
 
72007
72013
  Parameters — provide image input via image and/or imageUrls, OR imageBase64:
72008
- • image (array): chat file ATTACHMENTS. Each item is an object with download_url and file_id (both required), plus optional file_name and mime_type. Pass ALL attachments in one call.
72014
+ • image (array): chat file ATTACHMENTS — files the user attached, or files you created in your own file sandbox. Each item is an object with download_url and file_id (both required), plus optional file_name and mime_type. Pass ALL attachments in one call.
72009
72015
  • imageUrls (array): plain public image URLs the user pasted or other tools produced (no file_id). Pass ALL URLs in one call. Can be combined with image.
72010
72016
  • imageBase64 (string): base64-encoded image + mimeType. One image at a time. Do NOT combine with image/imageUrls.
72011
72017
 
72012
72018
  Delivering the bytes — this is where uploads most often fail:
72013
- • NEVER pass a local or sandbox file path (e.g. /mnt/..., /home/user/..., /Users/...) in any field — the server cannot reach your filesystem. Use a public http(s) URL (imageUrls) or the complete base64 (imageBase64).
72019
+ • Pass a file as a file, in image: the platform resolves it into download_url and file_id before it reaches this tool — this includes files you created in your sandbox. This server does not share your filesystem, so a bare path string (e.g. /mnt/..., /home/user/..., /Users/...) is not a file. Without a file to pass, use a public http(s) URL (imageUrls) or the complete base64 (imageBase64).
72014
72020
  • imageBase64 must be the WHOLE file, not truncated. For large images prefer imageUrls, since long base64 is easily cut off and will be rejected as unreadable.
72015
72021
  `,
72016
72022
  SupportAndFeedback: dedent_default`
@@ -72068,14 +72074,15 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
72068
72074
 
72069
72075
  Do not call this if the user explicitly asks to build with AI; call \`WixSiteBuilder\` instead.
72070
72076
  Do not call this if the user asks for templates or Wix Studio; call \`SearchSiteTemplates\` instead.
72077
+ Not for a site the user wants you to build in code, a design you worked out together, or an app: call \`StartHeadlessBuild\`.
72071
72078
 
72072
72079
  When calling this tool, infer \`customActions\` from the user's request so the reply can be tailored — 2-3 concrete, industry-specific setup actions for the site (see the input's guidance).
72073
72080
 
72074
72081
  After calling, you MUST speak the message provided in the tool result to the user as your reply — do not stay silent and do not replace it with a one-line pointer to the widget. Write out ALL of it, word for word: its opening line (the "Ready to set up your … site?" question INCLUDING "Choose your path in the widget above:"), BOTH of its option bullets, and its "Next up:" line, each on its own line and in that order. Do not summarize, shorten, drop any line, invent your own opener, rename the options, or add an intro or outro.
72075
72082
  `,
72076
72083
  "import-claude-design-from-url": dedent_default`
72077
- Import a design created in Claude's design tool into Wix. Takes the signed claudeusercontent.com URL Claude Design produces for its self-contained HTML bundle (all images, fonts, and styles inlined); any other host is rejected. Creates a live Wix-hosted site and returns its URL.
72078
- NOT for a page or site that exists in any other form (the user's own HTML/CSS/JS, a static build, a zip, another builder's export, a page you made in this conversation) — for those call StartDeployWebsite instead; it returns the recipe to publish the files yourself.
72084
+ Import a design created in Claude's design tool into Wix. Only for the signed \`claudeusercontent.com\` bundle URL Claude Design's "Send to Wix" produces (a self-contained HTML bundle with all images, fonts, and styles inlined). Creates a live Wix-hosted site and returns its URL.
72085
+ NOT for claude.ai share or artifact links, GitHub, Drive, chatgpt.com or any other URL, and not for files: those go to StartDeployWebsite, which returns the recipe to publish the files yourself.
72079
72086
  `,
72080
72087
  RunWixCliCommand: dedent_default`
72081
72088
  Executes Wix CLI commands for Wix app development and management.
@@ -72512,23 +72519,23 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
72512
72519
  Call this ONLY when the user's own words name AI (for example "create a site using AI" or "build it with AI") and the site intent is clear. A description of what the site should do — reservations, online ordering, a store, bookings, menus, a portfolio, and the like — is NOT a request for AI and NOT enough to call this tool; never infer AI from features or industry.
72513
72520
  Never default to this tool: if the user hasn't explicitly named AI, don't call this tool — ${SITE_CREATION_COPY.unstatedMethod.nonWidget}.
72514
72521
 
72515
- For templates or Wix Studio, call \`SearchSiteTemplates\`; for a specific template by \`metaSiteId\` or \`templateId\`, call \`CreateSiteFromTemplate\`; for a headless or classic Wix Editor site, or manual/account-API creation, call \`CreateWixBusinessGuide\`.
72522
+ For templates or Wix Studio, call \`SearchSiteTemplates\` (\`builder: classic\` for the Classic Editor); for a template id, \`CreateSiteFromTemplate\`. A site the user wants you to build in code, or an app: \`StartHeadlessBuild\`.
72516
72523
 
72517
72524
  Do NOT suggest HTML code, prompt templates, or alternative approaches instead of building — actually build the site through this tool. (HTML the user already has is the StartDeployWebsite case, not a reason to build.)
72518
72525
  `,
72519
72526
  SearchSiteTemplates: dedent_default`
72520
72527
  ${SITE_GUIDANCE}
72521
72528
 
72522
- Searches Wix templates and shows the template gallery, from the Harmony or the Studio template source.
72529
+ Searches Wix templates and shows the template gallery, from the Harmony, the Studio or the Classic Editor template source.
72523
72530
 
72524
- Call this ONLY when the user's own words ask for a template or for Wix Studio (for example "start from a template", "show me some templates", "build it in Wix Studio") and you can already tell what the site is for. If they mention Wix Studio, search Studio templates; otherwise search Harmony templates.
72531
+ Call this ONLY when the user's own words ask for a template, for Wix Studio or for the Classic Editor (for example "start from a template", "show me some templates", "build it in Wix Studio", "the old Wix editor") and you can already tell what the site is for. If they mention Wix Studio, search Studio templates; if they ask for the Classic Editor (the Wix Editor), search \`classic\`; otherwise search Harmony templates.
72525
72532
  ${SITE_CREATION_COPY.templatePick.nonWidget}
72526
72533
 
72527
72534
  A description of what the site should do — bookings, a store, a menu, a portfolio, and the like — is NOT a request for templates or for Wix Studio; never infer either from features or industry. Templates are not the default: if the site intent is clear but no method is named, do not guess — ${SITE_CREATION_COPY.unstatedMethod.nonWidget}.`,
72528
72535
  CreateSiteFromTemplate: dedent_default`
72529
72536
  Creates a Wix site from a specific template (by \`metaSiteId\` or \`templateId\`), publishes it when possible, and shows a live preview with links to the editor and the published site.
72530
72537
 
72531
- Call this when the user provides a specific template by \`metaSiteId\` or \`templateId\`. Use this only when the user gives a valid \`metaSiteId\` or \`templateId\` directly. To browse or choose a template first, call \`SearchSiteTemplates\`.
72538
+ Call this when the user provides a specific template by \`metaSiteId\` or \`templateId\`. Use this only when the user gives a valid \`metaSiteId\` or \`templateId\` directly. To browse or choose a template first, call \`SearchSiteTemplates\` (\`builder: classic\` for a Classic Editor site).
72532
72539
 
72533
72540
  `,
72534
72541
  SearchWixGraphQLOperations: dedent_default`
@@ -72556,34 +72563,24 @@ function buildToolDescriptions(includeReadme, includeImageUploadGuidance = true)
72556
72563
  Compose: put independent reads in one document as several root fields, and use related-entity fields (e.g. \`inventoryItems\`, \`collections\`, \`fulfillments\`) instead of extra round-trips. Select only the fields you need; every object field needs a selection set. Variables: use them for \`JSON\` scalars (filter, sort) and plain scalars (String, Int, ID), declared in the document (e.g. \`query Q($f: JSON) { ... filter: $f ... }\`). Write mutation inputs and any object that contains an enum INLINE as GraphQL literals with enum values unquoted (e.g. \`input: { product: { name: "Mug", productType: PHYSICAL } }\`) — this endpoint fails with 503 when an enum value arrives inside an object-typed variable. For lists page with \`cursorPaging\` or \`paging\` exactly as the input type declares (never the other one), and request \`pageInfo { hasNext total }\`; \`total\` is only populated with offset \`paging\`, so for a cursor-paged list count by walking pages or use a count operation.
72557
72564
  Results: each root field fails independently — \`errors[].path\` names the failing field and \`errors[].extensions.message\` the cause (e.g. PERMISSION_DENIED); \`data\` still holds the fields that succeeded. Mutations return the created/updated entity — read the IDs from it and do not re-query to verify. Large results are truncated: narrow the selection or page size instead of re-running.
72558
72565
  Set \`hasMutations: true\` for any document containing a mutation root field.
72566
+ `,
72567
+ UploadHeadlessWebsiteFiles: dedent_default`
72568
+ The upload step of the StartDeployWebsite and StartHeadlessBuild guides, and nothing else: puts a finished static website's files — index.html plus its CSS/JS/images, a static build, or a zip of the site — onto an existing Wix Headless site by its metaSiteId. Call it ONLY after one of them has returned its guide in this conversation and the site exists: for a new site, first run the recipe's provision call and pass the metaSiteId it returns; for a site deployed earlier, pass its metaSiteId. It does not create sites. Every upload replaces the whole file set and the URL stays. Returns the live URL and the dashboard link, and points back to the recipe for what comes next.
72569
+ Pass the files themselves: in ChatGPT as \`attachments\` (any type, a zip is unpacked), elsewhere as the \`files\` text bundle (\`=== FILE: <path> ===\` sections, \`base64\` tag for small binaries). The site must contain index.html at its root.
72570
+ NOT a site-creation tool: a request to create, build, design or generate a site — with or without a description — never comes here (those are the site-creation tools, after their own questions). Also NOT for media uploads to an existing site (UploadImageToWixSite) or any other API call (ExecuteWixAPI).
72559
72571
  `,
72560
72572
  StartDeployWebsite: dedent_default`
72561
- The user — or you, earlier in this conversation — ALREADY HAVE a finished page or site, in any form, and it should be live on Wix — or an already-deployed Wix Headless site whose files should be replaced. The site can be HTML/CSS/JS files, a static build (dist/, out/), a zip, another AI builder's export, or a page/design you created in this conversation (export it to HTML first — a finished design IS a finished page). Call this when the user says deploy, host, publish, put online, make it live, get a URL, update my site, or upload my site / index.html.
72573
+ The user — or you, earlier in this conversation — ALREADY HAVE a finished page or site, in any form, and it should be live on Wix — or an already-deployed Wix Headless site whose files should be replaced. The site can be HTML/CSS/JS files, a static build (dist/, out/), a zip, another AI builder's export, or a page/design you created in this conversation (export it to HTML first — a finished design IS a finished page). Call this when the user says deploy, host, put online, make it live, get a URL, upload my site / index.html, or wants to update or redeploy the files of a site you or the user deployed as code.
72562
72574
  Updates keep the same site and URL. Also for implementing a backend on such a site as a Wix Headless project — same site, same URL. Works with or without a Wix login (anonymous deploy with a save link), through the Wix MCP alone or from a shell.
72563
72575
  Missing real functionality — a fake checkout, a form that goes nowhere, bookings — is NOT a reason to rebuild the site with a site-creation tool: deploy the page as is, then add the backend afterwards (the recipe covers it).
72564
- Returns the full recipe; follow it and run the flow yourself. The drop page is only the fallback when you can't.
72565
- NOT for: a screenshot, mockup or reference image of a site the user WANTS (nothing exists to deploy yet — that is site creation: WixSiteBuilder / templates); a Claude Design share URL (import-claude-design-from-url); migrating a live site by URL or CSV exports; adding HTML or code into an existing Wix site; uploading images or documents to a site's media (UploadImageToWixSite).
72576
+ Returns the full recipe; follow it and run the flow yourself. When the UploadHeadlessWebsiteFiles tool is available, use it for the recipe's upload step — after the site exists (the recipe's provision call, or a metaSiteId from an earlier deploy) — instead of building the multipart body in code; never before this tool. The drop page is only the fallback when you can't.
72577
+ NOT for: a screenshot or reference of a site the user wants Wix to generate (the site-creation tools); a site described in words with no code yet (StartHeadlessBuild); a Wix editor site's content or settings (WixSiteBuilder's edit mode, or WixREADME); a Claude Design bundle URL (import-claude-design-from-url); migrating a live site by URL or CSV exports; adding HTML or code into an existing Wix site; uploading images or documents to a site's media (UploadImageToWixSite).
72566
72578
  `,
72567
- CreateWixBusinessGuide: dedent_default`
72568
- Provides comprehensive documentation for creating a new Wix business (site, app, etc.).
72569
- Call this ONLY when the user explicitly asks for a headless site, a Wix Classic Editor site, or manual/advanced account/API-based site creation — these don't need the site's purpose first. For normal site-creation ${SITE_CREATION_COPY.normalCreationRoute.nonWidget}; for a specific template id, call \`CreateSiteFromTemplate\`.
72570
- Exception, even when the user says "headless": if a finished page or site already exists in any form (their own HTML/CSS/JS, a static build, a zip, an AI-builder export, a page you made in this conversation) and they want it hosted, don't call this tool — call StartDeployWebsite, which returns the recipe to publish the files yourself. This guide's CLI flow is for BUILDING a headless frontend, not for hosting ready-made files.
72571
-
72572
- ## What This Tool Contains
72573
-
72574
- This tool provides complete documentation including:
72575
- - Template selection (empty sites or designed templates)
72576
- - Wix Editor vs Wix Studio options
72577
- - Regular vs Headless site creation (CLI-based; returns setup instructions)
72578
- - API endpoint details and parameters
72579
- - Post-creation steps (OAuth for headless, publishing for regular sites)
72580
- - App installation instructions
72581
-
72582
- ## After Reading This Documentation
72583
-
72584
- **After reading this documentation:**
72585
- 1. Use ManageWixSite for account-level site creation API calls
72586
- 2. Use CallWixSiteAPI / ExecuteWixAPI for site-level follow-up API calls (like install apps if needed)`
72579
+ StartHeadlessBuild: dedent_default`
72580
+ The user wants a site or web app that you build and keep changing in code, here with them, and no code exists yet. Wix runs its business side (store, bookings, CMS, forms, members, payments) as a Wix Headless site. Call this when the user asks you to build it yourself rather than Wix's AI or a template; when the two of you worked out a design in this conversation and nothing is coded yet; when it is an app (a game, a dashboard, a tool); when the user asks for a headless site; when a prompt links \`wix.com/headless/skill.md\` or a project's \`download.zip\`; or to move a Wix site to code.
72581
+ Call it right away: it only returns the guide, and the site's purpose is not needed first (pass "not stated yet" for what you don't know). Returns the full guide; follow it and do the work yourself, choosing its route by what you can reach (a shell that reaches Wix, or this MCP alone).
72582
+ NOT for: files, a build, a zip or a page that already exist (StartDeployWebsite); a site the user will design in Wix's editor (the site-creation tools); a Claude Design URL (import-claude-design-from-url).
72583
+ `
72587
72584
  };
72588
72585
  }
72589
72586
  var defaultToolDescriptions = buildToolDescriptions(true);
@@ -72592,9 +72589,9 @@ var recipesIndexDoc = {
72592
72589
  action: "include"
72593
72590
  };
72594
72591
  var README_INTRO = dedent_default`
72595
- <agent-mandatory-instructions>
72592
+ <wix-usage-guide>
72596
72593
 
72597
- YOU MUST READ AND FOLLOW THE AGENT-MANDATORY-INSTRUCTIONS BELOW:
72594
+ How to work with Wix through these tools:
72598
72595
 
72599
72596
  <source-of-truth>
72600
72597
  Do not answer from memory about anything Wix-specific — this covers every part of your answer, not only API calls: any URL, link, ID, setting location, or product fact you give the user must come from the docs tools, the recipes below, a previous tool result in this conversation, or the user's own message (identifiers and URLs the user supplies are fine to use as given). If a recipe in the index below matches what the user asked for, read it before answering. For APIs, use the search, browse, read-docs, and schema tools as the source of truth for the exact URL, HTTP method, request body shape, response shape, field names, required fields, and enum values before calling an API.
@@ -72646,7 +72643,7 @@ var README_BODY = dedent_default`
72646
72643
  <other-uses>
72647
72644
  Beyond managing user sites, the Wix MCP tools can be used for any other purpose they support — for example, reading Wix SDK docs to write code against the SDK, using the Wix CLI to create apps, answering documentation questions, and so on.
72648
72645
  </other-uses>
72649
- </agent-mandatory-instructions>
72646
+ </wix-usage-guide>
72650
72647
  `;
72651
72648
  var defaultReadmeDocs = [
72652
72649
  {
@@ -72667,8 +72664,7 @@ var widgetSiteCreationConfig = {
72667
72664
  "WixSiteBuilder",
72668
72665
  "WixSiteCreation",
72669
72666
  "SearchSiteTemplates",
72670
- "CreateSiteFromTemplate",
72671
- "CreateWixBusinessGuide"
72667
+ "CreateSiteFromTemplate"
72672
72668
  ].map((tool) => [tool, toWidget(defaultToolDescriptions[tool])])
72673
72669
  )
72674
72670
  };
@@ -73224,7 +73220,7 @@ var paramDescriptions = {
73224
73220
  },
73225
73221
  SearchWixRESTDocumentation: {
73226
73222
  searchTerm: `The search term to look up in the Wix REST API Documentation \u2014 a natural-language description of the endpoint, resource, or action you need across any Wix domain (Stores, eCommerce, Bookings, CRM, Members, CMS, Events, Blog, Forms, Media, site settings, etc.), e.g. "create a catalog item with inventory", "book a service", "update data collection items". Match the wording to how many entities you will act on: a plural term ("update products") surfaces the resource's bulk methods, which a singular term ("update a product") ranks lower or leaves out. Results are ranked by relevance, so describe the goal rather than guessing an exact API name.`,
73227
- maxResults: "The maximum number of results to return, default is 10, max is 15",
73223
+ maxResults: "The maximum number of results to return (1\u201317, default 17). Results mix REST API documentation with matching recipes and skills.",
73228
73224
  reason: "One sentence describing the original user request and the task you are trying to accomplish with this search."
73229
73225
  },
73230
73226
  WixBusinessFlowsDocumentation: {
@@ -73245,7 +73241,7 @@ var paramDescriptions = {
73245
73241
  },
73246
73242
  SearchWixHeadlessDocumentation: {
73247
73243
  searchTerm: "The search term to search for in the Headless Documentation",
73248
- maxResults: "The maximum number of results to return, default is 10, max is 15"
73244
+ maxResults: "The maximum number of results to return (1\u201317, default 17). Results mix Headless documentation with matching recipes and skills."
73249
73245
  },
73250
73246
  SearchWixVeloDocumentation: {
73251
73247
  searchTerm: "The search term to search for in the Velo Documentation",
@@ -73257,7 +73253,7 @@ var paramDescriptions = {
73257
73253
  reason: "One sentence describing the original user request and the task you are trying to accomplish with this search."
73258
73254
  },
73259
73255
  ReadFullDocsArticle: {
73260
- articleUrl: "The URL of the docs article or method article to fetch. Should be something like https://dev.wix.com/docs/.../... For REST docs, use the URL as-is. For SDK docs, the URL SHOULD include the query param ?apiView=SDK (e.g. https://dev.wix.com/docs/...?apiView=SDK). Wix skills pages (https://www.wix.com/skills/..., https://dev.wix.com/docs/skills/...) are read as-is, including their referenced files."
73256
+ articleUrl: "The URL of the docs article or method article to fetch. Should be something like https://dev.wix.com/docs/.../... For REST docs, use the URL as-is. For SDK docs, the URL SHOULD include the query param ?apiView=SDK (e.g. https://dev.wix.com/docs/...?apiView=SDK). Wix skills pages (https://www.wix.com/skills/..., https://dev.wix.com/docs/skills/...) and Wix Headless agent pages (https://www.wix.com/headless/..., e.g. https://www.wix.com/headless/skill.md) are read as-is, including their referenced files."
73261
73257
  },
73262
73258
  ReadFullDocsMethodSchema: {
73263
73259
  articleUrl: "The URL of the documentation to fetch. Should be something like https://dev.wix.com/docs/.../... For REST docs, use the URL as-is. For SDK docs, the URL SHOULD include the query param ?apiView=SDK (e.g. https://dev.wix.com/docs/...?apiView=SDK).",
@@ -73273,7 +73269,7 @@ var paramDescriptions = {
73273
73269
  },
73274
73270
  UploadImageToWixSite: {
73275
73271
  siteId: "The ID (UUID) of the Wix site to upload to. REQUIRED. If the user has not clearly specified which site, ASK them which site to upload to (or use ListWixSites to help them pick) BEFORE calling this tool. NEVER call this tool with a missing, empty, placeholder, or guessed siteId \u2014 ask first instead.",
73276
- image: "Array of file ATTACHMENTS the user uploaded in the chat. Each item requires download_url and file_id, and may optionally include file_name and mime_type \u2014 attached files are automatically resolved to these fields by the platform, so just include them here. For plain image URLs the user pasted, use imageUrls instead. ALWAYS pass ALL attachments together in a single call \u2014 NEVER call this tool once per image. Do NOT use together with imageBase64.",
73272
+ image: "Array of file ATTACHMENTS: files the user uploaded in the chat, or files you created in your own file sandbox. Each item requires download_url and file_id, and may optionally include file_name and mime_type \u2014 the platform resolves a file passed here into these fields automatically, so just include the files. For plain image URLs the user pasted, use imageUrls instead. ALWAYS pass ALL attachments together in a single call \u2014 NEVER call this tool once per image. Do NOT use together with imageBase64.",
73277
73273
  imageUrls: "Array of publicly accessible image URLs (e.g. links the user pasted or URLs produced by other tools). Use this for plain URLs that are NOT chat attachments \u2014 no file_id is needed. ALWAYS pass ALL URLs together in a single call. Can be combined with image; do NOT use together with imageBase64.",
73278
73274
  imageBase64: 'Base64-encoded image data. Use when the client can read a file and encode it as base64. May include a data URL prefix (e.g. "data:image/jpeg;base64,...") or be raw base64. Do NOT use together with image.',
73279
73275
  mimeType: 'MIME type of the image (e.g. "image/jpeg", "image/png", "image/webp"). Required when imageBase64 does not include a data URL prefix.',
@@ -73297,7 +73293,7 @@ var paramDescriptions = {
73297
73293
  operationName: "Operation to run when the document defines more than one named operation.",
73298
73294
  siteId: "The Wix site to run against. Required for site-level operations (anything reading or writing inside a site \u2014 products, orders, contacts, bookings, CMS, blog, members ...). Resolve it with GetSiteContext or ListWixSites; never pass a guessed value.",
73299
73295
  scope: '"site" (default when siteId is given) runs with a site-scoped credential; "account" runs account-level operations (sites, account settings) and ignores siteId.',
73300
- hasMutations: "Whether this document creates, updates, deletes or otherwise mutates Wix data. True for any mutation root field (in any operation of the document) even when the intent is inspection; false only for pure queries. This flag alone decides whether a transient server error may be retried, so never mark a document that writes as false.",
73296
+ hasMutations: "True if the document contains a mutation root field in any of its operations; false if it contains only queries. A transient server error is retried only when this is false.",
73301
73297
  reason: "One sentence explaining the original user request and why you are running this GraphQL operation to complete it."
73302
73298
  },
73303
73299
  RunWixCliCommand: {
@@ -73561,121 +73557,6 @@ ${skillsContent}`
73561
73557
  );
73562
73558
  }
73563
73559
 
73564
- // src/docs/create-site-guide.ts
73565
- function isHeadlessRequest(prompt) {
73566
- return !!prompt && /headless/i.test(prompt);
73567
- }
73568
- var HEADLESS_NON_CLI_INSTRUCTIONS = `# Creating a Wix Headless Site
73569
-
73570
- Wix Headless sites require the **Wix CLI** and cannot be created from the Wix dashboard or via REST API alone. Let the user know they need to set up a local development environment with the Wix CLI before proceeding.
73571
-
73572
- ## Prerequisites
73573
- - Node.js 18+
73574
- - A terminal / command-line environment
73575
-
73576
- ## Steps to Get Started
73577
-
73578
- 1. **Install and authenticate the Wix CLI:**
73579
- \`\`\`
73580
- npx @wix/cli login
73581
- \`\`\`
73582
- 2. **Follow the quick-start guide:** https://dev.wix.com/docs/go-headless
73583
- 3. **For a complete orchestrated setup** (commerce, CMS, bookings, identity), use the Wix Headless skill: https://www.wix-headless.dev/skill.md`;
73584
- var HEADLESS_CLI_INSTRUCTIONS = `# Creating a Wix Headless Site (CLI Flow)
73585
-
73586
- Follow these steps using the \`RunWixCliCommand\` tool to scaffold and configure a Wix Headless site.
73587
-
73588
- ## Before You Start
73589
- Ask the user:
73590
- 1. What is the brand/site name?
73591
- 2. Which local directory should the project be created in?
73592
-
73593
- ## Steps
73594
-
73595
- ### Step 1 \u2014 Authenticate (if not already done)
73596
- Run: \`npx @wix/cli login\`
73597
- Skip if the user is already authenticated.
73598
-
73599
- ### Step 2 \u2014 Scaffold the project
73600
- Use a Wix headless starter template. Ask the user which starter they prefer, or use the default Next.js starter. Follow the scaffolding instructions at: https://dev.wix.com/docs/go-headless
73601
-
73602
- ### Step 3 \u2014 Install dependencies
73603
- Run: \`npm install\` in the project directory.
73604
-
73605
- ### Step 4 \u2014 Pull environment variables
73606
- Run: \`npx @wix/cli env pull\`
73607
- This writes the \`.env.local\` file with the site's environment variables.
73608
-
73609
- ### Step 5 \u2014 Build and verify
73610
- Run: \`npx @wix/cli build\`
73611
-
73612
- ### Step 6 \u2014 Release (optional)
73613
- Run: \`npx @wix/cli release\` to deploy.
73614
-
73615
- ## Full Orchestration
73616
- For a complete multi-wave headless setup (commerce, CMS, bookings, design system, content seeding), refer to the Wix Headless skill: https://www.wix-headless.dev/skill.md
73617
-
73618
- Use \`RunWixCliCommand\` for each CLI step above.`;
73619
- var CREATE_SITE_DOCS = [
73620
- {
73621
- url: "https://dev.wix.com/docs/kb-only/MCP_REST_RECIPES_KB_ID/TRAIN_create_a_new_site_from_template",
73622
- title: "How to Create a New Wix Site",
73623
- nextSteps: "\n\n**Next Steps:** Use the ManageWixSite tool to make the API call for creating the Wix site."
73624
- },
73625
- {
73626
- url: "https://dev.wix.com/docs/kb-only/MCP_REST_RECIPES_KB_ID/TRAIN_wix.devcenter.apps.installer.v1.AppsInstallerService.InstallApp",
73627
- title: "How to Install App on a Wix Site",
73628
- nextSteps: "\n\n**Next Steps:** Use the CallWixSiteAPI tool to make the API call for installing apps on the Wix site."
73629
- }
73630
- ];
73631
- async function addCreateWixBusinessGuideTools(server2, disableTools = [], toolDescriptions, cliEnabled = false) {
73632
- if (disableTools.includes("CreateWixBusinessGuide")) {
73633
- return;
73634
- }
73635
- server2.tool(
73636
- "CreateWixBusinessGuide",
73637
- toolDescriptions?.["CreateWixBusinessGuide"] ?? defaultToolDescriptions.CreateWixBusinessGuide,
73638
- {
73639
- userPrompt: external_exports.string().optional().describe("The user prompt that triggered this tool")
73640
- },
73641
- { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
73642
- async (args, { httpClient }) => {
73643
- if (isHeadlessRequest(args.userPrompt)) {
73644
- const isCli = typeof cliEnabled === "function" ? cliEnabled() : cliEnabled;
73645
- const text = isCli ? HEADLESS_CLI_INSTRUCTIONS : HEADLESS_NON_CLI_INSTRUCTIONS;
73646
- return { content: [{ type: "text", text }] };
73647
- }
73648
- try {
73649
- const contents = await Promise.all(
73650
- CREATE_SITE_DOCS.map(async ({ url, title, nextSteps }) => {
73651
- const articleContent = await fetchArticleContent(
73652
- httpClient,
73653
- url,
73654
- "article",
73655
- true
73656
- );
73657
- const fullContent = `# ${title}
73658
-
73659
- ${articleContent}${nextSteps}`;
73660
- return { type: "text", text: fullContent };
73661
- })
73662
- );
73663
- return { content: contents };
73664
- } catch (error2) {
73665
- return {
73666
- isError: true,
73667
- content: [
73668
- {
73669
- type: "text",
73670
- text: `Error fetching create site documentation: ${error2.message}`
73671
- }
73672
- ]
73673
- };
73674
- }
73675
- }
73676
- );
73677
- }
73678
-
73679
73560
  // src/docs/start-deploy-website.ts
73680
73561
  var START_DEPLOY_WEBSITE_PARAM_DESCRIPTIONS = {
73681
73562
  userRequest: "The user's request that led here, quoted if short, otherwise summarized in a sentence.",
@@ -73747,6 +73628,87 @@ function addStartDeployWebsiteTool(server2, disableTools = [], toolDescriptions,
73747
73628
  );
73748
73629
  }
73749
73630
 
73631
+ // src/docs/start-headless-build.ts
73632
+ var START_HEADLESS_BUILD_TOOL_NAME = "StartHeadlessBuild";
73633
+ var HEADLESS_GUIDE_URL = "https://www.wix.com/skills/headless-cold-start/headless-kit.md";
73634
+ var START_HEADLESS_BUILD_STARTING_POINTS = [
73635
+ "nothing yet",
73636
+ "a design worked out in this conversation",
73637
+ "an existing Wix Headless site",
73638
+ "a project download link",
73639
+ "a Wix site to move to code"
73640
+ ];
73641
+ var START_HEADLESS_BUILD_PARAM_DESCRIPTIONS = {
73642
+ userRequest: START_DEPLOY_WEBSITE_PARAM_DESCRIPTIONS.userRequest,
73643
+ siteDescription: START_DEPLOY_WEBSITE_PARAM_DESCRIPTIONS.siteDescription,
73644
+ startingPoint: "What the build starts from: nothing yet; a design worked out in this conversation; an existing Wix Headless site; a project download link (a download.zip from Wix); or a Wix site to move to code.",
73645
+ siteFunctionality: START_DEPLOY_WEBSITE_PARAM_DESCRIPTIONS.siteFunctionality,
73646
+ agentIdentity: START_DEPLOY_WEBSITE_PARAM_DESCRIPTIONS.agentIdentity,
73647
+ wixAccess: START_DEPLOY_WEBSITE_PARAM_DESCRIPTIONS.wixAccess
73648
+ };
73649
+ var PREFIX2 = "The following is Wix's headless guide. Follow it end to end and do the work yourself. If you find the user already has the site's code, call StartDeployWebsite instead.";
73650
+ var MOVE_TO_CODE_LINE = `Moving a Wix site to code starts from the site's dashboard (Headless settings, "Go Headless"), which hands the owner a prompt with the project's download link. Ask the user for that prompt, then follow the guide with it.`;
73651
+ function startHeadlessBuildResponse(guide, startingPoint) {
73652
+ const lines = [];
73653
+ if (startingPoint === "a Wix site to move to code") {
73654
+ lines.push(MOVE_TO_CODE_LINE);
73655
+ }
73656
+ if (guide && guide.trim()) {
73657
+ lines.push(PREFIX2, "---", guide.trim());
73658
+ } else {
73659
+ lines.push(
73660
+ `Wix's headless guide could not be loaded here. It is at ${HEADLESS_GUIDE_URL}: read it whole with ReadFullDocsArticle if you have that tool, otherwise fetch it with curl or your web tool, then follow it end to end and do the work yourself. If you find the user already has the site's code, call StartDeployWebsite instead.`
73661
+ );
73662
+ }
73663
+ return lines.join("\n\n");
73664
+ }
73665
+ function addStartHeadlessBuildTool(server2, disableTools = [], toolDescriptions, fetchOptions = {}) {
73666
+ if (disableTools.includes(START_HEADLESS_BUILD_TOOL_NAME)) {
73667
+ return;
73668
+ }
73669
+ const d = START_HEADLESS_BUILD_PARAM_DESCRIPTIONS;
73670
+ server2.tool(
73671
+ START_HEADLESS_BUILD_TOOL_NAME,
73672
+ toolDescriptions?.[START_HEADLESS_BUILD_TOOL_NAME] ?? defaultToolDescriptions[START_HEADLESS_BUILD_TOOL_NAME],
73673
+ {
73674
+ userRequest: external_exports.string().min(1).describe(d.userRequest),
73675
+ siteDescription: external_exports.string().min(1).describe(d.siteDescription),
73676
+ startingPoint: external_exports.enum(START_HEADLESS_BUILD_STARTING_POINTS).describe(d.startingPoint),
73677
+ siteFunctionality: external_exports.string().min(1).describe(d.siteFunctionality),
73678
+ agentIdentity: external_exports.string().min(1).describe(d.agentIdentity),
73679
+ wixAccess: external_exports.string().min(1).describe(d.wixAccess)
73680
+ },
73681
+ { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
73682
+ async (args, { httpClient }) => {
73683
+ let guide;
73684
+ try {
73685
+ guide = await fetchArticleContent(
73686
+ httpClient,
73687
+ HEADLESS_GUIDE_URL,
73688
+ "article",
73689
+ true,
73690
+ fetchOptions.skillsPortalUrl,
73691
+ fetchOptions.repo,
73692
+ fetchOptions.commitHash
73693
+ );
73694
+ } catch (error2) {
73695
+ console.warn(
73696
+ "[StartHeadlessBuild] guide fetch failed, returning the pointer:",
73697
+ error2 instanceof Error ? error2.message : error2
73698
+ );
73699
+ }
73700
+ return {
73701
+ content: [
73702
+ {
73703
+ type: "text",
73704
+ text: startHeadlessBuildResponse(guide, args.startingPoint)
73705
+ }
73706
+ ]
73707
+ };
73708
+ }
73709
+ );
73710
+ }
73711
+
73750
73712
  // src/docs/docs.ts
73751
73713
  var VALID_DOCS_TOOLS = [
73752
73714
  "WDS",
@@ -73805,8 +73767,8 @@ var addDocsTools = (server2, allowedTools = [
73805
73767
  ], options = {}) => {
73806
73768
  const {
73807
73769
  getToKnowWixEnabled = false,
73808
- createWixBusinessGuideEnabled = true,
73809
73770
  startDeployWebsiteEnabled = true,
73771
+ startHeadlessBuildEnabled = true,
73810
73772
  disableTools,
73811
73773
  toolDescriptions,
73812
73774
  readmeDocs,
@@ -73818,7 +73780,6 @@ var addDocsTools = (server2, allowedTools = [
73818
73780
  commitHash,
73819
73781
  skillsTags,
73820
73782
  dynamicContextEnabled,
73821
- cliEnabled = false,
73822
73783
  usePlatformizedSearch = true,
73823
73784
  usePlatformizedBrowse = true
73824
73785
  } = options;
@@ -73864,14 +73825,6 @@ var addDocsTools = (server2, allowedTools = [
73864
73825
  skillsTags
73865
73826
  });
73866
73827
  }
73867
- if (createWixBusinessGuideEnabled && !disableTools?.includes("CreateWixBusinessGuide")) {
73868
- addCreateWixBusinessGuideTools(
73869
- server2,
73870
- disableTools || [],
73871
- toolDescriptions,
73872
- cliEnabled
73873
- );
73874
- }
73875
73828
  if (startDeployWebsiteEnabled) {
73876
73829
  addStartDeployWebsiteTool(server2, disableTools || [], toolDescriptions, {
73877
73830
  skillsPortalUrl,
@@ -73879,6 +73832,13 @@ var addDocsTools = (server2, allowedTools = [
73879
73832
  commitHash: effectiveCommitHash
73880
73833
  });
73881
73834
  }
73835
+ if (startHeadlessBuildEnabled) {
73836
+ addStartHeadlessBuildTool(server2, disableTools || [], toolDescriptions, {
73837
+ skillsPortalUrl,
73838
+ repo: effectiveRepo,
73839
+ commitHash: effectiveCommitHash
73840
+ });
73841
+ }
73882
73842
  if (allowedTools.includes("WDS") && !disableTools?.includes("SearchWixWDSDocumentation")) {
73883
73843
  server2.tool(
73884
73844
  "SearchWixWDSDocumentation",
@@ -73943,7 +73903,7 @@ var addDocsTools = (server2, allowedTools = [
73943
73903
  const d = desc("SearchWixRESTDocumentation");
73944
73904
  return {
73945
73905
  searchTerm: external_exports.string().describe(d.searchTerm),
73946
- maxResults: external_exports.number().describe(d.maxResults).min(1).max(15).optional().default(15),
73906
+ maxResults: external_exports.number().describe(d.maxResults).min(1).max(17).optional().default(17),
73947
73907
  reason: external_exports.string().describe(d.reason)
73948
73908
  };
73949
73909
  })(),
@@ -73958,9 +73918,12 @@ var addDocsTools = (server2, allowedTools = [
73958
73918
  toolParams: {
73959
73919
  searchTerm
73960
73920
  },
73961
- maxResults: Math.max(1, Math.min(maxResults ?? 15, 15)),
73921
+ maxResults: Math.max(1, Math.min(maxResults ?? 17, 17)),
73962
73922
  linesInEachResult: 30,
73963
- usePlatformizedSearch
73923
+ usePlatformizedSearch,
73924
+ // Merge recipes/skills into the REST ranking — they live in a
73925
+ // separate corpus the REST document_type doesn't cover on its own.
73926
+ extraDocumentTypes: ["SKILLS"]
73964
73927
  });
73965
73928
  const grounding = result.includes(QUERY_CAPABILITY_MARKER) ? [
73966
73929
  REST_SEARCH_API_GROUNDING_REMINDER,
@@ -74223,7 +74186,7 @@ var addDocsTools = (server2, allowedTools = [
74223
74186
  const d = desc("SearchWixHeadlessDocumentation");
74224
74187
  return {
74225
74188
  searchTerm: external_exports.string().describe(d.searchTerm),
74226
- maxResults: external_exports.number().describe(d.maxResults).min(1).max(15).optional().default(15)
74189
+ maxResults: external_exports.number().describe(d.maxResults).min(1).max(17).optional().default(17)
74227
74190
  };
74228
74191
  })(),
74229
74192
  { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
@@ -74235,8 +74198,11 @@ var addDocsTools = (server2, allowedTools = [
74235
74198
  toolParams: {
74236
74199
  searchTerm
74237
74200
  },
74238
- maxResults: Math.max(1, Math.min(maxResults ?? 15, 15)),
74239
- usePlatformizedSearch
74201
+ maxResults: Math.max(1, Math.min(maxResults ?? 17, 17)),
74202
+ usePlatformizedSearch,
74203
+ // Merge recipes/skills into the headless ranking — same separate
74204
+ // corpus the WIX_HEADLESS document_type doesn't cover on its own.
74205
+ extraDocumentTypes: ["SKILLS"]
74240
74206
  });
74241
74207
  return {
74242
74208
  content: [
@@ -74402,7 +74368,7 @@ var addDocsTools = (server2, allowedTools = [
74402
74368
  content: [
74403
74369
  {
74404
74370
  type: "text",
74405
- text: `Invalid article URL: must start with https://dev.wix.com/docs/, or be a Wix skills page (https://www.wix.com/skills/...). Got: "${articleUrl}"`
74371
+ text: `Invalid article URL: must start with https://dev.wix.com/docs/, or be a Wix skills page (https://www.wix.com/skills/..., https://www.wix.com/headless/...). Got: "${articleUrl}"`
74406
74372
  }
74407
74373
  ]
74408
74374
  };
@@ -85696,6 +85662,10 @@ var WixMcpServer = class extends McpServer {
85696
85662
  getSessionId() {
85697
85663
  return this.sessionId;
85698
85664
  }
85665
+ /** The connected client's name: the host's getter (User-Agent fallback) first, then clientInfo. */
85666
+ clientName() {
85667
+ return this.getClientName?.() ?? this.server.getClientVersion()?.name;
85668
+ }
85699
85669
  setClientNameGetter(getClientName) {
85700
85670
  this.getClientName = getClientName;
85701
85671
  }
@@ -86430,10 +86400,12 @@ function addApiCallTool(server2, strategy, allowedTools = ["CallWixSiteAPI", "Li
86430
86400
  sourceDocUrl: external_exports.string().describe(d.sourceDocUrl)
86431
86401
  };
86432
86402
  })(),
86403
+ // openWorldHint true: a free-form URL into the whole Wix REST surface is an
86404
+ // open-ended target, even though auth is bounded to the user's account.
86433
86405
  getHints("CallWixSiteAPI", {
86434
86406
  readOnlyHint: false,
86435
86407
  destructiveHint: true,
86436
- openWorldHint: false
86408
+ openWorldHint: true
86437
86409
  }),
86438
86410
  async ({ url, body, method, siteId, reason, sourceDocUrl }, { httpClient, setToolBiParams }) => {
86439
86411
  logger2.log(
@@ -86610,7 +86582,7 @@ function addApiCallTool(server2, strategy, allowedTools = ["CallWixSiteAPI", "Li
86610
86582
  getHints("ManageWixSite", {
86611
86583
  readOnlyHint: false,
86612
86584
  destructiveHint: true,
86613
- openWorldHint: false
86585
+ openWorldHint: true
86614
86586
  }),
86615
86587
  async ({ url, body, method, reason }, { httpClient, setToolBiParams }) => {
86616
86588
  logger2.log(
@@ -87623,7 +87595,8 @@ function addExecuteGraphqlTool(server2, description, authStrategy, options) {
87623
87595
  hasMutations: external_exports.boolean().describe(d.hasMutations),
87624
87596
  reason: external_exports.string().describe(d.reason)
87625
87597
  },
87626
- { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
87598
+ // openWorldHint true: any operation in the Wix GraphQL schema, chosen at call time.
87599
+ { readOnlyHint: false, destructiveHint: true, openWorldHint: true },
87627
87600
  async ({ query, variables, operationName, siteId, scope, hasMutations, reason }, extra) => {
87628
87601
  const effectiveScope = scope ?? (siteId ? "site" : "account");
87629
87602
  logger2.log(
@@ -87723,6 +87696,7 @@ var EXPERIMENTAL_TOOLS = [
87723
87696
  "CLI_COMMAND",
87724
87697
  "GET_TO_KNOW_WIX",
87725
87698
  "CREATE_WIX_BUSINESS_GUIDE",
87699
+ // accepted so old configs still start; the tool was removed
87726
87700
  "VELO_README",
87727
87701
  "WIX_API_THROUGH_FS",
87728
87702
  "GRAPHQL"
@@ -87793,18 +87767,12 @@ var docsTools = activeTools.filter(
87793
87767
  );
87794
87768
  var isWixCliAuth = Boolean(parsedArgs["wixCliAuth"]);
87795
87769
  var hasGetToKnowWix = activeTools.includes("GET_TO_KNOW_WIX") || isWixCliAuth;
87796
- var hasCreateWixBusinessGuide = activeTools.includes(
87797
- "CREATE_WIX_BUSINESS_GUIDE"
87798
- );
87799
87770
  var hasDynamicContext = Boolean(parsedArgs["dynamicContext"]) || isWixCliAuth;
87800
- if (docsTools.length > 0 || hasGetToKnowWix || hasCreateWixBusinessGuide) {
87771
+ if (docsTools.length > 0 || hasGetToKnowWix) {
87801
87772
  logger2.log("Adding docs tools:", docsTools);
87802
87773
  addDocsTools(server, docsTools, {
87803
87774
  getToKnowWixEnabled: hasGetToKnowWix,
87804
- createWixBusinessGuideEnabled: hasCreateWixBusinessGuide,
87805
- dynamicContextEnabled: hasDynamicContext,
87806
- cliEnabled: true
87807
- // bin.ts is always a CLI client (e.g. Claude Code)
87775
+ dynamicContextEnabled: hasDynamicContext
87808
87776
  });
87809
87777
  }
87810
87778
  if (activeTools.includes("VELO_README")) {