@browserstack/mcp-server 1.2.12 → 1.2.13-beta.1

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.
@@ -48,6 +48,7 @@ export declare function handleMCPError(toolName: string, server: McpServer, conf
48
48
  type: "resource_link";
49
49
  description?: string | undefined;
50
50
  mimeType?: string | undefined;
51
+ size?: number | undefined;
51
52
  annotations?: {
52
53
  audience?: ("user" | "assistant")[] | undefined;
53
54
  priority?: number | undefined;
@@ -101,7 +101,7 @@ async function fetchAccessibilityIssues(scanId, scanRunId, config, cursor = 0) {
101
101
  async function executeAccessibilityScan(args, context, server, config) {
102
102
  try {
103
103
  trackMCP("startAccessibilityScan", server.server.getClientVersion(), undefined, config);
104
- return await runAccessibilityScan(args.name, args.pageURL, context, config, args.authConfigId);
104
+ return await runAccessibilityScan(args.name, args.pageURL, context, config, args.authConfigId, args.advancedRules);
105
105
  }
106
106
  catch (error) {
107
107
  return handleMCPError("startAccessibilityScan", server, config, error);
@@ -191,9 +191,9 @@ function createScanSuccessResponse(name, totalIssues, pageLength, records, scanI
191
191
  }
192
192
  return createSuccessResponse(messages);
193
193
  }
194
- async function runAccessibilityScan(name, pageURL, context, config, authConfigId) {
194
+ async function runAccessibilityScan(name, pageURL, context, config, authConfigId, advancedRules) {
195
195
  const scanner = await initializeScanner(config);
196
- const startResp = await scanner.startScan(name, [pageURL], authConfigId);
196
+ const startResp = await scanner.startScan(name, [pageURL], authConfigId, advancedRules);
197
197
  const scanId = startResp.data.id;
198
198
  const scanRunId = startResp.data.scanRunId;
199
199
  await notifyScanProgress(context, `Accessibility scan "${name}" started`, 0);
@@ -222,6 +222,10 @@ export default function addAccessibilityTools(server, config) {
222
222
  .number()
223
223
  .optional()
224
224
  .describe("Optional auth config ID for authenticated scans"),
225
+ advancedRules: z
226
+ .boolean()
227
+ .optional()
228
+ .describe("Enable advanced accessibility rules in the scan settings"),
225
229
  }, async (args, context) => {
226
230
  return await executeAccessibilityScan(args, context, server, config);
227
231
  });
@@ -19,7 +19,7 @@ export declare class AccessibilityScanner {
19
19
  username: string;
20
20
  password: string;
21
21
  }): void;
22
- startScan(name: string, urlList: string[], authConfigId?: number): Promise<AccessibilityScanResponse>;
22
+ startScan(name: string, urlList: string[], authConfigId?: number, advancedRules?: boolean): Promise<AccessibilityScanResponse>;
23
23
  pollStatus(scanId: string, scanRunId: string): Promise<AccessibilityScanStatus>;
24
24
  waitUntilComplete(scanId: string, scanRunId: string, context: any): Promise<string>;
25
25
  }
@@ -8,7 +8,7 @@ export class AccessibilityScanner {
8
8
  setAuth(auth) {
9
9
  this.auth = auth;
10
10
  }
11
- async startScan(name, urlList, authConfigId) {
11
+ async startScan(name, urlList, authConfigId, advancedRules) {
12
12
  if (!this.auth?.username || !this.auth?.password) {
13
13
  throw new Error("BrowserStack credentials are not set for AccessibilityScanner.");
14
14
  }
@@ -48,6 +48,9 @@ export class AccessibilityScanner {
48
48
  urlList: transformedUrlList,
49
49
  recurring: false,
50
50
  ...(authConfigId && { authConfigId }),
51
+ ...(advancedRules !== undefined && {
52
+ scanSettings: { advancedRules },
53
+ }),
51
54
  };
52
55
  let requestBody = baseRequestBody;
53
56
  if (hasLocal) {
@@ -222,6 +222,7 @@ export default function addAppAutomationTools(server, config) {
222
222
  text: `Error during app automation or screenshot capture: ${errorMessage}`,
223
223
  },
224
224
  ],
225
+ isError: true,
225
226
  };
226
227
  }
227
228
  });
@@ -36,7 +36,16 @@ export async function fetchAutomationScreenshotsTool(args, config) {
36
36
  }
37
37
  catch (error) {
38
38
  logger.error("Error during fetching screenshots", error);
39
- throw error;
39
+ const errorMessage = error instanceof Error ? error.message : "Unknown error";
40
+ return {
41
+ content: [
42
+ {
43
+ type: "text",
44
+ text: `Error during fetching screenshots: ${errorMessage}`,
45
+ },
46
+ ],
47
+ isError: true,
48
+ };
40
49
  }
41
50
  }
42
51
  //Registers the fetchAutomationScreenshots tool with the MCP server
@@ -64,6 +73,7 @@ export default function addAutomationTools(server, config) {
64
73
  text: `Error during fetching automate screenshots: ${errorMessage}`,
65
74
  },
66
75
  ],
