From d537606b8c08985fffd0c274aaa8badd35c756da Mon Sep 17 00:00:00 2001 From: manoj-k04 Date: Fri, 30 Jan 2026 12:17:30 +0530 Subject: [PATCH 1/3] Fix: WDIO integration using MCP --- src/tools/sdk-utils/bstack/constants.ts | 5 ++++- src/tools/sdk-utils/bstack/frameworks.ts | 5 ++++- src/tools/sdk-utils/bstack/sdkHandler.ts | 2 +- src/tools/sdk-utils/common/types.ts | 2 +- src/tools/sdk-utils/common/utils.ts | 2 +- src/tools/sdk-utils/percy-bstack/handler.ts | 2 +- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/tools/sdk-utils/bstack/constants.ts b/src/tools/sdk-utils/bstack/constants.ts index 47a7bac8..671a8ec1 100644 --- a/src/tools/sdk-utils/bstack/constants.ts +++ b/src/tools/sdk-utils/bstack/constants.ts @@ -643,7 +643,6 @@ export const SUPPORTED_CONFIGURATIONS: ConfigMapping = { }, selenium: { jest: { instructions: nodejsInstructions }, - webdriverio: { instructions: webdriverioInstructions }, mocha: { instructions: nodejsInstructions }, cucumber: { instructions: nodejsInstructions }, nightwatch: { instructions: nodejsInstructions }, @@ -652,5 +651,9 @@ export const SUPPORTED_CONFIGURATIONS: ConfigMapping = { cypress: { cypress: { instructions: cypressInstructions }, }, + webdriverio: { + mocha: { instructions: webdriverioInstructions }, + cucumber: { instructions: webdriverioInstructions }, + }, }, }; diff --git a/src/tools/sdk-utils/bstack/frameworks.ts b/src/tools/sdk-utils/bstack/frameworks.ts index cfacb315..f00932c2 100644 --- a/src/tools/sdk-utils/bstack/frameworks.ts +++ b/src/tools/sdk-utils/bstack/frameworks.ts @@ -46,7 +46,6 @@ export const SUPPORTED_CONFIGURATIONS: ConfigMapping = { }, selenium: { jest: { instructions: constants.nodejsInstructions }, - webdriverio: { instructions: constants.webdriverioInstructions }, mocha: { instructions: constants.nodejsInstructions }, cucumber: { instructions: constants.nodejsInstructions }, nightwatch: { instructions: constants.nodejsInstructions }, @@ -55,5 +54,9 @@ export const SUPPORTED_CONFIGURATIONS: ConfigMapping = { cypress: { cypress: { instructions: constants.cypressInstructions }, }, + webdriverio: { + mocha: { instructions: constants.webdriverioInstructions }, + cucumber: { instructions: constants.webdriverioInstructions }, + }, }, }; diff --git a/src/tools/sdk-utils/bstack/sdkHandler.ts b/src/tools/sdk-utils/bstack/sdkHandler.ts index b88617ae..52d48b26 100644 --- a/src/tools/sdk-utils/bstack/sdkHandler.ts +++ b/src/tools/sdk-utils/bstack/sdkHandler.ts @@ -52,7 +52,7 @@ export async function runBstackSDKOnly( // Handle frameworks with unique setup instructions that don't use browserstack.yml if ( input.detectedBrowserAutomationFramework === "cypress" || - input.detectedTestingFramework === "webdriverio" + input.detectedBrowserAutomationFramework === "webdriverio" ) { const frameworkInstructions = getInstructionsForProjectConfiguration( input.detectedBrowserAutomationFramework as SDKSupportedBrowserAutomationFramework, diff --git a/src/tools/sdk-utils/common/types.ts b/src/tools/sdk-utils/common/types.ts index 3994a899..decbb1d2 100644 --- a/src/tools/sdk-utils/common/types.ts +++ b/src/tools/sdk-utils/common/types.ts @@ -16,6 +16,7 @@ export enum SDKSupportedBrowserAutomationFrameworkEnum { playwright = "playwright", selenium = "selenium", cypress = "cypress", + webdriverio = "webdriverio", } export type SDKSupportedBrowserAutomationFramework = keyof typeof SDKSupportedBrowserAutomationFrameworkEnum; @@ -29,7 +30,6 @@ export enum SDKSupportedTestingFrameworkEnum { behave = "behave", cucumber = "cucumber", nightwatch = "nightwatch", - webdriverio = "webdriverio", mocha = "mocha", junit4 = "junit4", junit5 = "junit5", diff --git a/src/tools/sdk-utils/common/utils.ts b/src/tools/sdk-utils/common/utils.ts index ba167c1a..95d55204 100644 --- a/src/tools/sdk-utils/common/utils.ts +++ b/src/tools/sdk-utils/common/utils.ts @@ -80,7 +80,7 @@ export async function formatToolResult( if (runType != "percy-web") { finalContent.push({ type: "text", - text: "CRITICAL: After the build is run, you MUST explicitly ask the user if they want to perform RCA (Root Cause Analysis) for any failed tests. This step is mandatory and should not be skipped.", + text: "CRITICAL: After the build is run, you MUST explicitly ask the user if they want to perform RCA (Root Cause Analysis) for any failed tests using RCA tool. This step is mandatory and should not be skipped.", }); } diff --git a/src/tools/sdk-utils/percy-bstack/handler.ts b/src/tools/sdk-utils/percy-bstack/handler.ts index 9ee200fc..a3ae6cd9 100644 --- a/src/tools/sdk-utils/percy-bstack/handler.ts +++ b/src/tools/sdk-utils/percy-bstack/handler.ts @@ -51,7 +51,7 @@ export function runPercyWithBrowserstackSDK( // Handle frameworks with unique setup instructions that don't use browserstack.yml if ( input.detectedBrowserAutomationFramework === "cypress" || - input.detectedTestingFramework === "webdriverio" + input.detectedBrowserAutomationFramework === "webdriverio" ) { const frameworkInstructions = getInstructionsForProjectConfiguration( input.detectedBrowserAutomationFramework as SDKSupportedBrowserAutomationFramework, From b16936cddb455c8edf219613ca61b32b3f3f36cd Mon Sep 17 00:00:00 2001 From: manoj-k04 Date: Fri, 30 Jan 2026 12:25:11 +0530 Subject: [PATCH 2/3] Version bump to 1.2.11 --- package-lock.json | 4 ++-- package.json | 2 +- server.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index d4b28bb6..69a1d532 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@browserstack/mcp-server", - "version": "1.2.10", + "version": "1.2.11", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@browserstack/mcp-server", - "version": "1.2.10", + "version": "1.2.11", "license": "ISC", "dependencies": { "@modelcontextprotocol/sdk": "^1.25.2", diff --git a/package.json b/package.json index 7628086a..a69318b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@browserstack/mcp-server", - "version": "1.2.10", + "version": "1.2.11", "description": "BrowserStack's Official MCP Server", "mcpName": "io.github.browserstack/mcp-server", "main": "dist/index.js", diff --git a/server.json b/server.json index 23654c23..bc66ea0b 100644 --- a/server.json +++ b/server.json @@ -11,7 +11,7 @@ { "registryType": "npm", "identifier": "@browserstack/mcp-server", - "version": "1.2.10", + "version": "1.2.11", "transport": { "type": "stdio" }, From 31ac79579a049836e74dee39c112560127b27200 Mon Sep 17 00:00:00 2001 From: manoj-k04 Date: Fri, 30 Jan 2026 14:28:51 +0530 Subject: [PATCH 3/3] Update src/tools/sdk-utils/common/utils.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/tools/sdk-utils/common/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/sdk-utils/common/utils.ts b/src/tools/sdk-utils/common/utils.ts index 95d55204..1bc2106b 100644 --- a/src/tools/sdk-utils/common/utils.ts +++ b/src/tools/sdk-utils/common/utils.ts @@ -80,7 +80,7 @@ export async function formatToolResult( if (runType != "percy-web") { finalContent.push({ type: "text", - text: "CRITICAL: After the build is run, you MUST explicitly ask the user if they want to perform RCA (Root Cause Analysis) for any failed tests using RCA tool. This step is mandatory and should not be skipped.", + text: "CRITICAL: After the build is run, you MUST explicitly ask the user if they want to perform RCA (Root Cause Analysis) for any failed tests using the RCA tool. This step is mandatory and should not be skipped.", }); }