@wix/mcp 1.0.6 → 1.0.7

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.
@@ -0,0 +1,4 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare const VALID_CLI_TOOLS: readonly ["WIX_API", "CLI_COMMAND", "CLI_COMMAND_INTERACTIVE_MODE"];
3
+ export type CLITool = (typeof VALID_CLI_TOOLS)[number];
4
+ export declare function addCliTools(server: McpServer, allowedTools?: CLITool[], isWixOne?: boolean): void;
@@ -0,0 +1,2 @@
1
+ export declare function getCliAuthTokenForSiteId(siteIdOrAccountsFileName: string): string;
2
+ export declare function getSiteIdFromCliAppConfig(appPath: string): any;
@@ -0,0 +1,4 @@
1
+ import type { WixMcpServer } from '../wix-mcp-server.js';
2
+ export declare const VALID_DOCS_TOOLS: readonly ["WDS", "REST", "SDK", "BUILD_APPS", "WIX_HEADLESS", "BUSINESS_SOLUTIONS"];
3
+ export type DocsTool = (typeof VALID_DOCS_TOOLS)[number];
4
+ export declare const addDocsTools: (server: WixMcpServer, allowedTools?: DocsTool[]) => void;
@@ -0,0 +1 @@
1
+ export declare const LONG_KB_CONTENT = "# Method name:\n\ncrm.contacts.queryContacts(options: QueryContactsOptions)\n\n# Method Link:\n\nhttps://dev.wix.com/docs/sdk/backend-modules/crm/contacts/query-contacts\n\n# Method Description:\n\nCreates a query to retrieve a list of contacts.\n\nThe `queryContacts()` function builds a query to retrieve a list of contacts and returns a `ContactsQueryBuilder` object.\n\nThe returned object contains the query definition, which is typically used to run the query using the `find()` function.\n\nYou can refine the query by chaining `ContactsQueryBuilder` functions onto the query. `ContactsQueryBuilder` functions enable you to sort, filter, and control the results `queryContacts()` returns.\n\n`queryContacts()` runs with these `ContactsQueryBuilder` defaults, which you can override:\n\n- `skip(0)`\n- `limit(50)`\n- `descending(\"_createdDate\")`\n\nThe functions that are chained to `queryContacts()` are applied in the order they are called. For example, if you apply `ascending('info.company')` and then `descending('info.name.last')`, the results are sorted first by the company name, and then, if there are multiple results with the same company, the items are sorted by last name.\n\n\n|PROPERTY\t|SUPPORTED FILTERS & SORTING\t\n|:---:|:---:|\n|`_id`|[`eq()`](/contacts-query-builder/eq),[`ne()`](/contacts-query-builder/ne),[`in()`](/contacts-query-builder/in),[`exists()`](/contacts-query-builder/exists)|\n|`_createdDate`|[`eq()`](/contacts-query-builder/eq),[`ne()`](/contacts-query-builder/ne),[`gt()`](/contacts-query-builder/gt),[`lt()`](/contacts-query-builder/lt),[`ge()`](/contacts-query-builder/ge),[`le()`](/contacts-query-builder/le),[`ascending()`](/contacts-query-builder/ascending),[`descending()`](/contacts-query-builder/descending)|\n|`_updatedDate`|[`eq()`](/contacts-query-builder/eq),[`ne()`](/contacts-query-builder/ne),[`gt()`](/contacts-query-builder/gt),[`lt()`](/contacts-query-builder/lt),[`ge()`](/contacts-query-builder/ge),[`le()`](/contacts-query-builder/le)|\n|`lastActivity.activityDate`|[`eq()`](/contacts-query-builder/eq),[`ne()`](/contacts-query-builder/ne),[`gt()`](/contacts-query-builder/gt),[`lt()`](/contacts-query-builder/lt),[`ge()`](/contacts-query-builder/ge),[`le()`](/contacts-query-builder/le),[`ascending()`](/contacts-query-builder/ascending),[`descending()`](/contacts-query-builder/descending)|\n|`primaryInfo.email`|[`eq()`](/contacts-query-builder/eq),[`ne()`](/contacts-query-builder/ne),[`in()`](/contacts-query-builder/in),[`exists()`](/contacts-query-builder/exists),[`startsWith()`](/contacts-query-builder/starts-with),[`ascending()`](/contacts-query-builder/ascending),[`descending()`](/contacts-query-builder/descending)|\n|`primaryInfo.phone`|[`eq()`](/contacts-query-builder/eq),[`ne()`](/contacts-query-builder/ne),[`in()`](/contacts-query-builder/in),[`exists()`](/contacts-query-builder/exists),[`startsWith()`](/contacts-query-builder/starts-with)|\n|`info.name.first`|[`eq()`](/contacts-query-builder/eq),[`ne()`](/contacts-query-builder/ne),[`in()`](/contacts-query-builder/in),[`exists()`](/contacts-query-builder/exists),[`startsWith()`](/contacts-query-builder/starts-with),[`ascending()`](/contacts-query-builder/ascending),[`descending()`](/contacts-query-builder/descending)|\n|`info.name.last`|[`eq()`](/contacts-query-builder/eq),[`ne()`](/contacts-query-builder/ne),[`in()`](/contacts-query-builder/in),[`exists()`](/contacts-query-builder/exists),[`startsWith()`](/contacts-query-builder/starts-with),[`ascending()`](/contacts-query-builder/ascending),[`descending()`](/contacts-query-builder/descending)|\n|`info.company`|[`eq()`](/contacts-query-builder/eq),[`ne()`](/contacts-query-builder/ne),[`in()`](/contacts-query-builder/in),[`exists()`](/contacts-query-builder/exists),[`startsWith()`](/contacts-query-builder/starts-with),[`ascending()`](/contacts-query-builder/ascending),[`descending()`](/contacts-query-builder/descending)|\n|`info.jobTitle`|[`eq()`](/contacts-query-builder/eq),[`ne()`](/contacts-query-builder/ne),[`in()`](/contacts-query-builder/in),[`exists()`](/contacts-query-builder/exists),[`startsWith()`](/contacts-query-builder/starts-with),[`ascending()`](/contacts-query-builder/ascending),[`descending()`](/contacts-query-builder/descending)|\n|`info.birthdate`|[`eq()`](/contacts-query-builder/eq),[`ne()`](/contacts-query-builder/ne),[`ascending()`](/contacts-query-builder/ascending),[`descending()`](/contacts-query-builder/descending)|\n|`info.locale`|[`eq()`](/contacts-query-builder/eq),[`ne()`](/contacts-query-builder/ne),[`in()`](/contacts-query-builder/in),[`exists()`](/contacts-query-builder/exists)|\n\n# Method Permissions:\n\n- Manage Events\n- Read Contacts\n- Read Members and Contacts - all read permissions\n- Manage Restaurants - all permissions\n- Manage Contacts\n- Set Up Automations\n- Manage Members and Contacts - all permissions\n\n# Method Permissions Scopes IDs:\n\n- SCOPE.EVENTS.MANAGE-EVENTS\n- SCOPE.DC-CONTACTS.READ-CONTACTS\n- SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS\n- SCOPE.RESTAURANTS.MEGA-SCOPES\n- SCOPE.DC-CONTACTS.MANAGE-CONTACTS\n- SCOPE.CRM.SETUP-AUTOMATIONS\n- SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n\n# Method Schema Summary:\n\n# API Method Summary: `queryContacts`\n\n## Method Signature\n```javascript\ncrm.contacts.queryContacts(options)\n```\n\n## Description\nThe `queryContacts()` method creates a query to retrieve a list of contacts and returns a `ContactsQueryBuilder` object. This object allows for further refinement of the query through chaining methods to sort, filter, and control the results. The default settings for the query are:\n- `skip(0)`\n- `limit(50)`\n- `descending(\"_createdDate\")`\n\n## Parameters\n- **options**: `QueryContactsOptions`\n - Description: Options for querying contacts.\n\n## Return Type\n- **REFERENCE<ContactsQueryBuilder>**: The method returns a `ContactsQueryBuilder` object that can be used to refine the query further.\n\n## Supported Filters & Sorting\nThe following properties can be used for filtering and sorting, along with their supported functions:\n\n| Property | Supported Functions |\n|------------------------------|---------------------------------------------------------------------------------------------------------|\n| `_id` | `eq()`, `ne()`, `in()`, `exists()` |\n| `_createdDate` | `eq()`, `ne()`, `gt()`, `lt()`, `ge()`, `le()`, `ascending()`, `descending()` |\n| `_updatedDate` | `eq()`, `ne()`, `gt()`, `lt()`, `ge()`, `le()` |\n| `lastActivity.activityDate` | `eq()`, `ne()`, `gt()`, `lt()`, `ge()`, `le()`, `ascending()`, `descending()` |\n| `primaryInfo.email` | `eq()`, `ne()`, `in()`, `exists()`, `startsWith()`, `ascending()`, `descending()` |\n| `primaryInfo.phone` | `eq()`, `ne()`, `in()`, `exists()`, `startsWith()` |\n| `info.name.first` | `eq()`, `ne()`, `in()`, `exists()`, `startsWith()`, `ascending()`, `descending()` |\n| `info.name.last` | `eq()`, `ne()`, `in()`, `exists()`, `startsWith()`, `ascending()`, `descending()` |\n| `info.company` | `eq()`, `ne()`, `in()`, `exists()`, `startsWith()`, `ascending()`, `descending()` |\n| `info.jobTitle` | `eq()`, `ne()`, `in()`, `exists()`, `startsWith()`, `ascending()`, `descending()` |\n| `info.birthdate` | `eq()`, `ne()`, `ascending()`, `descending()` |\n| `info.locale` | `eq()`, `ne()`, `in()`, `exists()` |\n\n## Enum Properties\nThe following properties have limited allowed values (enums):\n\n- **lastActivity.activityType**: \n - Valid values: `ARENA_NEW_LEAD`, `BOOKINGS_APPOINTMENT`, `CASHIER_BUTTON_PURCHASE`, `CONTACT_CREATED`, `CONTACT_MERGED`, `ECOM_CART_ABANDON`, `ECOM_CHECKOUT_BUYER`, `ECOM_PURCHASE`, `EVENTS_RSVP`, `FORM_SUBMITTED`, `GENERAL`, `HOTELS_CANCEL`, `HOTELS_CONFIRMATION`, `HOTELS_PURCHASE`, `HOTELS_RESERVATION`, `INBOX_FORM_SUBMITTED`, `INBOX_MESSAGE_FROM_CUSTOMER`, `INBOX_MESSAGE_TO_CUSTOMER`, `INBOX_PAYMENT_REQUEST_PAID`, `INVOICE_OVERDUE`, `INVOICE_PAY`, `MEMBER_LOGIN`, `MEMBER_REGISTER`, `MEMBER_STATUS_CHANGED`, `NEWSLETTER_SUBSCRIPTION_FORM_SUBMITTED`, `NEWSLETTER_SUBSCRIPTION_NOT_SET`, `NEWSLETTER_SUBSCRIPTION_PENDING`, `NEWSLETTER_SUBSCRIPTION_SUBSCRIBE`, `NEWSLETTER_SUBSCRIPTION_UNSUBSCRIBE`, `PHONE_SUBSCRIPTION_NOT_SET`, `PHONE_SUBSCRIPTION_PENDING`, `PHONE_SUBSCRIPTION_SUBSCRIBE`, `PHONE_SUBSCRIPTION_UNSUBSCRIBE`, `PRICE_QUOTE_ACCEPT`, `PRICE_QUOTE_EXPIRE`, `RESTAURANTS_ORDER`, `RESTAURANTS_RESERVATION`, `SHOUTOUT_CLICK`, `SHOUTOUT_OPEN`, `VIDEO_PURCHASE`, `VIDEO_RENT`\n\n- **primaryEmail.deliverabilityStatus**: \n - Valid values: `BOUNCED`, `INACTIVE`, `NOT_SET`, `SPAM_COMPLAINT`, `VALID`\n\n- **primaryEmail.subscriptionStatus**: \n - Valid values: `NOT_SET`, `NO_SUBSCRIPTION_STATUS`, `PENDING`, `SUBSCRIBED`, `UNSUBSCRIBED`\n\n- **primaryPhone.subscriptionStatus**: \n - Valid values: `NOT_SET`, `NO_SUBSCRIPTION_STATUS`\n\n- **info.emails.items[].tag**: \n - Valid values: `HOME`, `MAIN`, `UNTAGGED`, `WORK`\n\n- **info.phones.items[].tag**: \n - Valid values: `FAX`, `HOME`, `MAIN`, `MOBILE`, `UNTAGGED`, `WORK`\n\n- **items[].info.addresses.items[].tag**: \n - Valid values: `BILLING`, `HOME`, `SHIPPING`, `UNTAGGED`, `WORK`\n\n**Note**: Ensure to use the correct enum values when filtering or sorting based on these properties. \n\n## Possible Errors\nThe following errors may occur when using this method:\n- **400 INVALID_ARGUMENT**: Various application codes indicating unsupported filter value types, unsupported filter values, unsupported filter operators, unsupported filter fields, malformed filters, illegal limits, or unsupported sort fields.\n\n# Method Code Examples:\n\n## queryContacts\n\n```javascript\nimport { contacts } from '@wix/crm';\n\nasync function queryContacts() {\n const { items } = await contacts.queryContacts().find();\n};\n```\n\n\n\n## default\n\n```javascript\ntry {\n const { items } = await contacts.queryContacts().find();\n return items;\n } catch (error) {\n console.error(error);\n throw error;\n }\n````";
@@ -0,0 +1,10 @@
1
+ import type { DocsTool } from './docs.js';
2
+ export declare const MAX_CONTENT_LENGTH = 10000;
3
+ export declare const DEFAULT_MAX_RESULTS = 10;
4
+ export declare const runSemanticSearchAndFormat: ({ toolName, toolParams, maxResults, rerank, linesInEachResult }: {
5
+ toolName: DocsTool;
6
+ toolParams: Record<string, string>;
7
+ maxResults?: number;
8
+ rerank?: boolean;
9
+ linesInEachResult?: number | undefined;
10
+ }) => Promise<string>;
@@ -0,0 +1 @@
1
+ export {};
package/build/index.d.ts CHANGED
@@ -1,30 +1,6 @@
1
- import { ZodRawShape, z, ZodTypeAny } from 'zod';
2
- import { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js';
3
- import { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
4
- import { PanoramaClientForComponent } from '@wix/panorama-client-node';
5
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
6
-
7
- type WixRequestHandlerExtra = RequestHandlerExtra & {
8
- panorama: PanoramaClientForComponent;
9
- };
10
- type WixToolCallback<Args extends undefined | ZodRawShape = undefined> = Args extends ZodRawShape ? (args: z.objectOutputType<Args, ZodTypeAny>, extra: WixRequestHandlerExtra) => CallToolResult | Promise<CallToolResult> : (extra: WixRequestHandlerExtra) => CallToolResult | Promise<CallToolResult>;
11
- declare class WixMcpServer extends McpServer {
12
- tool(name: string, cb: WixToolCallback): void;
13
- tool(name: string, description: string, cb: WixToolCallback): void;
14
- tool<Args extends ZodRawShape>(name: string, paramsSchema: Args, cb: WixToolCallback<Args>): void;
15
- tool<Args extends ZodRawShape>(name: string, description: string, paramsSchema: Args, cb: WixToolCallback<Args>): void;
16
- }
17
-
18
- declare const VALID_DOCS_TOOLS: readonly ["WDS", "REST", "SDK", "BUILD_APPS", "WIX_HEADLESS", "BUSINESS_SOLUTIONS"];
19
- type DocsTool = (typeof VALID_DOCS_TOOLS)[number];
20
- declare const addDocsTools: (server: WixMcpServer, allowedTools?: DocsTool[]) => void;
21
-
22
- declare function addApiCallTool(server: WixMcpServer, getSiteAccessToken: (siteId: string) => Promise<string>, getAccountAccessToken: () => Promise<string>): void;
23
-
24
- declare const handleWixAPIResponse: <T = any>(response: Response) => Promise<T>;
25
-
26
- declare const addDocsResources: (server: McpServer, portals: string[]) => Promise<void>;
27
-
28
- declare function addSupportTool(server: WixMcpServer): void;
29
-
30
- export { type DocsTool, VALID_DOCS_TOOLS, WixMcpServer, addApiCallTool, addDocsResources, addDocsTools, addSupportTool, handleWixAPIResponse };
1
+ export { WixMcpServer } from './wix-mcp-server.js';
2
+ export { addDocsTools, DocsTool, VALID_DOCS_TOOLS } from './docs/docs.js';
3
+ export { addApiCallTool } from './api-call/index.js';
4
+ export { handleWixAPIResponse } from './tool-utils.js';
5
+ export { addDocsResources } from './resources/docs.js';
6
+ export { addSupportTool } from './support/index.js';
package/build/index.js CHANGED
@@ -1,3 +1,10 @@
1
+
2
+ // Shim require if needed.
3
+ import module from 'module';
4
+ if (typeof globalThis.require === "undefined") {
5
+ globalThis.require = module.createRequire(import.meta.url);
6
+ }
7
+
1
8
  import {
2
9
  VALID_DOCS_TOOLS,
3
10
  WixMcpServer,
@@ -5,7 +12,7 @@ import {
5
12
  addDocsTools,
6
13
  handleWixAPIResponse,
7
14
  logger
8
- } from "./chunk-YRLMZUQM.js";
15
+ } from "./chunk-QGIZNLF4.js";
9
16
 
10
17
  // src/api-call/index.ts
11
18
  import { z } from "zod";
@@ -191,3 +198,4 @@ export {
191
198
  addSupportTool,
192
199
  handleWixAPIResponse
193
200
  };
201
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/api-call/index.ts", "../src/support/index.ts"],
4
+ "sourcesContent": ["import { z } from 'zod';\nimport { logger } from '../logger.js';\nimport { WixMcpServer } from '../wix-mcp-server.js';\nimport { handleWixAPIResponse } from '../tool-utils.js';\n\nexport function addApiCallTool(\n server: WixMcpServer,\n getSiteAccessToken: (siteId: string) => Promise<string>,\n getAccountAccessToken: () => Promise<string>\n) {\n server.tool(\n 'CallWixSiteAPI',\n [\n 'Call Wix apis on a business or site. Use this to create, read, update, and delete data and other Wix entities in your Wix site,',\n `You should ALWAYS check the rest docs - \"SearchWixRESTDocumentation\" for the specific API you want to call, don't just call it without knowing what it does, CHECK THE DOCS`,\n 'Error Handling:',\n 'If the error is related to missing installed app or \"WDE0110: Wix Code not enabled\", you should install the missing app by using ReadFullDocsArticle tool to fetch the article - https://dev.wix.com/docs/kb-only/MCP_REST_RECIPES_KB_ID/TRAIN_wix.devcenter.apps.installer.v1.AppsInstallerService.InstallApp',\n '**Note:** there is no need to check if an app is installed/ Wix Code enabled in advance, just call the API and handle the error if it occurs, the API error message will state it clearly.',\n 'For any other error, use your default error handling mechanism'\n ].join('\\n'),\n {\n siteId: z\n .string()\n .describe('The id of the site selected using site selection tool'),\n url: z\n .string()\n .describe(\n 'The url of the api to call - ALWAYS get the information from the Wix REST docs or from the conversation context, the URL MUST BE ABSOLUTE URL'\n ),\n method: z\n .string()\n .describe(\n 'The HTTP method to use for the API call (e.g. GET, POST, PUT, DELETE)'\n ),\n body: z\n .string()\n .optional()\n .describe(\n 'A string representing of a valid JSON object to describe the body of the request'\n )\n },\n async ({ url, body, method, siteId }) => {\n logger.log(\n `Calling Wix Site API: ${siteId} ${url}, body: ${JSON.stringify(body)}`\n );\n\n const authorization = await getSiteAccessToken(siteId);\n\n try {\n const response = await fetch(url, {\n method,\n headers: {\n Authorization: authorization,\n ...(body ? { 'Content-Type': 'application/json' } : {})\n },\n body: method === 'GET' ? undefined : body\n });\n\n const responseData = await handleWixAPIResponse(response);\n\n return {\n content: [\n {\n type: 'text',\n text: `Wix Site API call successful: ${JSON.stringify(responseData)}`\n }\n ]\n };\n } catch (error) {\n logger.error(`Failed to call Wix Site API: ${error}`);\n throw new Error(`Failed to call Wix Site API: ${error}`);\n }\n }\n );\n\n server.tool(\n 'ListWixSites',\n 'List Wix sites for the current user',\n async () => {\n const sitesRes = await fetch(\n 'https://www.wixapis.com/site-list/v2/sites/query',\n {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Accept: 'application/json, text/plain, */*',\n Authorization: await getAccountAccessToken()\n },\n body: JSON.stringify({\n query: {\n cursorPaging: { limit: 50 }\n }\n })\n }\n );\n\n const result = await sitesRes.json().then(\n ({ sites }: any) =>\n sites?.map(({ id, displayName }: any) => ({\n id,\n name: displayName\n })) ?? []\n );\n\n return {\n content: [\n {\n type: 'text',\n text: JSON.stringify(result)\n },\n {\n type: 'text',\n text: 'if there is more than one site returned, the user should pick one from a list, list the sites (only name) for the user and ask them to pick one'\n }\n ]\n };\n }\n );\n\n server.tool(\n 'ManageWixSite',\n `Use account level API in order to create a site, update a site and publish site.\n ALWAYS use \"SearchWixRESTDocumentation\" to search for the API you should invoke, NEVER GUESS THE SITE API URL\n You should ALWAYS check the rest docs - \"SearchWixRESTDocumentation\" for the specific API you want to call, don't just call it without knowing what it does, CHECK THE DOCS`,\n {\n url: z\n .string()\n .describe(\n 'The url of the api to call - ALWAYS get the information from the Wix REST docs DONT GUESS IT, the URL MUST BE ABSOLUTE URL'\n ),\n method: z\n .string()\n .describe(\n 'The HTTP method to use for the API call (e.g. GET, POST, PUT, DELETE)'\n ),\n body: z\n .string()\n .optional()\n .describe(\n 'A string representing of a valid JSON object to describe the body of the request'\n )\n },\n async ({ url, body, method }) => {\n logger.log(\n `Calling Wix Account level API: ${url}, body: ${JSON.stringify(body)}`\n );\n\n const authorization = await getAccountAccessToken();\n\n try {\n const response = await fetch(url, {\n method,\n headers: {\n Authorization: authorization,\n ...(body ? { 'Content-Type': 'application/json' } : {})\n },\n body: method === 'GET' ? undefined : body\n });\n\n const responseData = await handleWixAPIResponse(response);\n\n return {\n content: [\n {\n type: 'text',\n text: `Wix Account API call successful: ${JSON.stringify(responseData)}`\n }\n ]\n };\n } catch (error) {\n logger.error(`Failed to call Wix Account API: ${error}`);\n throw new Error(`Failed to call Wix Account API: ${error}`);\n }\n }\n );\n}\n", "import { WixMcpServer } from '../wix-mcp-server.js';\nimport { z } from 'zod';\n\nexport function addSupportTool(server: WixMcpServer) {\n server.tool(\n 'SupportAndFeedback',\n [\n 'If the user would like to provide Wix with some feedback (good or bad), about the tools in Wix MCP,',\n 'for example they used the tools provided, and they reflected satisfaction or dissatisfaction with the tools.',\n 'Also, if you encounter too many errors tyring to call the Wix API, you can also suggest the user to provide feedback to Wix using this tool.',\n '**IMPORTANT NOTE**',\n 'This tool is not sending the message, but formats it in order to another tool to actually send it'\n ].join('\\n'),\n {\n requestId: z\n .string()\n .optional()\n .describe(\n 'request id if returned from the server in a failed API call to Wix'\n ),\n message: z.string().describe('The message to send to Wix')\n },\n async ({ requestId, message }) => {\n return {\n content: [\n {\n type: 'text',\n text: `${message} ${requestId ? `request id: ${requestId}` : ''}`\n },\n {\n type: 'text',\n text:\n 'You should present the user with the formatted message above and ask if they would like to send it to Wix.' +\n 'If the user confirms, you can get the details about send feedback API from the article `https://dev.wix.com/docs/kb-only/MCP_REST_RECIPES_KB_ID/TRAIN_send_mcp_feedback_to_wix_from_user`.' +\n 'You can use the `ReadFullDocsArticle` tool to fetch the article and get the details about the API call.' +\n 'Once you have the details, you can use the `ManageWixSite` (if site id is in context) or `CallWixSiteAPI` (if site id is not in context) tool to call the API and send the feedback to Wix.'\n }\n ]\n };\n }\n );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS;AAKX,SAAS,eACd,QACA,oBACA,uBACA;AACA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,EAAE,KAAK,IAAI;AAAA,IACX;AAAA,MACE,QAAQ,EACL,OAAO,EACP,SAAS,uDAAuD;AAAA,MACnE,KAAK,EACF,OAAO,EACP;AAAA,QACC;AAAA,MACF;AAAA,MACF,QAAQ,EACL,OAAO,EACP;AAAA,QACC;AAAA,MACF;AAAA,MACF,MAAM,EACH,OAAO,EACP,SAAS,EACT;AAAA,QACC;AAAA,MACF;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,KAAK,MAAM,QAAQ,OAAO,MAAM;AACvC,aAAO;AAAA,QACL,yBAAyB,MAAM,IAAI,GAAG,WAAW,KAAK,UAAU,IAAI,CAAC;AAAA,MACvE;AAEA,YAAM,gBAAgB,MAAM,mBAAmB,MAAM;AAErD,UAAI;AACF,cAAM,WAAW,MAAM,MAAM,KAAK;AAAA,UAChC;AAAA,UACA,SAAS;AAAA,YACP,eAAe;AAAA,YACf,GAAI,OAAO,EAAE,gBAAgB,mBAAmB,IAAI,CAAC;AAAA,UACvD;AAAA,UACA,MAAM,WAAW,QAAQ,SAAY;AAAA,QACvC,CAAC;AAED,cAAM,eAAe,MAAM,qBAAqB,QAAQ;AAExD,eAAO;AAAA,UACL,SAAS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;AAAA,UAIJ;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
6
+ "names": ["z"]
7
+ }
@@ -0,0 +1,6 @@
1
+ interface Options {
2
+ timeout?: number;
3
+ interval?: number;
4
+ }
5
+ export default function eventually<ReturnType = void>(expectation: () => ReturnType | Promise<ReturnType>, options?: Options): Promise<ReturnType>;
6
+ export {};
@@ -0,0 +1,13 @@
1
+ import Stream from 'node:stream';
2
+ export declare function handleStdout(stdout: Stream.Readable): {
3
+ waitForText(match: string | RegExp, { timeout }?: {
4
+ timeout?: number | undefined;
5
+ }): Promise<string | undefined>;
6
+ waitForAndCallback(matchesAndCallbacks: {
7
+ match: string;
8
+ callback: (stop: () => void) => void;
9
+ }[], { timeout }?: {
10
+ timeout?: number | undefined;
11
+ }): Promise<unknown>;
12
+ getOutput(): Promise<string>;
13
+ };
@@ -0,0 +1,7 @@
1
+ import Stream from 'node:stream';
2
+ export declare const ENTER = "\r";
3
+ export declare const mockInteractiveGenerateCommandTool: ({ extensionType, stdin, stdout }: {
4
+ extensionType: string;
5
+ stdin: Stream.Writable;
6
+ stdout: Stream.Readable;
7
+ }) => Promise<string>;
@@ -0,0 +1,10 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ interface Logger {
3
+ log(...data: unknown[]): void;
4
+ error(...data: unknown[]): void;
5
+ }
6
+ export declare const logger: Logger;
7
+ export declare const attachMcpServerLogger: (server: McpServer) => void;
8
+ export declare const attachStdErrLogger: () => void;
9
+ export declare const attachFileLogger: () => void;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const globalConfig: import("@wix/panorama-client-node").GlobalConfig<import("@wix/panorama-common-shared/dist/types/types/data-types.js").EventPayload, {}>;
2
+ export declare const panoramaFactory: import("@wix/panorama-client").PanoramaClientFactory<import("@wix/panorama-common-shared/dist/types/types/data-types.js").EventPayload>;
@@ -0,0 +1,2 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare const addDocsResources: (server: McpServer, portals: string[]) => Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { WixMcpServer } from '../wix-mcp-server.js';
2
+ export declare function addSupportTool(server: WixMcpServer): void;
@@ -0,0 +1 @@
1
+ export declare const handleWixAPIResponse: <T = any>(response: Response) => Promise<T>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { z, ZodRawShape, ZodTypeAny } from 'zod';
2
+ import type { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js';
3
+ import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
4
+ import type { PanoramaClientForComponent } from '@wix/panorama-client-node';
5
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
6
+ type WixRequestHandlerExtra = RequestHandlerExtra & {
7
+ panorama: PanoramaClientForComponent;
8
+ };
9
+ type WixToolCallback<Args extends undefined | ZodRawShape = undefined> = Args extends ZodRawShape ? (args: z.objectOutputType<Args, ZodTypeAny>, extra: WixRequestHandlerExtra) => CallToolResult | Promise<CallToolResult> : (extra: WixRequestHandlerExtra) => CallToolResult | Promise<CallToolResult>;
10
+ export declare class WixMcpServer extends McpServer {
11
+ tool(name: string, cb: WixToolCallback): void;
12
+ tool(name: string, description: string, cb: WixToolCallback): void;
13
+ tool<Args extends ZodRawShape>(name: string, paramsSchema: Args, cb: WixToolCallback<Args>): void;
14
+ tool<Args extends ZodRawShape>(name: string, description: string, paramsSchema: Args, cb: WixToolCallback<Args>): void;
15
+ }
16
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/mcp",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "A Model Context Protocol server for Wix AI tools",
5
5
  "type": "module",
6
6
  "bin": "./bin.js",
@@ -9,11 +9,11 @@
9
9
  "README.md"
10
10
  ],
11
11
  "scripts": {
12
- "build": "tsc --noEmit && tsup-node",
12
+ "build": "tsc --noEmit && node ./scripts/build.mjs",
13
13
  "test": "vitest run",
14
14
  "test:watch": "vitest",
15
15
  "start": "npm run build && node ./build/bin.js",
16
- "watch": "tsc --watch",
16
+ "watch": "tsup-node --watch",
17
17
  "lint": "eslint .",
18
18
  "inspector": "npx @modelcontextprotocol/inspector build/bin.js"
19
19
  },
@@ -37,12 +37,12 @@
37
37
  "@types/minimist": "^1.2.5",
38
38
  "@types/node": "^20.17.31",
39
39
  "@wix/panorama-client-node": "^3.228.0",
40
+ "esbuild": "^0.25.3",
40
41
  "eslint": "^9.25.1",
41
42
  "eslint-config-prettier": "^10.1.2",
42
43
  "eslint-plugin-prettier": "^5.2.6",
43
44
  "globals": "^16.0.0",
44
45
  "prettier": "^3.5.3",
45
- "tsup": "^8.4.0",
46
46
  "typescript": "^5.8.3",
47
47
  "typescript-eslint": "^8.31.0",
48
48
  "vitest": "^3.1.2"
@@ -65,5 +65,5 @@
65
65
  ]
66
66
  }
67
67
  },
68
- "falconPackageHash": "6bff51606aed52121711cca3ff10da3c1ba3bef77a9bc77809146d16"
68
+ "falconPackageHash": "13cb6cd071ececc23a18f00406f8d665dc94eb0874132810565b68df"
69
69
  }