@wix/mcp 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -0
- package/build/api-call/index.js +1 -2
- package/build/cli-tools/cli.js +1 -0
- package/build/cli-tools/utils.js +16 -3
- package/build/docs/docs.js +18 -18
- package/build/support/index.js +7 -6
- package/build/wix-mcp-server.d.ts +1 -4
- package/build/wix-mcp-server.js +16 -15
- package/package.json +6 -7
- package/build/panorama.d.ts +0 -2
- package/build/panorama.js +0 -23
package/README.md
CHANGED
|
@@ -140,3 +140,37 @@ https://docs.cursor.com/context/model-context-protocol
|
|
|
140
140
|
- make sure build files have permissions for cursor to access
|
|
141
141
|
- log should be written to `~/wix-mcp-log.txt`
|
|
142
142
|
- add .env file with `WIX_COOKIE=` to avoid rate limits on SDK tool use
|
|
143
|
+
|
|
144
|
+
## NVM possible fix:
|
|
145
|
+
```
|
|
146
|
+
"wix-mcp-remote-prod": {
|
|
147
|
+
"command": "npx",
|
|
148
|
+
"args": [
|
|
149
|
+
"-y",
|
|
150
|
+
"@wix/mcp-remote",
|
|
151
|
+
"https://mcp.wix.com/sse"
|
|
152
|
+
],
|
|
153
|
+
"env": {
|
|
154
|
+
"PATH": "<path-to-your-nvm-node-version>/bin"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## fnm possible fix:
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
{
|
|
163
|
+
"mcpServers": {
|
|
164
|
+
"wix-mcp-remote-prod": {
|
|
165
|
+
"command": "sh",
|
|
166
|
+
"args": [
|
|
167
|
+
"-c",
|
|
168
|
+
"eval $(fnm env) && npx -y @wix/mcp-remote https://mcp.wix.com/sse"
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
package/build/api-call/index.js
CHANGED
|
@@ -6,8 +6,7 @@ export function addApiCallTool(server, getSiteAccessToken, getAccountAccessToken
|
|
|
6
6
|
'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,',
|
|
7
7
|
`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`,
|
|
8
8
|
'Error Handling:',
|
|
9
|
-
'If the error is related to missing installed app, 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
|
|
10
|
-
'If the error is related to error code "WDE0110: Wix Code not enabled." you should ask the user to do it in the editor',
|
|
9
|
+
'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',
|
|
11
10
|
'**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.',
|
|
12
11
|
'For any other error, use your default error handling mechanism'
|
|
13
12
|
].join('\n'), {
|
package/build/cli-tools/cli.js
CHANGED
package/build/cli-tools/utils.js
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
|
-
import { readFileSync } from 'fs';
|
|
1
|
+
import { existsSync, readFileSync } from 'fs';
|
|
2
2
|
import { homedir } from 'os';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
export function getCliAuthTokenForSiteId(siteIdOrAccountsFileName) {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
// check if the api-key.json file exists:
|
|
6
|
+
const apiKeyFileName = path.join(homedir(), `.wix/auth/api-key.json`);
|
|
7
|
+
const apiKeyFileExists = existsSync(apiKeyFileName);
|
|
8
|
+
if (apiKeyFileExists) {
|
|
9
|
+
const apiKeyData = JSON.parse(readFileSync(apiKeyFileName, 'utf8'));
|
|
10
|
+
return (apiKeyData.token || apiKeyData.accessToken);
|
|
11
|
+
}
|
|
12
|
+
const siteTokenFileName = path.join(homedir(), `.wix/auth/${siteIdOrAccountsFileName}.json`);
|
|
13
|
+
// check if the site token file exists:
|
|
14
|
+
const siteTokenFileExists = existsSync(siteTokenFileName);
|
|
15
|
+
if (siteTokenFileExists) {
|
|
16
|
+
const authData = JSON.parse(readFileSync(siteTokenFileName, 'utf8'));
|
|
17
|
+
return (authData.accessToken || authData.token);
|
|
18
|
+
}
|
|
19
|
+
throw new Error('No site token or api key found. You need to authenticate with Wix CLI first.');
|
|
7
20
|
}
|
|
8
21
|
// f"first get the site id - its in the `{backoffice_app_dir}/.wix/app.config.json` file, it has a json object with a siteId field",
|
|
9
22
|
export function getSiteIdFromCliAppConfig(appPath) {
|
package/build/docs/docs.js
CHANGED
|
@@ -36,7 +36,7 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
36
36
|
.max(15)
|
|
37
37
|
.optional()
|
|
38
38
|
.default(10)
|
|
39
|
-
}, async ({ searchTerm, maxResults }
|
|
39
|
+
}, async ({ searchTerm, maxResults }) => {
|
|
40
40
|
try {
|
|
41
41
|
logger.log(`Searching for ${searchTerm} in Wix WDS`);
|
|
42
42
|
const result = await runSemanticSearchAndFormat({
|
|
@@ -56,7 +56,7 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
catch (error) {
|
|
59
|
-
panorama.errorMonitor().reportError(error);
|
|
59
|
+
// panorama.errorMonitor().reportError(error);
|
|
60
60
|
captureException(error, {
|
|
61
61
|
tags: {
|
|
62
62
|
componentId: 'SearchWixWDSDocumentation',
|
|
@@ -89,7 +89,7 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
89
89
|
.max(15)
|
|
90
90
|
.optional()
|
|
91
91
|
.default(10)
|
|
92
|
-
}, async ({ searchTerm, maxResults }
|
|
92
|
+
}, async ({ searchTerm, maxResults }) => {
|
|
93
93
|
try {
|
|
94
94
|
logger.log(`Searching for ${searchTerm} in Wix REST API`);
|
|
95
95
|
const result = await runSemanticSearchAndFormat({
|
|
@@ -114,7 +114,7 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
116
|
catch (error) {
|
|
117
|
-
panorama.errorMonitor().reportError(error);
|
|
117
|
+
// panorama.errorMonitor().reportError(error);
|
|
118
118
|
captureException(error, {
|
|
119
119
|
tags: {
|
|
120
120
|
componentId: 'SearchWixRESTDocumentation',
|
|
@@ -150,7 +150,7 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
150
150
|
.max(15)
|
|
151
151
|
.optional()
|
|
152
152
|
.default(5)
|
|
153
|
-
}, async ({ searchTerm, maxResults }
|
|
153
|
+
}, async ({ searchTerm, maxResults }) => {
|
|
154
154
|
try {
|
|
155
155
|
logger.log(`Searching for ${searchTerm} in Wix Sample Flows`);
|
|
156
156
|
const result = await runSemanticSearchAndFormat({
|
|
@@ -175,7 +175,7 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
177
|
catch (error) {
|
|
178
|
-
panorama.errorMonitor().reportError(error);
|
|
178
|
+
// panorama.errorMonitor().reportError(error);
|
|
179
179
|
captureException(error, {
|
|
180
180
|
tags: {
|
|
181
181
|
componentId: 'SearchWixSampleFlowsDocumentation',
|
|
@@ -208,12 +208,12 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
208
208
|
.max(15)
|
|
209
209
|
.optional()
|
|
210
210
|
.default(5)
|
|
211
|
-
}, async ({ searchTerm, maxResults }
|
|
211
|
+
}, async ({ searchTerm, maxResults }) => {
|
|
212
212
|
try {
|
|
213
213
|
logger.log(`Searching for ${searchTerm} in Wix SDK`);
|
|
214
|
-
panorama
|
|
215
|
-
|
|
216
|
-
|
|
214
|
+
// panorama
|
|
215
|
+
// .transaction('SearchWixSDKDocumentation')
|
|
216
|
+
// .start({ maxResults });
|
|
217
217
|
const result = await runSemanticSearchAndFormat({
|
|
218
218
|
toolName: 'SDK',
|
|
219
219
|
toolParams: {
|
|
@@ -222,9 +222,9 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
222
222
|
maxResults: Math.max(1, Math.min(maxResults ?? 5, 15)),
|
|
223
223
|
linesInEachResult: 15
|
|
224
224
|
});
|
|
225
|
-
panorama
|
|
226
|
-
|
|
227
|
-
|
|
225
|
+
// panorama
|
|
226
|
+
// .transaction('SearchWixSDKDocumentation')
|
|
227
|
+
// .finish({ maxResults });
|
|
228
228
|
return {
|
|
229
229
|
content: [
|
|
230
230
|
{
|
|
@@ -239,7 +239,7 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
239
239
|
};
|
|
240
240
|
}
|
|
241
241
|
catch (error) {
|
|
242
|
-
panorama.errorMonitor().reportError(error);
|
|
242
|
+
// panorama.errorMonitor().reportError(error);
|
|
243
243
|
captureException(error, {
|
|
244
244
|
tags: {
|
|
245
245
|
componentId: 'SearchWixSDKDocumentation',
|
|
@@ -272,7 +272,7 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
272
272
|
.max(15)
|
|
273
273
|
.optional()
|
|
274
274
|
.default(5)
|
|
275
|
-
}, async ({ searchTerm, maxResults }
|
|
275
|
+
}, async ({ searchTerm, maxResults }) => {
|
|
276
276
|
try {
|
|
277
277
|
logger.log(`Searching for ${searchTerm} in Build Apps`);
|
|
278
278
|
const result = await runSemanticSearchAndFormat({
|
|
@@ -292,7 +292,7 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
292
292
|
};
|
|
293
293
|
}
|
|
294
294
|
catch (error) {
|
|
295
|
-
panorama.errorMonitor().reportError(error);
|
|
295
|
+
// panorama.errorMonitor().reportError(error);
|
|
296
296
|
captureException(error, {
|
|
297
297
|
tags: {
|
|
298
298
|
componentId: 'SearchBuildAppsDocumentation',
|
|
@@ -324,7 +324,7 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
324
324
|
.max(15)
|
|
325
325
|
.optional()
|
|
326
326
|
.default(5)
|
|
327
|
-
}, async ({ searchTerm, maxResults }
|
|
327
|
+
}, async ({ searchTerm, maxResults }) => {
|
|
328
328
|
try {
|
|
329
329
|
logger.log(`Searching for ${searchTerm} in Headless`);
|
|
330
330
|
const result = await runSemanticSearchAndFormat({
|
|
@@ -344,7 +344,7 @@ export const addDocsTools = (server, allowedTools = [
|
|
|
344
344
|
};
|
|
345
345
|
}
|
|
346
346
|
catch (error) {
|
|
347
|
-
panorama.errorMonitor().reportError(error);
|
|
347
|
+
// panorama.errorMonitor().reportError(error);
|
|
348
348
|
captureException(error, {
|
|
349
349
|
tags: {
|
|
350
350
|
componentId: 'SearchWixHeadlessDocumentation',
|
package/build/support/index.js
CHANGED
|
@@ -4,16 +4,14 @@ export function addSupportTool(server) {
|
|
|
4
4
|
'If the user would like to provide Wix with some feedback (good or bad), about the tools in Wix MCP,',
|
|
5
5
|
'for example they used the tools provided, and they reflected satisfaction or dissatisfaction with the tools.',
|
|
6
6
|
'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.',
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
'1. This tool is not sending the message formats it for users to use in discord',
|
|
10
|
-
'2. Mention in the provided message that it is related to Wix MCP and the tools provided'
|
|
7
|
+
'**IMPORTANT NOTE**',
|
|
8
|
+
'This tool is not sending the message, but formats it in order to another tool to actually send it'
|
|
11
9
|
].join('\n'), {
|
|
12
10
|
requestId: z
|
|
13
11
|
.string()
|
|
14
12
|
.optional()
|
|
15
13
|
.describe('request id if returned from the server in a failed API call to Wix'),
|
|
16
|
-
message: z.string().describe('The message to send to Wix
|
|
14
|
+
message: z.string().describe('The message to send to Wix')
|
|
17
15
|
}, async ({ requestId, message }) => {
|
|
18
16
|
return {
|
|
19
17
|
content: [
|
|
@@ -23,7 +21,10 @@ export function addSupportTool(server) {
|
|
|
23
21
|
},
|
|
24
22
|
{
|
|
25
23
|
type: 'text',
|
|
26
|
-
text: 'You should present the user with the formatted message above and ask
|
|
24
|
+
text: 'You should present the user with the formatted message above and ask if they would like to send it to Wix.' +
|
|
25
|
+
'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`.' +
|
|
26
|
+
'You can use the `ReadFullDocsArticle` tool to fetch the article and get the details about the API call.' +
|
|
27
|
+
'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.'
|
|
27
28
|
}
|
|
28
29
|
]
|
|
29
30
|
};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import type { z, ZodRawShape, ZodTypeAny } from 'zod';
|
|
2
2
|
import type { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
3
3
|
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
4
|
-
import type { PanoramaClientForComponent } from '@wix/panorama-client-node';
|
|
5
4
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
6
|
-
type WixRequestHandlerExtra = RequestHandlerExtra & {
|
|
7
|
-
panorama: PanoramaClientForComponent;
|
|
8
|
-
};
|
|
5
|
+
type WixRequestHandlerExtra = RequestHandlerExtra & {};
|
|
9
6
|
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
7
|
export declare class WixMcpServer extends McpServer {
|
|
11
8
|
tool(name: string, cb: WixToolCallback): void;
|
package/build/wix-mcp-server.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
// import type { PanoramaClientForComponent } from '@wix/panorama-client-node';
|
|
1
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { globalConfig, panoramaFactory } from './panorama.js';
|
|
3
|
-
import { captureException
|
|
3
|
+
//import { globalConfig, panoramaFactory } from './panorama.js';
|
|
4
|
+
import { captureException } from '@sentry/node';
|
|
4
5
|
export class WixMcpServer extends McpServer {
|
|
5
6
|
tool(...args) {
|
|
6
7
|
const cbIndex = args.findIndex((arg) => typeof arg === 'function');
|
|
@@ -8,29 +9,29 @@ export class WixMcpServer extends McpServer {
|
|
|
8
9
|
const originalCb = args[cbIndex];
|
|
9
10
|
const toolName = args[0];
|
|
10
11
|
const panoramaComponentId = toolName;
|
|
11
|
-
const panorama = panoramaFactory.client({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
})
|
|
16
|
-
setTags({
|
|
17
|
-
|
|
18
|
-
})
|
|
12
|
+
/*const panorama = panoramaFactory.client({
|
|
13
|
+
baseParams: {
|
|
14
|
+
componentId: panoramaComponentId
|
|
15
|
+
}
|
|
16
|
+
});*/
|
|
17
|
+
/*setTags({
|
|
18
|
+
panoramaSessionId: globalConfig.getSessionId()
|
|
19
|
+
});*/
|
|
19
20
|
const wrappedCb = async (...cbArgs) => {
|
|
20
21
|
const argsBeforeExtra = cbArgs.slice(0, cbArgs.length - 1);
|
|
21
22
|
const extra = cbArgs[cbArgs.length - 1];
|
|
22
23
|
const wrappedExtra = {
|
|
23
|
-
...extra
|
|
24
|
-
panorama: panorama.createClientForComponent()
|
|
24
|
+
...extra
|
|
25
|
+
// panorama: panorama.createClientForComponent()
|
|
25
26
|
};
|
|
26
|
-
panorama.transaction(toolName).start();
|
|
27
|
+
//panorama.transaction(toolName).start();
|
|
27
28
|
try {
|
|
28
29
|
const cbResult = await originalCb(...argsBeforeExtra, wrappedExtra);
|
|
29
|
-
panorama.transaction(toolName).finish();
|
|
30
|
+
//panorama.transaction(toolName).finish();
|
|
30
31
|
return cbResult;
|
|
31
32
|
}
|
|
32
33
|
catch (e) {
|
|
33
|
-
panorama.errorMonitor().reportError(e);
|
|
34
|
+
//panorama.errorMonitor().reportError(e as Error);
|
|
34
35
|
captureException(e, {
|
|
35
36
|
tags: {
|
|
36
37
|
componentId: panoramaComponentId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "A Model Context Protocol server for Wix AI tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./bin.js",
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@modelcontextprotocol/sdk": "^1.9.0",
|
|
25
25
|
"@sentry/node": "^9.13.0",
|
|
26
|
-
"@wix/panorama-client-node": "^3.228.0",
|
|
27
26
|
"execa": "^9.5.2",
|
|
28
27
|
"minimist": "^1.2.8",
|
|
29
28
|
"strip-ansi": "^7.1.0",
|
|
@@ -32,17 +31,17 @@
|
|
|
32
31
|
"zod": "^3.24.3"
|
|
33
32
|
},
|
|
34
33
|
"devDependencies": {
|
|
35
|
-
"@eslint/js": "^9.25.
|
|
34
|
+
"@eslint/js": "^9.25.1",
|
|
36
35
|
"@types/express": "^5.0.1",
|
|
37
36
|
"@types/minimist": "^1.2.5",
|
|
38
|
-
"@types/node": "^20.17.
|
|
39
|
-
"eslint": "^9.25.
|
|
37
|
+
"@types/node": "^20.17.31",
|
|
38
|
+
"eslint": "^9.25.1",
|
|
40
39
|
"eslint-config-prettier": "^10.1.2",
|
|
41
40
|
"eslint-plugin-prettier": "^5.2.6",
|
|
42
41
|
"globals": "^16.0.0",
|
|
43
42
|
"prettier": "^3.5.3",
|
|
44
43
|
"typescript": "^5.8.3",
|
|
45
|
-
"typescript-eslint": "^8.
|
|
44
|
+
"typescript-eslint": "^8.31.0",
|
|
46
45
|
"vitest": "^3.1.2"
|
|
47
46
|
},
|
|
48
47
|
"exports": {
|
|
@@ -63,5 +62,5 @@
|
|
|
63
62
|
]
|
|
64
63
|
}
|
|
65
64
|
},
|
|
66
|
-
"falconPackageHash": "
|
|
65
|
+
"falconPackageHash": "2b9b8f55614d88448109d86ff590f94348739875ce6b9769eeca1339"
|
|
67
66
|
}
|
package/build/panorama.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
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>;
|
package/build/panorama.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// import { createRequire } from 'module';
|
|
2
|
-
import { createGlobalConfig, panoramaClientFactory, PanoramaPlatform } from '@wix/panorama-client-node';
|
|
3
|
-
// const require = createRequire(import.meta.url);
|
|
4
|
-
// const packageJson = require('../package.json');
|
|
5
|
-
// TODO: use real package.json
|
|
6
|
-
// I temporarily disabled this because it's not working in the remote server
|
|
7
|
-
const packageJson = {
|
|
8
|
-
version: '1.0.0'
|
|
9
|
-
};
|
|
10
|
-
export const globalConfig = createGlobalConfig();
|
|
11
|
-
export const panoramaFactory = panoramaClientFactory({
|
|
12
|
-
baseParams: {
|
|
13
|
-
platform: PanoramaPlatform.Standalone,
|
|
14
|
-
fullArtifactId: 'com.wixpress.spartans.wix-mcp',
|
|
15
|
-
artifactVersion: packageJson.version
|
|
16
|
-
},
|
|
17
|
-
data: {
|
|
18
|
-
packageVersion: packageJson.version,
|
|
19
|
-
versions: process.versions,
|
|
20
|
-
platform: process.platform,
|
|
21
|
-
arch: process.arch
|
|
22
|
-
}
|
|
23
|
-
}).withGlobalConfig(globalConfig);
|