76
+ isError: true,
67
77
  };
68
78
  }
69
79
  });
@@ -33,6 +33,7 @@ export async function getBuildIdTool(args, config) {
33
33
  text: `Error fetching build ID: ${errorMessage}`,
34
34
  },
35
35
  ],
36
+ isError: true,
36
37
  };
37
38
  }
38
39
  }
@@ -55,7 +56,16 @@ export async function fetchRCADataTool(args, config) {
55
56
  }
56
57
  catch (error) {
57
58
  logger.error("Error fetching RCA data", error);
58
- throw error;
59
+ const errorMessage = error instanceof Error ? error.message : "Unknown error";
60
+ return {
61
+ content: [
62
+ {
63
+ type: "text",
64
+ text: `Error fetching RCA data: ${errorMessage}`,
65
+ },
66
+ ],
67
+ isError: true,
68
+ };
59
69
  }
60
70
  }
61
71
  export async function listTestIdsTool(args, config) {
@@ -83,6 +93,7 @@ export async function listTestIdsTool(args, config) {
83
93
  text: `Error listing test IDs: ${errorMessage}`,
84
94
  },
85
95
  ],
96
+ isError: true,
86
97
  };
87
98
  }
88
99
  }
@@ -18,7 +18,16 @@ export async function fetchSelfHealSelectorTool(args, config) {
18
18
  }
19
19
  catch (error) {
20
20
  logger.error("Error fetching self-heal selector suggestions", error);
21
- throw error;
21
+ const errorMessage = error instanceof Error ? error.message : "Unknown error";
22
+ return {
23
+ content: [
24
+ {
25
+ type: "text",
26
+ text: `Error fetching self-heal selector suggestions: ${errorMessage}`,
27
+ },
28
+ ],
29
+ isError: true,
30
+ };
22
31
  }
23
32
  }
24
33
  // Registers the fetchSelfHealSelector tool with the MCP server
@@ -41,6 +50,7 @@ export default function addSelfHealTools(server, config) {
41
50
  text: `Error during fetching self-heal suggestions: ${errorMessage}`,
42
51
  },
43
52
  ],
53
+ isError: true,
44
54
  };
45
55
  }
46
56
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@browserstack/mcp-server",
3
- "version": "1.2.12",
3
+ "version": "1.2.13-beta.1",
4
4
  "description": "BrowserStack's Official MCP Server",
5
5
  "mcpName": "io.github.browserstack/mcp-server",
6
6
  "main": "dist/index.js",
@@ -35,19 +35,19 @@
35
35
  "author": "",
36
36
  "license": "ISC",
37
37
  "dependencies": {
38
- "@modelcontextprotocol/sdk": "^1.25.2",
38
+ "@modelcontextprotocol/sdk": "^1.29.0",
39
39
  "@types/form-data": "^2.5.2",
40
- "axios": "^1.13.2",
41
- "browserstack-local": "^1.5.8",
42
- "csv-parse": "^6.1.0",
43
- "dotenv": "^17.2.3",
40
+ "axios": "^1.14.0",
41
+ "browserstack-local": "^1.5.12",
42
+ "csv-parse": "^6.2.1",
43
+ "dotenv": "^17.4.0",
44
44
  "form-data": "^4.0.5",
45
- "pino": "^10.1.0",
45
+ "pino": "^10.3.1",
46
46
  "pino-pretty": "^13.1.3",
47
47
  "sharp": "^0.34.5",
48
48
  "uuid": "^13.0.0",
49
- "webdriverio": "^9.21.0",
50
- "zod": "^4.2.1"
49
+ "webdriverio": "^9.27.0",
50
+ "zod": "^4.3.6"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@eslint/js": "^9.39.2",