@wix/mcp 1.0.6 → 1.0.8
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/api-call/index.d.ts +3 -0
- package/build/api-call/index.js +149 -0
- package/build/auth/index.d.ts +5 -0
- package/build/auth/index.js +1 -0
- package/build/bin-standalone.js +16370 -0
- package/build/bin-standalone.js.map +7 -0
- package/build/bin.d.ts +3 -3
- package/build/bin.js +82 -657
- package/build/cli-tools/cli.d.ts +4 -0
- package/build/cli-tools/cli.js +339 -0
- package/build/cli-tools/utils.d.ts +2 -0
- package/build/cli-tools/utils.js +25 -0
- package/build/docs/docs.d.ts +4 -0
- package/build/docs/docs.js +447 -0
- package/build/docs/long-content.d.ts +1 -0
- package/build/docs/long-content.js +1 -0
- package/build/docs/semanticSearch.d.ts +10 -0
- package/build/docs/semanticSearch.js +108 -0
- package/build/docs/semanticSearch.test.d.ts +1 -0
- package/build/docs/semanticSearch.test.js +459 -0
- package/build/index-standalone.js +18849 -0
- package/build/index-standalone.js.map +7 -0
- package/build/index.d.ts +7 -30
- package/build/index.js +6 -193
- package/build/infra/bi-logger.d.ts +2 -0
- package/build/infra/bi-logger.js +10 -0
- package/build/infra/environment.d.ts +9 -0
- package/build/infra/environment.js +27 -0
- package/build/infra/logger.d.ts +10 -0
- package/build/infra/logger.js +61 -0
- package/build/infra/panorama.d.ts +7 -0
- package/build/infra/panorama.js +35 -0
- package/build/infra/sentry.d.ts +1 -0
- package/build/infra/sentry.js +10 -0
- package/build/interactive-command-tools/eventually.d.ts +6 -0
- package/build/interactive-command-tools/eventually.js +15 -0
- package/build/interactive-command-tools/handleStdout.d.ts +13 -0
- package/build/interactive-command-tools/handleStdout.js +75 -0
- package/build/interactive-command-tools/interactive-command-utils.d.ts +7 -0
- package/build/interactive-command-tools/interactive-command-utils.js +75 -0
- package/build/resources/docs.d.ts +2 -0
- package/build/resources/docs.js +45 -0
- package/build/support/index.d.ts +2 -0
- package/build/support/index.js +32 -0
- package/build/tool-utils.d.ts +2 -0
- package/build/tool-utils.js +30 -0
- package/build/tool-utils.spec.d.ts +1 -0
- package/build/tool-utils.spec.js +99 -0
- package/build/wix-mcp-server.d.ts +27 -0
- package/build/wix-mcp-server.js +114 -0
- package/package.json +16 -11
- package/bin.js +0 -2
- package/build/chunk-YRLMZUQM.js +0 -1834
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { logger } from '../infra/logger.js';
|
|
2
|
+
const getPortalIndex = async (portalName) => {
|
|
3
|
+
const response = await fetch(`https://dev.wix.com/digor/api/portal-index?portalName=${portalName}`);
|
|
4
|
+
const data = await response.json();
|
|
5
|
+
return data;
|
|
6
|
+
};
|
|
7
|
+
const addPortalResources = async (server, portalName) => {
|
|
8
|
+
// get portal index:
|
|
9
|
+
const portalIndexResponse = await getPortalIndex(portalName);
|
|
10
|
+
logger.log(`portalIndexResponse for ${portalName}`, JSON.stringify(portalIndexResponse, null, 2));
|
|
11
|
+
// for each portalIndex entry, add a resource to the server:
|
|
12
|
+
for (const entry of portalIndexResponse.portalIndex) {
|
|
13
|
+
logger.log(`entry ${JSON.stringify(entry, null, 2)}`);
|
|
14
|
+
const name = entry.url;
|
|
15
|
+
const uri = entry.url.replace('https://dev.wix.com/docs/', 'wix-docs://');
|
|
16
|
+
logger.log(`adding resource ${name} ${uri}`);
|
|
17
|
+
server.resource(name, uri, async (uri) => {
|
|
18
|
+
logger.log(`fetching resource ${uri}`);
|
|
19
|
+
const docsURL = uri
|
|
20
|
+
.toString()
|
|
21
|
+
.replace('wix-docs://', 'https://dev.wix.com/docs/');
|
|
22
|
+
const response = await fetch(`https://dev.wix.com/digor/api/get-article-content?articleUrl=${encodeURIComponent(docsURL)}`);
|
|
23
|
+
const data = await response.json();
|
|
24
|
+
return {
|
|
25
|
+
contents: [
|
|
26
|
+
{
|
|
27
|
+
uri: uri.href,
|
|
28
|
+
text: data.articleContent || 'No content found'
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export const addDocsResources = async (server, portals) => {
|
|
36
|
+
for (const portal of portals) {
|
|
37
|
+
try {
|
|
38
|
+
logger.log(`Processing portal: ${portal}`);
|
|
39
|
+
await addPortalResources(server, portal);
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
logger.error(`Error processing portal ${portal}:`, error);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function addSupportTool(server) {
|
|
3
|
+
server.tool('SupportAndFeedback', [
|
|
4
|
+
'If the user would like to provide Wix with some feedback (good or bad), about the tools in Wix MCP,',
|
|
5
|
+
'for example they used the tools provided, and they reflected satisfaction or dissatisfaction with the tools.',
|
|
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
|
+
'**IMPORTANT NOTE**',
|
|
8
|
+
'This tool is not sending the message, but formats it in order to another tool to actually send it'
|
|
9
|
+
].join('\n'), {
|
|
10
|
+
requestId: z
|
|
11
|
+
.string()
|
|
12
|
+
.optional()
|
|
13
|
+
.describe('request id if returned from the server in a failed API call to Wix'),
|
|
14
|
+
message: z.string().describe('The message to send to Wix')
|
|
15
|
+
}, async ({ requestId, message }) => {
|
|
16
|
+
return {
|
|
17
|
+
content: [
|
|
18
|
+
{
|
|
19
|
+
type: 'text',
|
|
20
|
+
text: `${message} ${requestId ? `request id: ${requestId}` : ''}`
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
type: 'text',
|
|
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.'
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const safeParseJSON = (text) => {
|
|
2
|
+
try {
|
|
3
|
+
return JSON.parse(text);
|
|
4
|
+
}
|
|
5
|
+
catch {
|
|
6
|
+
return text;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
export const handleWixAPIResponse = async (response) => {
|
|
10
|
+
const responseData = typeof response.data === 'string'
|
|
11
|
+
? safeParseJSON(response.data)
|
|
12
|
+
: response.data;
|
|
13
|
+
if (!response.status.toString().startsWith('2')) {
|
|
14
|
+
const requestId = response.headers.get('x-wix-request-id');
|
|
15
|
+
const errorDetails = typeof responseData === 'object'
|
|
16
|
+
? JSON.stringify(responseData)
|
|
17
|
+
: responseData;
|
|
18
|
+
throw new Error([
|
|
19
|
+
`Failed to call Wix API: ${response.status} ${response.statusText}.`,
|
|
20
|
+
requestId ? `request id: ${requestId}` : '',
|
|
21
|
+
// Wix 404 for API does not exist is huge (generic 404 page) and loaded to the context
|
|
22
|
+
response.status === 404 && errorDetails.includes('<html')
|
|
23
|
+
? 'Not found'
|
|
24
|
+
: errorDetails
|
|
25
|
+
]
|
|
26
|
+
.filter((str) => !!str)
|
|
27
|
+
.join('\n'));
|
|
28
|
+
}
|
|
29
|
+
return responseData;
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { handleWixAPIResponse } from './tool-utils.js';
|
|
2
|
+
import { expect, test, vi, describe, beforeEach } from 'vitest';
|
|
3
|
+
// Mock the global fetch function
|
|
4
|
+
global.fetch = vi.fn();
|
|
5
|
+
function mockHttpClientResponse(data, status = 200, statusText = 'OK', requestId = '') {
|
|
6
|
+
return {
|
|
7
|
+
requestId: '',
|
|
8
|
+
data,
|
|
9
|
+
status,
|
|
10
|
+
statusText,
|
|
11
|
+
headers: {
|
|
12
|
+
get: () => {
|
|
13
|
+
return requestId;
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
config: {},
|
|
17
|
+
request: {}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
describe('handleWixAPIResponse', () => {
|
|
21
|
+
beforeEach(() => {
|
|
22
|
+
// Reset the mock before each test
|
|
23
|
+
global.fetch.mockClear();
|
|
24
|
+
});
|
|
25
|
+
describe('safeParseJSON', () => {
|
|
26
|
+
test('should parse valid JSON string', async () => {
|
|
27
|
+
const jsonString = '{"key": "value", "number": 123}';
|
|
28
|
+
const result = await handleWixAPIResponse(mockHttpClientResponse(jsonString));
|
|
29
|
+
expect(result).toEqual({ key: 'value', number: 123 });
|
|
30
|
+
});
|
|
31
|
+
test('should return the original string if parsing fails', async () => {
|
|
32
|
+
const invalidJSONString = 'this is not valid json';
|
|
33
|
+
const result = await handleWixAPIResponse(mockHttpClientResponse(invalidJSONString));
|
|
34
|
+
expect(result).toBe(invalidJSONString);
|
|
35
|
+
});
|
|
36
|
+
test('should return an empty string if the response text is empty', async () => {
|
|
37
|
+
global.fetch.mockResolvedValueOnce(new Response('', { status: 200 }));
|
|
38
|
+
const result = await handleWixAPIResponse(mockHttpClientResponse(''));
|
|
39
|
+
expect(result).toBe('');
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
test('should return parsed JSON data for a successful response', async () => {
|
|
43
|
+
const mockData = { message: 'Success!' };
|
|
44
|
+
global.fetch.mockResolvedValueOnce(new Response(JSON.stringify(mockData), {
|
|
45
|
+
status: 200,
|
|
46
|
+
statusText: 'OK',
|
|
47
|
+
headers: new Headers({ 'Content-Type': 'application/json' })
|
|
48
|
+
}));
|
|
49
|
+
const result = await handleWixAPIResponse(mockHttpClientResponse(mockData));
|
|
50
|
+
expect(result).toEqual(mockData);
|
|
51
|
+
});
|
|
52
|
+
test('should return the original string if the successful response is not JSON', async () => {
|
|
53
|
+
const mockData = 'This is plain text';
|
|
54
|
+
global.fetch.mockResolvedValueOnce(new Response(mockData, { status: 200, statusText: 'OK' }));
|
|
55
|
+
const result = await handleWixAPIResponse(mockHttpClientResponse(mockData));
|
|
56
|
+
expect(result).toBe(mockData);
|
|
57
|
+
});
|
|
58
|
+
test('should throw an error for a failed response with JSON error details', async () => {
|
|
59
|
+
const mockError = { error: 'Something went wrong', code: 500 };
|
|
60
|
+
const mockRequestId = 'some-request-id';
|
|
61
|
+
await expect(handleWixAPIResponse(mockHttpClientResponse(mockError, 500, 'Internal Server Error', mockRequestId))).rejects.toThrowError([
|
|
62
|
+
'Failed to call Wix API: 500 Internal Server Error.',
|
|
63
|
+
`request id: ${mockRequestId}`,
|
|
64
|
+
'{"error":"Something went wrong","code":500}'
|
|
65
|
+
].join('\n'));
|
|
66
|
+
});
|
|
67
|
+
test('should throw an error for a failed response with non-JSON error details', async () => {
|
|
68
|
+
const mockError = 'Internal server error occurred.';
|
|
69
|
+
global.fetch.mockResolvedValueOnce(new Response(mockError, {
|
|
70
|
+
status: 503,
|
|
71
|
+
statusText: 'Service Unavailable'
|
|
72
|
+
}));
|
|
73
|
+
await expect(handleWixAPIResponse(mockHttpClientResponse(mockError, 503, 'Service Unavailable'))).rejects.toThrowError(['Failed to call Wix API: 503 Service Unavailable.', mockError].join('\n'));
|
|
74
|
+
});
|
|
75
|
+
test('should include the request ID in the error message if present', async () => {
|
|
76
|
+
const mockError = { message: 'Unauthorized' };
|
|
77
|
+
const mockRequestId = 'another-id';
|
|
78
|
+
global.fetch.mockResolvedValueOnce(new Response(JSON.stringify(mockError), {
|
|
79
|
+
status: 401,
|
|
80
|
+
statusText: 'Unauthorized',
|
|
81
|
+
headers: new Headers({ 'x-wix-request-id': mockRequestId })
|
|
82
|
+
}));
|
|
83
|
+
await expect(handleWixAPIResponse(mockHttpClientResponse(mockError, 401, 'Unauthorized', mockRequestId))).rejects.toThrowError([
|
|
84
|
+
'Failed to call Wix API: 401 Unauthorized.',
|
|
85
|
+
`request id: ${mockRequestId}`,
|
|
86
|
+
'{"message":"Unauthorized"}'
|
|
87
|
+
].join('\n'));
|
|
88
|
+
});
|
|
89
|
+
test('should return "Not found" in the error message for a 404 with HTML content', async () => {
|
|
90
|
+
const mockHtmlError = '<html><body><h1>404 Not Found</h1></body></html>';
|
|
91
|
+
global.fetch.mockResolvedValueOnce(new Response(mockHtmlError, { status: 404, statusText: 'Not Found' }));
|
|
92
|
+
await expect(handleWixAPIResponse(mockHttpClientResponse(mockHtmlError, 404, 'Not Found'))).rejects.toThrowError(['Failed to call Wix API: 404 Not Found.', 'Not found'].join('\n'));
|
|
93
|
+
});
|
|
94
|
+
test('should include the HTML content in the error message for a 404 without typical HTML structure', async () => {
|
|
95
|
+
const mockNonHtmlError = 'Resource not found on the server.';
|
|
96
|
+
global.fetch.mockResolvedValueOnce(new Response(mockNonHtmlError, { status: 404, statusText: 'Not Found' }));
|
|
97
|
+
await expect(handleWixAPIResponse(mockHttpClientResponse(mockNonHtmlError, 404, 'Not Found'))).rejects.toThrowError(['Failed to call Wix API: 404 Not Found.', mockNonHtmlError].join('\n'));
|
|
98
|
+
});
|
|
99
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { z, ZodRawShape, ZodTypeAny } from 'zod';
|
|
2
|
+
import type { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
3
|
+
import type { CallToolResult, Implementation } from '@modelcontextprotocol/sdk/types.js';
|
|
4
|
+
import type { BiLogger } from '@wix/wix-bi-logger-client';
|
|
5
|
+
import type { PanoramaClientForComponent } from '@wix/panorama-client-node';
|
|
6
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
7
|
+
import { HttpClient } from '@wix/http-client';
|
|
8
|
+
import { ServerOptions } from '@modelcontextprotocol/sdk/server/index.js';
|
|
9
|
+
type WixRequestHandlerExtra = RequestHandlerExtra & {
|
|
10
|
+
biLogger: BiLogger;
|
|
11
|
+
panorama: PanoramaClientForComponent;
|
|
12
|
+
httpClient: HttpClient;
|
|
13
|
+
};
|
|
14
|
+
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>;
|
|
15
|
+
export declare class WixMcpServer extends McpServer {
|
|
16
|
+
private biLogger;
|
|
17
|
+
private nodeEnv;
|
|
18
|
+
private sessionId;
|
|
19
|
+
private getUserId?;
|
|
20
|
+
constructor(serverInfo: Implementation, options?: ServerOptions, nodeEnv?: string);
|
|
21
|
+
setUserIdGetter(getUserId: () => string): void;
|
|
22
|
+
tool(name: string, cb: WixToolCallback): void;
|
|
23
|
+
tool(name: string, description: string, cb: WixToolCallback): void;
|
|
24
|
+
tool<Args extends ZodRawShape>(name: string, paramsSchema: Args, cb: WixToolCallback<Args>): void;
|
|
25
|
+
tool<Args extends ZodRawShape>(name: string, description: string, paramsSchema: Args, cb: WixToolCallback<Args>): void;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
+
import { captureException, setTags } from '@sentry/node';
|
|
3
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
|
+
import { wixMcpRequestSrc39Evid1607 } from '@wix/bi-logger-api-infra-data/v2';
|
|
5
|
+
import { createPanoramaClient } from './infra/panorama.js';
|
|
6
|
+
import { createBiLogger } from './infra/bi-logger.js';
|
|
7
|
+
import { DEV_ENVIRONMENTS, getEnvironment } from './infra/environment.js';
|
|
8
|
+
import { HttpClient } from '@wix/http-client';
|
|
9
|
+
export class WixMcpServer extends McpServer {
|
|
10
|
+
biLogger;
|
|
11
|
+
nodeEnv;
|
|
12
|
+
sessionId;
|
|
13
|
+
getUserId;
|
|
14
|
+
constructor(serverInfo, options, nodeEnv) {
|
|
15
|
+
super(serverInfo, options);
|
|
16
|
+
this.sessionId = uuidv4();
|
|
17
|
+
this.nodeEnv = getEnvironment(nodeEnv);
|
|
18
|
+
this.biLogger = createBiLogger({
|
|
19
|
+
_client_id: this.sessionId
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
setUserIdGetter(getUserId) {
|
|
23
|
+
this.getUserId = getUserId;
|
|
24
|
+
}
|
|
25
|
+
tool(...args) {
|
|
26
|
+
const cbIndex = args.findIndex((arg) => typeof arg === 'function');
|
|
27
|
+
if (cbIndex !== -1) {
|
|
28
|
+
const originalCb = args[cbIndex];
|
|
29
|
+
const toolName = args[0];
|
|
30
|
+
const isDevEnvironment = DEV_ENVIRONMENTS.includes(this.nodeEnv);
|
|
31
|
+
const wrappedCb = async (...cbArgs) => {
|
|
32
|
+
setTags({
|
|
33
|
+
panoramaSessionId: this.sessionId
|
|
34
|
+
});
|
|
35
|
+
const panorama = createPanoramaClient({
|
|
36
|
+
environment: this.nodeEnv,
|
|
37
|
+
sessionId: this.sessionId,
|
|
38
|
+
componentId: toolName,
|
|
39
|
+
uuid: this.getUserId?.()
|
|
40
|
+
});
|
|
41
|
+
const toolInvocationId = uuidv4();
|
|
42
|
+
const httpClient = new HttpClient({
|
|
43
|
+
headers: {
|
|
44
|
+
'x-wix-mcp': `execution-id=${toolInvocationId}`
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
const argsBeforeExtra = cbArgs.slice(0, cbArgs.length - 1);
|
|
48
|
+
const extra = cbArgs[cbArgs.length - 1];
|
|
49
|
+
const wrappedExtra = {
|
|
50
|
+
...extra,
|
|
51
|
+
panorama: panorama.createClientForComponent(),
|
|
52
|
+
httpClient
|
|
53
|
+
};
|
|
54
|
+
if (!isDevEnvironment) {
|
|
55
|
+
panorama.transaction(toolName).start({
|
|
56
|
+
toolInvocationId,
|
|
57
|
+
params: JSON.stringify(argsBeforeExtra)
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
const startTime = performance.now();
|
|
61
|
+
let toolSucceeded, errorBody;
|
|
62
|
+
try {
|
|
63
|
+
const cbResult = await originalCb(...argsBeforeExtra, wrappedExtra);
|
|
64
|
+
if (!isDevEnvironment) {
|
|
65
|
+
panorama.transaction(toolName).finish({ toolInvocationId });
|
|
66
|
+
}
|
|
67
|
+
toolSucceeded = true;
|
|
68
|
+
return cbResult;
|
|
69
|
+
}
|
|
70
|
+
catch (e) {
|
|
71
|
+
toolSucceeded = false;
|
|
72
|
+
errorBody = e.message;
|
|
73
|
+
if (!isDevEnvironment) {
|
|
74
|
+
panorama.errorMonitor().reportError(e);
|
|
75
|
+
captureException(e, {
|
|
76
|
+
tags: {
|
|
77
|
+
componentId: toolName,
|
|
78
|
+
toolName
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
isError: true,
|
|
84
|
+
content: [{ type: 'text', text: e.message }]
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
finally {
|
|
88
|
+
const endTime = performance.now();
|
|
89
|
+
const duration = Math.round(endTime - startTime);
|
|
90
|
+
if (!isDevEnvironment) {
|
|
91
|
+
if (this.getUserId) {
|
|
92
|
+
const userId = this.getUserId();
|
|
93
|
+
this.biLogger.updateDefaults({
|
|
94
|
+
_uuid: userId
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
this.biLogger.report(wixMcpRequestSrc39Evid1607({
|
|
98
|
+
toolInvocationId,
|
|
99
|
+
toolName,
|
|
100
|
+
params: JSON.stringify(argsBeforeExtra),
|
|
101
|
+
origin: this.nodeEnv,
|
|
102
|
+
duration,
|
|
103
|
+
sessionId: this.sessionId,
|
|
104
|
+
executionResult: toolSucceeded ? 'Success' : 'Error',
|
|
105
|
+
errorBody: errorBody
|
|
106
|
+
}));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
args[cbIndex] = wrappedCb;
|
|
111
|
+
}
|
|
112
|
+
return super.tool.apply(this, args);
|
|
113
|
+
}
|
|
114
|
+
}
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "A Model Context Protocol server for Wix AI tools",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"bin": "./bin.js",
|
|
6
|
+
"bin": "./build/bin-standalone.js",
|
|
7
7
|
"files": [
|
|
8
8
|
"build",
|
|
9
9
|
"README.md"
|
|
10
10
|
],
|
|
11
11
|
"scripts": {
|
|
12
|
-
"build": "tsc --noEmit &&
|
|
13
|
-
"test": "vitest run",
|
|
14
|
-
"test:watch": "vitest",
|
|
15
|
-
"start": "npm run build && node ./build/bin.js",
|
|
12
|
+
"build": "tsc --noEmit && node ./scripts/build.mjs",
|
|
13
|
+
"test": "NODE_ENV=TEST && vitest run",
|
|
14
|
+
"test:watch": "NODE_ENV=TEST && vitest",
|
|
15
|
+
"start": "NODE_ENV=DEV && npm run build && node ./build/bin.js",
|
|
16
16
|
"watch": "tsc --watch",
|
|
17
17
|
"lint": "eslint .",
|
|
18
18
|
"inspector": "npx @modelcontextprotocol/inspector build/bin.js"
|
|
@@ -35,21 +35,26 @@
|
|
|
35
35
|
"@eslint/js": "^9.25.1",
|
|
36
36
|
"@types/express": "^5.0.1",
|
|
37
37
|
"@types/minimist": "^1.2.5",
|
|
38
|
-
"@types/node": "^20.17.
|
|
38
|
+
"@types/node": "^20.17.32",
|
|
39
|
+
"@vespaiach/axios-fetch-adapter": "^0.3.1",
|
|
40
|
+
"@wix/bi-logger-api-infra-data": "^1.109.0",
|
|
41
|
+
"@wix/http-client": "^2.68.0",
|
|
39
42
|
"@wix/panorama-client-node": "^3.228.0",
|
|
43
|
+
"@wix/standalone-node-bi-logger": "^1.7.24",
|
|
44
|
+
"@wix/wix-bi-logger-client": "^1.0.4",
|
|
45
|
+
"esbuild": "^0.25.3",
|
|
40
46
|
"eslint": "^9.25.1",
|
|
41
47
|
"eslint-config-prettier": "^10.1.2",
|
|
42
48
|
"eslint-plugin-prettier": "^5.2.6",
|
|
43
49
|
"globals": "^16.0.0",
|
|
44
50
|
"prettier": "^3.5.3",
|
|
45
|
-
"tsup": "^8.4.0",
|
|
46
51
|
"typescript": "^5.8.3",
|
|
47
|
-
"typescript-eslint": "^8.31.
|
|
52
|
+
"typescript-eslint": "^8.31.1",
|
|
48
53
|
"vitest": "^3.1.2"
|
|
49
54
|
},
|
|
50
55
|
"exports": {
|
|
51
56
|
".": {
|
|
52
|
-
"import": "./build/index.js",
|
|
57
|
+
"import": "./build/index-standalone.js",
|
|
53
58
|
"types": "./build/index.d.ts"
|
|
54
59
|
},
|
|
55
60
|
"./package.json": "./package.json"
|
|
@@ -65,5 +70,5 @@
|
|
|
65
70
|
]
|
|
66
71
|
}
|
|
67
72
|
},
|
|
68
|
-
"falconPackageHash": "
|
|
73
|
+
"falconPackageHash": "1566f817c09451904eda12d4928c0382b320141c43336196946d224d"
|
|
69
74
|
}
|
package/bin.js
DELETED