@wix/mcp 1.0.16 → 1.0.17
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/build/bin-standalone.js +12687 -12854
- package/build/bin-standalone.js.map +4 -4
- package/build/cjs/index.cjs +286 -226
- package/build/cjs/index.cjs.map +4 -4
- package/build/dts/api-call/index.d.ts +1 -1
- package/build/dts/api-call/index.d.ts.map +1 -1
- package/build/dts/api-call/index.js +161 -128
- package/build/dts/api-call/index.js.map +1 -1
- package/build/dts/api-call/validation.d.ts +8 -0
- package/build/dts/api-call/validation.d.ts.map +1 -0
- package/build/dts/api-call/validation.js +31 -0
- package/build/dts/api-call/validation.js.map +1 -0
- package/build/dts/api-call/validation.test.d.ts +2 -0
- package/build/dts/api-call/validation.test.d.ts.map +1 -0
- package/build/dts/api-call/validation.test.js +42 -0
- package/build/dts/api-call/validation.test.js.map +1 -0
- package/build/dts/bin.d.ts.map +1 -1
- package/build/dts/bin.js +22 -0
- package/build/dts/bin.js.map +1 -1
- package/build/dts/cli-tools/cli.d.ts +1 -1
- package/build/dts/cli-tools/cli.d.ts.map +1 -1
- package/build/dts/cli-tools/cli.js +2 -223
- package/build/dts/cli-tools/cli.js.map +1 -1
- package/build/dts/docs/docs.d.ts.map +1 -1
- package/build/dts/docs/docs.js +6 -2
- package/build/dts/docs/docs.js.map +1 -1
- package/build/dts/docs/fetch-article.d.ts.map +1 -1
- package/build/dts/docs/fetch-article.js +11 -0
- package/build/dts/docs/fetch-article.js.map +1 -1
- package/build/dts/docs/fetch-article.test.d.ts +2 -0
- package/build/dts/docs/fetch-article.test.d.ts.map +1 -0
- package/build/dts/docs/fetch-article.test.js +12 -0
- package/build/dts/docs/fetch-article.test.js.map +1 -0
- package/build/dts/infra/panorama.d.ts +2 -0
- package/build/dts/infra/panorama.d.ts.map +1 -1
- package/build/dts/infra/panorama.js +1 -0
- package/build/dts/infra/panorama.js.map +1 -1
- package/build/dts/wix-mcp-server.d.ts +3 -0
- package/build/dts/wix-mcp-server.d.ts.map +1 -1
- package/build/dts/wix-mcp-server.js +9 -2
- package/build/dts/wix-mcp-server.js.map +1 -1
- package/build/esm/index.js +254 -188
- package/build/esm/index.js.map +3 -3
- package/package.json +4 -4
- package/build/dts/cli-tools/utils.d.ts +0 -3
- package/build/dts/cli-tools/utils.d.ts.map +0 -1
- package/build/dts/cli-tools/utils.js +0 -26
- package/build/dts/cli-tools/utils.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { WixMcpServer } from '../wix-mcp-server.js';
|
|
2
2
|
import { McpAuthenticationStrategy } from '../auth/index.js';
|
|
3
|
-
export declare function addApiCallTool(server: WixMcpServer, strategy: McpAuthenticationStrategy): void;
|
|
3
|
+
export declare function addApiCallTool(server: WixMcpServer, strategy: McpAuthenticationStrategy, allowedTools?: string[]): void;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api-call/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api-call/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAG7D,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,yBAAyB,EACnC,YAAY,GAAE,MAAM,EAAwD,QAuO7E"}
|
|
@@ -1,150 +1,183 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { logger } from '../infra/logger.js';
|
|
3
3
|
import { handleWixAPIResponse } from '../tool-utils.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
type: 'text',
|
|
43
|
-
text: `Wix Site API call successful: ${JSON.stringify(responseData)}`
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
catch (error) {
|
|
49
|
-
logger.error(`Failed to call Wix Site API: ${error}`);
|
|
50
|
-
const response = error.response;
|
|
51
|
-
if (!response) {
|
|
52
|
-
throw new Error(`Failed to call Wix Site API: ${error}`);
|
|
4
|
+
import { isApiUrlAllowed } from './validation.js';
|
|
5
|
+
export function addApiCallTool(server, strategy, allowedTools = ['CallWixSiteAPI', 'ListWixSites', 'ManageWixSite']) {
|
|
6
|
+
if (allowedTools.includes('CallWixSiteAPI')) {
|
|
7
|
+
server.tool('CallWixSiteAPI', [
|
|
8
|
+
'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,',
|
|
9
|
+
`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`,
|
|
10
|
+
'Error Handling:',
|
|
11
|
+
'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',
|
|
12
|
+
'**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.',
|
|
13
|
+
'For any other error, use your default error handling mechanism'
|
|
14
|
+
].join('\n'), {
|
|
15
|
+
siteId: z
|
|
16
|
+
.string()
|
|
17
|
+
.describe('The id of the site selected using site selection tool'),
|
|
18
|
+
url: z
|
|
19
|
+
.string()
|
|
20
|
+
.url()
|
|
21
|
+
.describe('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'),
|
|
22
|
+
method: z
|
|
23
|
+
.string()
|
|
24
|
+
.describe('The HTTP method to use for the API call (e.g. GET, POST, PUT, DELETE)'),
|
|
25
|
+
body: z
|
|
26
|
+
.string()
|
|
27
|
+
.optional()
|
|
28
|
+
.describe('A string representing of a valid JSON object to describe the body of the request')
|
|
29
|
+
}, async ({ url, body, method, siteId }, { httpClient }) => {
|
|
30
|
+
logger.log(`Calling Wix Site API: ${siteId} ${url}, body: ${JSON.stringify(body)}`);
|
|
31
|
+
const { isAllowed, error: urlError } = isApiUrlAllowed(url);
|
|
32
|
+
if (!isAllowed) {
|
|
33
|
+
return {
|
|
34
|
+
content: [
|
|
35
|
+
{
|
|
36
|
+
isError: true,
|
|
37
|
+
type: 'text',
|
|
38
|
+
text: `Error validating URL: ${urlError}`
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
};
|
|
53
42
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
? {
|
|
71
|
-
name: nameSearch
|
|
43
|
+
try {
|
|
44
|
+
const response = await httpClient.request({
|
|
45
|
+
url,
|
|
46
|
+
method: method,
|
|
47
|
+
headers: {
|
|
48
|
+
...(await strategy.getSiteAuthHeaders(siteId)),
|
|
49
|
+
...(body ? { 'Content-Type': 'application/json' } : {})
|
|
50
|
+
},
|
|
51
|
+
data: method === 'GET' ? undefined : body
|
|
52
|
+
});
|
|
53
|
+
const responseData = await handleWixAPIResponse(response);
|
|
54
|
+
return {
|
|
55
|
+
content: [
|
|
56
|
+
{
|
|
57
|
+
type: 'text',
|
|
58
|
+
text: `Wix Site API call successful: ${JSON.stringify(responseData)}`
|
|
72
59
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
$in: ['WIX', 'DASHBOARD_FIRST', 'ANYWHERE', 'HEADLESS']
|
|
76
|
-
}
|
|
77
|
-
}
|
|
60
|
+
]
|
|
61
|
+
};
|
|
78
62
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
63
|
+
catch (error) {
|
|
64
|
+
logger.error(`Failed to call Wix Site API: ${error}`);
|
|
65
|
+
const response = error.response;
|
|
66
|
+
if (!response) {
|
|
67
|
+
throw new Error(`Failed to call Wix Site API: ${error}`);
|
|
68
|
+
}
|
|
69
|
+
return handleWixAPIResponse(response);
|
|
84
70
|
}
|
|
85
71
|
});
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
72
|
+
}
|
|
73
|
+
if (allowedTools.includes('ListWixSites')) {
|
|
74
|
+
server.tool('ListWixSites', 'List Wix sites for the current user, by default it will return all sites, but you can filter by name', {
|
|
75
|
+
nameSearch: z
|
|
76
|
+
.string()
|
|
77
|
+
.optional()
|
|
78
|
+
.describe('optional filer by name, if not provided all sites will be returned'),
|
|
79
|
+
// Hack for Cursor ignoring tools with no params (when nameSearch is optional)
|
|
80
|
+
alwaysTrue: z.boolean().describe('Always pass true to this parameter')
|
|
81
|
+
}, async ({ nameSearch }, { httpClient }) => {
|
|
82
|
+
const sitesRes = await httpClient.post('https://www.wixapis.com/site-list/v2/sites/query', {
|
|
83
|
+
query: {
|
|
84
|
+
cursorPaging: { limit: 21 },
|
|
85
|
+
filter: {
|
|
86
|
+
...(nameSearch
|
|
87
|
+
? {
|
|
88
|
+
name: nameSearch
|
|
89
|
+
}
|
|
90
|
+
: {}),
|
|
91
|
+
namespace: {
|
|
92
|
+
$in: ['WIX', 'DASHBOARD_FIRST', 'ANYWHERE', 'HEADLESS']
|
|
93
|
+
}
|
|
94
|
+
}
|
|
100
95
|
}
|
|
101
|
-
|
|
102
|
-
};
|
|
103
|
-
});
|
|
104
|
-
server.tool('ManageWixSite', `Use account level API in order to create a site, update a site and publish site.
|
|
105
|
-
ALWAYS use "SearchWixRESTDocumentation" to search for the API you should invoke, NEVER GUESS THE SITE API URL
|
|
106
|
-
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`, {
|
|
107
|
-
url: z
|
|
108
|
-
.string()
|
|
109
|
-
.describe('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'),
|
|
110
|
-
method: z
|
|
111
|
-
.string()
|
|
112
|
-
.describe('The HTTP method to use for the API call (e.g. GET, POST, PUT, DELETE)'),
|
|
113
|
-
body: z
|
|
114
|
-
.string()
|
|
115
|
-
.optional()
|
|
116
|
-
.describe('A string representing of a valid JSON object to describe the body of the request')
|
|
117
|
-
}, async ({ url, body, method }, { httpClient }) => {
|
|
118
|
-
logger.log(`Calling Wix Account level API: ${url}, body: ${JSON.stringify(body)}`);
|
|
119
|
-
try {
|
|
120
|
-
// if we would like to allow the user to manage multiple accounts, we should add accountId to the params
|
|
121
|
-
const response = await httpClient.request({
|
|
122
|
-
url,
|
|
123
|
-
method: method,
|
|
96
|
+
}, {
|
|
124
97
|
headers: {
|
|
125
98
|
...(await strategy.getAccountAuthHeaders()),
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
99
|
+
'Content-Type': 'application/json',
|
|
100
|
+
Accept: 'application/json, text/plain, */*'
|
|
101
|
+
}
|
|
129
102
|
});
|
|
130
|
-
const
|
|
103
|
+
const result = sitesRes.data.sites?.map(({ id, displayName }) => ({
|
|
104
|
+
id,
|
|
105
|
+
name: displayName
|
|
106
|
+
})) ?? [];
|
|
131
107
|
return {
|
|
132
108
|
content: [
|
|
133
109
|
{
|
|
134
110
|
type: 'text',
|
|
135
|
-
text:
|
|
111
|
+
text: JSON.stringify(result)
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
type: 'text',
|
|
115
|
+
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,' +
|
|
116
|
+
'If more than 20 are found you should list all 20 and suggest to search by the name of the site they are looking for'
|
|
136
117
|
}
|
|
137
118
|
]
|
|
138
119
|
};
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
if (allowedTools.includes('ManageWixSite')) {
|
|
123
|
+
server.tool('ManageWixSite', `Use account level API in order to create a site, update a site and publish site.
|
|
124
|
+
ALWAYS use "SearchWixRESTDocumentation" to search for the API you should invoke, NEVER GUESS THE SITE API URL
|
|
125
|
+
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`, {
|
|
126
|
+
url: z
|
|
127
|
+
.string()
|
|
128
|
+
.url()
|
|
129
|
+
.describe('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'),
|
|
130
|
+
method: z
|
|
131
|
+
.string()
|
|
132
|
+
.describe('The HTTP method to use for the API call (e.g. GET, POST, PUT, DELETE)'),
|
|
133
|
+
body: z
|
|
134
|
+
.string()
|
|
135
|
+
.optional()
|
|
136
|
+
.describe('A string representing of a valid JSON object to describe the body of the request')
|
|
137
|
+
}, async ({ url, body, method }, { httpClient }) => {
|
|
138
|
+
logger.log(`Calling Wix Account level API: ${url}, body: ${JSON.stringify(body)}`);
|
|
139
|
+
const { isAllowed, error: urlError } = isApiUrlAllowed(url);
|
|
140
|
+
if (!isAllowed) {
|
|
141
|
+
return {
|
|
142
|
+
content: [
|
|
143
|
+
{
|
|
144
|
+
isError: true,
|
|
145
|
+
type: 'text',
|
|
146
|
+
text: `Error validating URL: ${urlError}`
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
try {
|
|
152
|
+
// if we would like to allow the user to manage multiple accounts, we should add accountId to the params
|
|
153
|
+
const response = await httpClient.request({
|
|
154
|
+
url,
|
|
155
|
+
method: method,
|
|
156
|
+
headers: {
|
|
157
|
+
...(await strategy.getAccountAuthHeaders()),
|
|
158
|
+
...(body ? { 'Content-Type': 'application/json' } : {})
|
|
159
|
+
},
|
|
160
|
+
data: method === 'GET' ? undefined : body
|
|
161
|
+
});
|
|
162
|
+
const responseData = await handleWixAPIResponse(response);
|
|
163
|
+
return {
|
|
164
|
+
content: [
|
|
165
|
+
{
|
|
166
|
+
type: 'text',
|
|
167
|
+
text: `Wix Account API call successful: ${JSON.stringify(responseData)}`
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
};
|
|
145
171
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
172
|
+
catch (error) {
|
|
173
|
+
logger.error(`Failed to call Wix Account API: ${error}`);
|
|
174
|
+
const response = error.response;
|
|
175
|
+
if (!response) {
|
|
176
|
+
throw new Error(`Failed to call Wix Account API: ${error}`);
|
|
177
|
+
}
|
|
178
|
+
return handleWixAPIResponse(response);
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
}
|
|
149
182
|
}
|
|
150
183
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-call/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api-call/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,UAAU,cAAc,CAC5B,MAAoB,EACpB,QAAmC,EACnC,eAAyB,CAAC,gBAAgB,EAAE,cAAc,EAAE,eAAe,CAAC;IAE5E,IAAI,YAAY,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAC5C,MAAM,CAAC,IAAI,CACT,gBAAgB,EAChB;YACE,iIAAiI;YACjI,6KAA6K;YAC7K,iBAAiB;YACjB,gTAAgT;YAChT,4LAA4L;YAC5L,gEAAgE;SACjE,CAAC,IAAI,CAAC,IAAI,CAAC,EACZ;YACE,MAAM,EAAE,CAAC;iBACN,MAAM,EAAE;iBACR,QAAQ,CAAC,uDAAuD,CAAC;YACpE,GAAG,EAAE,CAAC;iBACH,MAAM,EAAE;iBACR,GAAG,EAAE;iBACL,QAAQ,CACP,+IAA+I,CAChJ;YACH,MAAM,EAAE,CAAC;iBACN,MAAM,EAAE;iBACR,QAAQ,CACP,uEAAuE,CACxE;YACH,IAAI,EAAE,CAAC;iBACJ,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CACP,kFAAkF,CACnF;SACJ,EACD,KAAK,EAAE,EAAE,GAAG,EAA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C1C"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function isApiUrlAllowed(url) {
|
|
2
|
+
let parsedUrl;
|
|
3
|
+
try {
|
|
4
|
+
parsedUrl = new URL(url);
|
|
5
|
+
}
|
|
6
|
+
catch {
|
|
7
|
+
return {
|
|
8
|
+
isAllowed: false,
|
|
9
|
+
error: `Invalid URL format: ${url}`
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const ALLOWED_HOSTNAMES = [
|
|
13
|
+
'wix.com',
|
|
14
|
+
'dev.wix.com',
|
|
15
|
+
'manage.wix.com',
|
|
16
|
+
'editor.wix.com',
|
|
17
|
+
'wixapis.com'
|
|
18
|
+
];
|
|
19
|
+
const hostname = parsedUrl.hostname.replace('www.', '');
|
|
20
|
+
const isAllowedHostname = ALLOWED_HOSTNAMES.some((domain) => hostname === domain);
|
|
21
|
+
if (!isAllowedHostname) {
|
|
22
|
+
return {
|
|
23
|
+
isAllowed: false,
|
|
24
|
+
error: `Unsupported URL domain: ${hostname}. URL must be from one of the allowed domains: ${ALLOWED_HOSTNAMES.join(', ')}`
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
isAllowed: true
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/api-call/validation.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,IAAI,SAAc,CAAC;IAEnB,IAAI,CAAC;QACH,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;YACL,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,uBAAuB,GAAG,EAAE;SACpC,CAAC;IACJ,CAAC;IAED,MAAM,iBAAiB,GAAG;QACxB,SAAS;QACT,aAAa;QACb,gBAAgB;QAChB,gBAAgB;QAChB,aAAa;KACd,CAAC;IAEF,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACxD,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,IAAI,CAC9C,CAAC,MAAM,EAAE,EAAE,CAAC,QAAQ,KAAK,MAAM,CAChC,CAAC;IAEF,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,OAAO;YACL,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,2BAA2B,QAAQ,kDAAkD,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;SAC3H,CAAC;IACJ,CAAC;IAED,OAAO;QACL,SAAS,EAAE,IAAI;KAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.test.d.ts","sourceRoot":"","sources":["../../../src/api-call/validation.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { describe, test, expect } from 'vitest';
|
|
2
|
+
import { isApiUrlAllowed } from './validation.js';
|
|
3
|
+
describe('isApiUrlAllowed()', () => {
|
|
4
|
+
test('should allow wix.com URLs', () => {
|
|
5
|
+
expect(isApiUrlAllowed('https://wix.com/_api/service')).toEqual({
|
|
6
|
+
isAllowed: true
|
|
7
|
+
});
|
|
8
|
+
});
|
|
9
|
+
test('should allow dev.wix.com URLs', () => {
|
|
10
|
+
expect(isApiUrlAllowed('https://dev.wix.com/_api/service')).toEqual({
|
|
11
|
+
isAllowed: true
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
test('should allow manage.wix.com URLs', () => {
|
|
15
|
+
expect(isApiUrlAllowed('https://manage.wix.com/_api/service')).toEqual({
|
|
16
|
+
isAllowed: true
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
test('should allow editor.wix.com URLs', () => {
|
|
20
|
+
expect(isApiUrlAllowed('https://editor.wix.com/_api/service')).toEqual({
|
|
21
|
+
isAllowed: true
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
test('should allow wixapis.com URLs', () => {
|
|
25
|
+
expect(isApiUrlAllowed('https://wixapis.com/service')).toEqual({
|
|
26
|
+
isAllowed: true
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
test('should return an error if the URL is not from a valid domain', () => {
|
|
30
|
+
expect(isApiUrlAllowed('https://not-wix.com/api')).toEqual({
|
|
31
|
+
isAllowed: false,
|
|
32
|
+
error: expect.stringContaining('Unsupported URL domain: not-wix.com.')
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
test('should not allow subdomain attacks', () => {
|
|
36
|
+
expect(isApiUrlAllowed('https://wix.com.evil-domain.com/api')).toEqual({
|
|
37
|
+
isAllowed: false,
|
|
38
|
+
error: expect.stringContaining('Unsupported URL domain: wix.com.evil-domain.com.')
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=validation.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.test.js","sourceRoot":"","sources":["../../../src/api-call/validation.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,IAAI,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACrC,MAAM,CAAC,eAAe,CAAC,8BAA8B,CAAC,CAAC,CAAC,OAAO,CAAC;YAC9D,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACzC,MAAM,CAAC,eAAe,CAAC,kCAAkC,CAAC,CAAC,CAAC,OAAO,CAAC;YAClE,SAAS,EAAE,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AAC;
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/bin.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAiB3B,QAAA,MAAM,YAAY,qFAAiC,CAAC;AACpD,QAAA,MAAM,kBAAkB,wDAId,CAAC;AACX,KAAK,IAAI,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAChF,eAAO,MAAM,aAAa,EAAE,IAAI,EAA0B,CAAC"}
|
package/build/dts/bin.js
CHANGED
|
@@ -6,6 +6,7 @@ import { addCliTools, VALID_CLI_TOOLS } from './cli-tools/cli.js';
|
|
|
6
6
|
import { logger, attachStdErrLogger, attachMcpServerLogger, attachFileLogger } from './infra/logger.js';
|
|
7
7
|
import { WixMcpServer } from './wix-mcp-server.js';
|
|
8
8
|
import { addDocsResources } from './resources/docs.js';
|
|
9
|
+
import { addApiCallTool } from './api-call/index.js';
|
|
9
10
|
const PUBLIC_TOOLS = [...VALID_DOCS_TOOLS];
|
|
10
11
|
const EXPERIMENTAL_TOOLS = [
|
|
11
12
|
'WIX_API',
|
|
@@ -23,6 +24,9 @@ function parseExperimentalArg() {
|
|
|
23
24
|
.map((t) => t.trim())
|
|
24
25
|
.filter((tool) => EXPERIMENTAL_TOOLS.includes(tool));
|
|
25
26
|
}
|
|
27
|
+
function parseWixAuthorizationArg() {
|
|
28
|
+
return parsedArgs['wixAuthorization'];
|
|
29
|
+
}
|
|
26
30
|
function parseToolsArg() {
|
|
27
31
|
const toolsArg = parsedArgs['tools'];
|
|
28
32
|
const experimentalTools = parseExperimentalArg();
|
|
@@ -80,6 +84,24 @@ const cliTools = activeTools.filter((tool) => VALID_CLI_TOOLS.includes(tool));
|
|
|
80
84
|
if (cliTools.length > 0) {
|
|
81
85
|
logger.log('Adding cli tools:', cliTools, 'isWixOne:', isWixOne);
|
|
82
86
|
addCliTools(server, cliTools, isWixOne);
|
|
87
|
+
if (cliTools.includes('WIX_API')) {
|
|
88
|
+
const wixAuthorization = parseWixAuthorizationArg();
|
|
89
|
+
if (wixAuthorization) {
|
|
90
|
+
logger.log('Using wixAuthorization argument for WIX_API');
|
|
91
|
+
const cliAuthStrategy = {
|
|
92
|
+
getSiteAuthHeaders: () => ({
|
|
93
|
+
Authorization: wixAuthorization
|
|
94
|
+
}),
|
|
95
|
+
getAccountAuthHeaders: () => ({
|
|
96
|
+
Authorization: wixAuthorization
|
|
97
|
+
})
|
|
98
|
+
};
|
|
99
|
+
addApiCallTool(server, cliAuthStrategy, ['CallWixSiteAPI']);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
logger.error('WIX_API tool requires missing wixAuthorization argument to be set. Will not add WIX_API tool.');
|
|
103
|
+
}
|
|
104
|
+
}
|
|
83
105
|
}
|
|
84
106
|
try {
|
|
85
107
|
const portals = parsedArgs['portals']?.split(',') || [];
|
package/build/dts/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../../src/bin.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAE3B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAY,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAW,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../../src/bin.ts"],"names":[],"mappings":"AAAA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|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WixMcpServer } from '../wix-mcp-server.js';
|
|
2
|
-
export declare const VALID_CLI_TOOLS: readonly ["WIX_API", "CLI_COMMAND"
|
|
2
|
+
export declare const VALID_CLI_TOOLS: readonly ["WIX_API", "CLI_COMMAND"];
|
|
3
3
|
export type CLITool = (typeof VALID_CLI_TOOLS)[number];
|
|
4
4
|
export declare function addCliTools(server: WixMcpServer, allowedTools?: CLITool[], isWixOne?: boolean): void;
|
|
5
5
|
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/cli-tools/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/cli-tools/cli.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,eAAO,MAAM,eAAe,qCAAsC,CAAC;AACnE,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,wBAAgB,WAAW,CACzB,MAAM,EAAE,YAAY,EACpB,YAAY,GAAE,OAAO,EAAoB,EACzC,QAAQ,GAAE,OAAe,QA0J1B"}
|