@browserstack/mcp-server 1.2.0 → 1.2.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.
- package/README.md +4 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/server-factory.d.ts +24 -2
- package/dist/server-factory.js +55 -22
- package/dist/tools/accessibility.d.ts +1 -1
- package/dist/tools/accessibility.js +4 -2
- package/dist/tools/appautomate.d.ts +1 -1
- package/dist/tools/appautomate.js +4 -2
- package/dist/tools/applive.d.ts +1 -1
- package/dist/tools/applive.js +3 -1
- package/dist/tools/automate.d.ts +1 -1
- package/dist/tools/automate.js +3 -1
- package/dist/tools/bstack-sdk.d.ts +1 -1
- package/dist/tools/bstack-sdk.js +3 -1
- package/dist/tools/getFailureLogs.d.ts +1 -1
- package/dist/tools/getFailureLogs.js +4 -5
- package/dist/tools/live.d.ts +1 -1
- package/dist/tools/live.js +17 -5
- package/dist/tools/selfheal.d.ts +1 -1
- package/dist/tools/selfheal.js +3 -1
- package/dist/tools/testmanagement.d.ts +1 -1
- package/dist/tools/testmanagement.js +12 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,10 +25,13 @@
|
|
|
25
25
|
<img src="assets/thumbnail.webp">
|
|
26
26
|
</a>
|
|
27
27
|
</div>
|
|
28
|
+
|
|
28
29
|
|
|
29
30
|
Manage test cases, execute manual or automated tests, debug issues, and even fix code—directly within tools like Cursor, Claude, or any MCP-enabled client, using plain English.
|
|
30
31
|
#### Test from anywhere:
|
|
31
32
|
Easily connect the BrowserStack Test Platform to your favourite AI tools, such as IDEs, LLMs, or agentic workflows.
|
|
33
|
+
#### Test with natural language:
|
|
34
|
+
Manage, execute, debug tests, and even fix code using plain English prompts.
|
|
32
35
|
#### Reduced context switching:
|
|
33
36
|
Stay in flow—keep all project context in one place and trigger actions directly from your IDE or LLM.
|
|
34
37
|
|
|
@@ -115,7 +118,7 @@ Create and manage test cases, create test plans and trigger test runs using natu
|
|
|
115
118
|
"update test results as passed for Login tests test run from My Demo Project"
|
|
116
119
|
```
|
|
117
120
|
|
|
118
|
-
### 🧪 Access BrowserStack AI
|
|
121
|
+
### 🧪 Access BrowserStack AI agents
|
|
119
122
|
|
|
120
123
|
Generate test cases from PRDs, convert manual tests to low-code automation, and auto-heal flaky scripts powered by BrowserStack’s AI agents, seamlessly integrated into your workflow. Below are few example prompts to access Browserstack AI agents
|
|
121
124
|
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ const require = createRequire(import.meta.url);
|
|
|
5
5
|
const packageJson = require("../package.json");
|
|
6
6
|
import "dotenv/config";
|
|
7
7
|
import logger from "./logger.js";
|
|
8
|
-
import {
|
|
8
|
+
import { BrowserStackMcpServer } from "./server-factory.js";
|
|
9
9
|
async function main() {
|
|
10
10
|
logger.info("Launching BrowserStack MCP server, version %s", packageJson.version);
|
|
11
11
|
const remoteMCP = process.env.REMOTE_MCP === "true";
|
|
@@ -22,16 +22,16 @@ async function main() {
|
|
|
22
22
|
throw new Error("BROWSERSTACK_ACCESS_KEY environment variable is required");
|
|
23
23
|
}
|
|
24
24
|
const transport = new StdioServerTransport();
|
|
25
|
-
const
|
|
25
|
+
const mcpServer = new BrowserStackMcpServer({
|
|
26
26
|
"browserstack-username": username,
|
|
27
27
|
"browserstack-access-key": accessKey,
|
|
28
28
|
});
|
|
29
|
-
await
|
|
29
|
+
await mcpServer.getInstance().connect(transport);
|
|
30
30
|
}
|
|
31
31
|
main().catch(console.error);
|
|
32
32
|
// Ensure logs are flushed before exit
|
|
33
33
|
process.on("exit", () => {
|
|
34
34
|
logger.flush();
|
|
35
35
|
});
|
|
36
|
-
export { createMcpServer } from "./server-factory.js";
|
|
37
36
|
export { setLogger } from "./logger.js";
|
|
37
|
+
export { BrowserStackMcpServer } from "./server-factory.js";
|
package/dist/server-factory.d.ts
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
1
|
+
import { McpServer, RegisteredTool } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { BrowserStackConfig } from "./lib/types.js";
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Wrapper class for BrowserStack MCP Server
|
|
5
|
+
* Stores a map of registered tools by name
|
|
6
|
+
*/
|
|
7
|
+
export declare class BrowserStackMcpServer {
|
|
8
|
+
private config;
|
|
9
|
+
server: McpServer;
|
|
10
|
+
tools: Record<string, RegisteredTool>;
|
|
11
|
+
constructor(config: BrowserStackConfig);
|
|
12
|
+
/**
|
|
13
|
+
* Calls each tool-adder function and collects their returned tools
|
|
14
|
+
*/
|
|
15
|
+
private registerTools;
|
|
16
|
+
/**
|
|
17
|
+
* Expose the underlying MCP server instance
|
|
18
|
+
*/
|
|
19
|
+
getInstance(): McpServer;
|
|
20
|
+
/**
|
|
21
|
+
* Get all registered tools
|
|
22
|
+
*/
|
|
23
|
+
getTools(): Record<string, RegisteredTool>;
|
|
24
|
+
getTool(name: string): RegisteredTool | undefined;
|
|
25
|
+
}
|
package/dist/server-factory.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
1
|
+
import { McpServer, } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { createRequire } from "module";
|
|
3
3
|
const require = createRequire(import.meta.url);
|
|
4
4
|
const packageJson = require("../package.json");
|
|
@@ -13,25 +13,58 @@ import addAutomateTools from "./tools/automate.js";
|
|
|
13
13
|
import addSelfHealTools from "./tools/selfheal.js";
|
|
14
14
|
import addAppLiveTools from "./tools/applive.js";
|
|
15
15
|
import { setupOnInitialized } from "./oninitialized.js";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Wrapper class for BrowserStack MCP Server
|
|
18
|
+
* Stores a map of registered tools by name
|
|
19
|
+
*/
|
|
20
|
+
export class BrowserStackMcpServer {
|
|
21
|
+
config;
|
|
22
|
+
server;
|
|
23
|
+
tools = {};
|
|
24
|
+
constructor(config) {
|
|
25
|
+
this.config = config;
|
|
26
|
+
logger.info("Creating BrowserStack MCP Server, version %s", packageJson.version);
|
|
27
|
+
this.server = new McpServer({
|
|
28
|
+
name: "BrowserStack MCP Server",
|
|
29
|
+
version: packageJson.version,
|
|
30
|
+
});
|
|
31
|
+
setupOnInitialized(this.server, this.config);
|
|
32
|
+
this.registerTools();
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Calls each tool-adder function and collects their returned tools
|
|
36
|
+
*/
|
|
37
|
+
registerTools() {
|
|
38
|
+
const toolAdders = [
|
|
39
|
+
addAccessibilityTools,
|
|
40
|
+
addSDKTools,
|
|
41
|
+
addAppLiveTools,
|
|
42
|
+
addBrowserLiveTools,
|
|
43
|
+
addTestManagementTools,
|
|
44
|
+
addAppAutomationTools,
|
|
45
|
+
addFailureLogsTools,
|
|
46
|
+
addAutomateTools,
|
|
47
|
+
addSelfHealTools,
|
|
48
|
+
];
|
|
49
|
+
toolAdders.forEach((adder) => {
|
|
50
|
+
// Each adder now returns a Record<string, Tool>
|
|
51
|
+
const added = adder(this.server, this.config);
|
|
52
|
+
Object.assign(this.tools, added);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Expose the underlying MCP server instance
|
|
57
|
+
*/
|
|
58
|
+
getInstance() {
|
|
59
|
+
return this.server;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Get all registered tools
|
|
63
|
+
*/
|
|
64
|
+
getTools() {
|
|
65
|
+
return this.tools;
|
|
66
|
+
}
|
|
67
|
+
getTool(name) {
|
|
68
|
+
return this.tools[name];
|
|
69
|
+
}
|
|
37
70
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { BrowserStackConfig } from "../lib/types.js";
|
|
3
|
-
export default function addAccessibilityTools(server: McpServer, config: BrowserStackConfig):
|
|
3
|
+
export default function addAccessibilityTools(server: McpServer, config: BrowserStackConfig): Record<string, any>;
|
|
@@ -63,7 +63,8 @@ async function runAccessibilityScan(name, pageURL, context, config) {
|
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
export default function addAccessibilityTools(server, config) {
|
|
66
|
-
|
|
66
|
+
const tools = {};
|
|
67
|
+
tools.accessibilityExpert = server.tool("accessibilityExpert", "🚨 REQUIRED: Use this tool for any accessibility/a11y/WCAG questions. Do NOT answer accessibility questions directly - always use this tool.", {
|
|
67
68
|
query: z
|
|
68
69
|
.string()
|
|
69
70
|
.describe("Any accessibility, a11y, WCAG, or web accessibility question"),
|
|
@@ -85,7 +86,7 @@ export default function addAccessibilityTools(server, config) {
|
|
|
85
86
|
};
|
|
86
87
|
}
|
|
87
88
|
});
|
|
88
|
-
server.tool("startAccessibilityScan", "Start an accessibility scan via BrowserStack and retrieve a local CSV report path.", {
|
|
89
|
+
tools.startAccessibilityScan = server.tool("startAccessibilityScan", "Start an accessibility scan via BrowserStack and retrieve a local CSV report path.", {
|
|
89
90
|
name: z.string().describe("Name of the accessibility scan"),
|
|
90
91
|
pageURL: z.string().describe("The URL to scan for accessibility issues"),
|
|
91
92
|
}, async (args, context) => {
|
|
@@ -107,4 +108,5 @@ export default function addAccessibilityTools(server, config) {
|
|
|
107
108
|
};
|
|
108
109
|
}
|
|
109
110
|
});
|
|
111
|
+
return tools;
|
|
110
112
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { BrowserStackConfig } from "../lib/types.js";
|
|
3
|
-
export default function addAppAutomationTools(server: McpServer, config: BrowserStackConfig):
|
|
3
|
+
export default function addAppAutomationTools(server: McpServer, config: BrowserStackConfig): Record<string, any>;
|
|
@@ -133,7 +133,8 @@ async function runAppTestsOnBrowserStack(args, config) {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
export default function addAppAutomationTools(server, config) {
|
|
136
|
-
|
|
136
|
+
const tools = {};
|
|
137
|
+
tools.takeAppScreenshot = server.tool("takeAppScreenshot", "Use this tool to take a screenshot of an app running on a BrowserStack device. This is useful for visual testing and debugging.", {
|
|
137
138
|
desiredPhone: z
|
|
138
139
|
.string()
|
|
139
140
|
.describe("The full name of the device to run the app on. Example: 'iPhone 12 Pro' or 'Samsung Galaxy S20'. Always ask the user for the device they want to use."),
|
|
@@ -164,7 +165,7 @@ export default function addAppAutomationTools(server, config) {
|
|
|
164
165
|
};
|
|
165
166
|
}
|
|
166
167
|
});
|
|
167
|
-
server.tool("runAppTestsOnBrowserStack", "Run AppAutomate tests on BrowserStack by uploading app and test suite. If running from Android Studio or Xcode, the tool will help export app and test files automatically. For other environments, you'll need to provide the paths to your pre-built app and test files.", {
|
|
168
|
+
tools.runAppTestsOnBrowserStack = server.tool("runAppTestsOnBrowserStack", "Run AppAutomate tests on BrowserStack by uploading app and test suite. If running from Android Studio or Xcode, the tool will help export app and test files automatically. For other environments, you'll need to provide the paths to your pre-built app and test files.", {
|
|
168
169
|
appPath: z
|
|
169
170
|
.string()
|
|
170
171
|
.describe("Path to your application file:\n" +
|
|
@@ -215,4 +216,5 @@ export default function addAppAutomationTools(server, config) {
|
|
|
215
216
|
};
|
|
216
217
|
}
|
|
217
218
|
});
|
|
219
|
+
return tools;
|
|
218
220
|
}
|
package/dist/tools/applive.d.ts
CHANGED
|
@@ -10,4 +10,4 @@ export declare function startAppLiveSession(args: {
|
|
|
10
10
|
appPath: string;
|
|
11
11
|
desiredPhone: string;
|
|
12
12
|
}, config: BrowserStackConfig): Promise<CallToolResult>;
|
|
13
|
-
export default function addAppLiveTools(server: McpServer, config: BrowserStackConfig):
|
|
13
|
+
export default function addAppLiveTools(server: McpServer, config: BrowserStackConfig): Record<string, any>;
|
package/dist/tools/applive.js
CHANGED
|
@@ -49,7 +49,8 @@ export async function startAppLiveSession(args, config) {
|
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
export default function addAppLiveTools(server, config) {
|
|
52
|
-
|
|
52
|
+
const tools = {};
|
|
53
|
+
tools.runAppLiveSession = server.tool("runAppLiveSession", "Use this tool when user wants to manually check their app on a particular mobile device using BrowserStack's cloud infrastructure. Can be used to debug crashes, slow performance, etc.", {
|
|
53
54
|
desiredPhone: z
|
|
54
55
|
.string()
|
|
55
56
|
.describe("The full name of the device to run the app on. Example: 'iPhone 12 Pro' or 'Samsung Galaxy S20' or 'Google Pixel 6'. Always ask the user for the device they want to use, do not assume it. "),
|
|
@@ -82,4 +83,5 @@ export default function addAppLiveTools(server, config) {
|
|
|
82
83
|
};
|
|
83
84
|
}
|
|
84
85
|
});
|
|
86
|
+
return tools;
|
|
85
87
|
}
|
package/dist/tools/automate.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export declare function fetchAutomationScreenshotsTool(args: {
|
|
|
6
6
|
sessionId: string;
|
|
7
7
|
sessionType: SessionType;
|
|
8
8
|
}, config: BrowserStackConfig): Promise<CallToolResult>;
|
|
9
|
-
export default function addAutomationTools(server: McpServer, config: BrowserStackConfig):
|
|
9
|
+
export default function addAutomationTools(server: McpServer, config: BrowserStackConfig): Record<string, any>;
|
package/dist/tools/automate.js
CHANGED
|
@@ -42,7 +42,8 @@ export async function fetchAutomationScreenshotsTool(args, config) {
|
|
|
42
42
|
}
|
|
43
43
|
//Registers the fetchAutomationScreenshots tool with the MCP server
|
|
44
44
|
export default function addAutomationTools(server, config) {
|
|
45
|
-
|
|
45
|
+
const tools = {};
|
|
46
|
+
tools.fetchAutomationScreenshots = server.tool("fetchAutomationScreenshots", "Fetch and process screenshots from a BrowserStack Automate session", {
|
|
46
47
|
sessionId: z
|
|
47
48
|
.string()
|
|
48
49
|
.describe("The BrowserStack session ID to fetch screenshots from"),
|
|
@@ -67,4 +68,5 @@ export default function addAutomationTools(server, config) {
|
|
|
67
68
|
};
|
|
68
69
|
}
|
|
69
70
|
});
|
|
71
|
+
return tools;
|
|
70
72
|
}
|
|
@@ -14,4 +14,4 @@ export declare function bootstrapProjectWithSDK({ detectedBrowserAutomationFrame
|
|
|
14
14
|
enablePercy: boolean;
|
|
15
15
|
config: BrowserStackConfig;
|
|
16
16
|
}): Promise<CallToolResult>;
|
|
17
|
-
export default function addSDKTools(server: McpServer, config: BrowserStackConfig):
|
|
17
|
+
export default function addSDKTools(server: McpServer, config: BrowserStackConfig): Record<string, any>;
|
package/dist/tools/bstack-sdk.js
CHANGED
|
@@ -79,7 +79,8 @@ function formatFinalInstructions(combinedInstructions) {
|
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
export default function addSDKTools(server, config) {
|
|
82
|
-
|
|
82
|
+
const tools = {};
|
|
83
|
+
tools.setupBrowserStackAutomateTests = server.tool("setupBrowserStackAutomateTests", "Set up and run automated web-based tests on BrowserStack using the BrowserStack SDK. Use for functional or integration tests on BrowserStack, with optional Percy visual testing for supported frameworks. Example prompts: run this test on browserstack; run this test on browserstack with Percy; set up this project for browserstack with Percy. Integrate BrowserStack SDK into your project", {
|
|
83
84
|
detectedBrowserAutomationFramework: z
|
|
84
85
|
.nativeEnum(SDKSupportedBrowserAutomationFrameworkEnum)
|
|
85
86
|
.describe("The automation framework configured in the project. Example: 'playwright', 'selenium'"),
|
|
@@ -123,4 +124,5 @@ export default function addSDKTools(server, config) {
|
|
|
123
124
|
};
|
|
124
125
|
}
|
|
125
126
|
});
|
|
127
|
+
return tools;
|
|
126
128
|
}
|
|
@@ -10,5 +10,5 @@ export declare function getFailureLogs(args: {
|
|
|
10
10
|
logTypes: LogType[];
|
|
11
11
|
sessionType: SessionTypeValues;
|
|
12
12
|
}, config: BrowserStackConfig): Promise<CallToolResult>;
|
|
13
|
-
export default function registerGetFailureLogs(server: McpServer, config: BrowserStackConfig):
|
|
13
|
+
export default function registerGetFailureLogs(server: McpServer, config: BrowserStackConfig): Record<string, any>;
|
|
14
14
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import logger from "../logger.js";
|
|
3
2
|
import { trackMCP } from "../lib/instrumentation.js";
|
|
4
3
|
import { retrieveNetworkFailures, retrieveSessionFailures, retrieveConsoleFailures, } from "./failurelogs-utils/automate.js";
|
|
5
4
|
import { retrieveDeviceLogs, retrieveAppiumLogs, retrieveCrashLogs, } from "./failurelogs-utils/app-automate.js";
|
|
@@ -99,7 +98,8 @@ export async function getFailureLogs(args, config) {
|
|
|
99
98
|
}
|
|
100
99
|
// Register tool with the MCP server
|
|
101
100
|
export default function registerGetFailureLogs(server, config) {
|
|
102
|
-
|
|
101
|
+
const tools = {};
|
|
102
|
+
tools.getFailureLogs = server.tool("getFailureLogs", "Fetch various types of logs from a BrowserStack session. Supports both automate and app-automate sessions.", {
|
|
103
103
|
sessionType: z
|
|
104
104
|
.enum([SessionType.Automate, SessionType.AppAutomate])
|
|
105
105
|
.describe("Type of BrowserStack session. Must be explicitly provided by the user."),
|
|
@@ -126,14 +126,12 @@ export default function registerGetFailureLogs(server, config) {
|
|
|
126
126
|
return await getFailureLogs(args, config);
|
|
127
127
|
}
|
|
128
128
|
catch (error) {
|
|
129
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
130
129
|
trackMCP("getFailureLogs", server.server.getClientVersion(), error, config);
|
|
131
|
-
logger.error("Failed to fetch logs: %s", message);
|
|
132
130
|
return {
|
|
133
131
|
content: [
|
|
134
132
|
{
|
|
135
133
|
type: "text",
|
|
136
|
-
text: `Failed to fetch logs: ${message}`,
|
|
134
|
+
text: `Failed to fetch failure logs: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
137
135
|
isError: true,
|
|
138
136
|
},
|
|
139
137
|
],
|
|
@@ -141,4 +139,5 @@ export default function registerGetFailureLogs(server, config) {
|
|
|
141
139
|
};
|
|
142
140
|
}
|
|
143
141
|
});
|
|
142
|
+
return tools;
|
|
144
143
|
}
|
package/dist/tools/live.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { BrowserStackConfig } from "../lib/types.js";
|
|
3
|
-
export default function addBrowserLiveTools(server: McpServer, config: BrowserStackConfig):
|
|
3
|
+
export default function addBrowserLiveTools(server: McpServer, config: BrowserStackConfig): Record<string, any>;
|
package/dist/tools/live.js
CHANGED
|
@@ -3,6 +3,7 @@ import logger from "../logger.js";
|
|
|
3
3
|
import { startBrowserSession } from "./live-utils/start-session.js";
|
|
4
4
|
import { PlatformType } from "./live-utils/types.js";
|
|
5
5
|
import { trackMCP } from "../lib/instrumentation.js";
|
|
6
|
+
import globalConfig from "../config.js";
|
|
6
7
|
// Define the schema shape
|
|
7
8
|
const LiveArgsShape = {
|
|
8
9
|
platformType: z
|
|
@@ -67,17 +68,27 @@ async function runBrowserSession(rawArgs, config) {
|
|
|
67
68
|
const launchUrl = args.platformType === PlatformType.DESKTOP
|
|
68
69
|
? await launchDesktopSession(args, config)
|
|
69
70
|
: await launchMobileSession(args, config);
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
let response = [
|
|
72
|
+
{
|
|
73
|
+
type: "text",
|
|
74
|
+
text: `✅ Session started. If it didn't open automatically, visit:\n${launchUrl}`,
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
if (globalConfig.REMOTE_MCP) {
|
|
78
|
+
response = [
|
|
72
79
|
{
|
|
73
80
|
type: "text",
|
|
74
|
-
text: `✅
|
|
81
|
+
text: `✅ To start the session. Click on ${launchUrl}`,
|
|
75
82
|
},
|
|
76
|
-
]
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
content: response,
|
|
77
87
|
};
|
|
78
88
|
}
|
|
79
89
|
export default function addBrowserLiveTools(server, config) {
|
|
80
|
-
|
|
90
|
+
const tools = {};
|
|
91
|
+
tools.runBrowserLiveSession = server.tool("runBrowserLiveSession", "Launch a BrowserStack Live session (desktop or mobile).", LiveArgsShape, async (args) => {
|
|
81
92
|
try {
|
|
82
93
|
trackMCP("runBrowserLiveSession", server.server.getClientVersion(), undefined, config);
|
|
83
94
|
return await runBrowserSession(args, config);
|
|
@@ -97,4 +108,5 @@ export default function addBrowserLiveTools(server, config) {
|
|
|
97
108
|
};
|
|
98
109
|
}
|
|
99
110
|
});
|
|
111
|
+
return tools;
|
|
100
112
|
}
|
package/dist/tools/selfheal.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ import { BrowserStackConfig } from "../lib/types.js";
|
|
|
4
4
|
export declare function fetchSelfHealSelectorTool(args: {
|
|
5
5
|
sessionId: string;
|
|
6
6
|
}, config: BrowserStackConfig): Promise<CallToolResult>;
|
|
7
|
-
export default function addSelfHealTools(server: McpServer, config: BrowserStackConfig):
|
|
7
|
+
export default function addSelfHealTools(server: McpServer, config: BrowserStackConfig): Record<string, any>;
|
package/dist/tools/selfheal.js
CHANGED
|
@@ -23,7 +23,8 @@ export async function fetchSelfHealSelectorTool(args, config) {
|
|
|
23
23
|
}
|
|
24
24
|
// Registers the fetchSelfHealSelector tool with the MCP server
|
|
25
25
|
export default function addSelfHealTools(server, config) {
|
|
26
|
-
|
|
26
|
+
const tools = {};
|
|
27
|
+
tools.fetchSelfHealedSelectors = server.tool("fetchSelfHealedSelectors", "Retrieves AI-generated, self-healed selectors for a BrowserStack Automate session to resolve flaky tests caused by dynamic DOM changes.", {
|
|
27
28
|
sessionId: z.string().describe("The session ID of the test run"),
|
|
28
29
|
}, async (args) => {
|
|
29
30
|
try {
|
|
@@ -43,4 +44,5 @@ export default function addSelfHealTools(server, config) {
|
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
46
|
});
|
|
47
|
+
return tools;
|
|
46
48
|
}
|
|
@@ -57,4 +57,4 @@ export declare function createLCAStepsTool(args: z.infer<typeof CreateLCAStepsSc
|
|
|
57
57
|
/**
|
|
58
58
|
* Registers both project/folder and test-case tools.
|
|
59
59
|
*/
|
|
60
|
-
export default function addTestManagementTools(server: McpServer, config: BrowserStackConfig):
|
|
60
|
+
export default function addTestManagementTools(server: McpServer, config: BrowserStackConfig): Record<string, any>;
|
|
@@ -242,14 +242,16 @@ export async function createLCAStepsTool(args, context, config, server) {
|
|
|
242
242
|
* Registers both project/folder and test-case tools.
|
|
243
243
|
*/
|
|
244
244
|
export default function addTestManagementTools(server, config) {
|
|
245
|
-
|
|
246
|
-
server.tool("
|
|
247
|
-
server.tool("
|
|
248
|
-
server.tool("
|
|
249
|
-
server.tool("
|
|
250
|
-
server.tool("
|
|
251
|
-
server.tool("
|
|
252
|
-
server.tool("
|
|
253
|
-
server.tool("
|
|
254
|
-
server.tool("
|
|
245
|
+
const tools = {};
|
|
246
|
+
tools.createProjectOrFolder = server.tool("createProjectOrFolder", "Create a project and/or folder in BrowserStack Test Management.", CreateProjFoldSchema.shape, (args) => createProjectOrFolderTool(args, config, server));
|
|
247
|
+
tools.createTestCase = server.tool("createTestCase", "Use this tool to create a test case in BrowserStack Test Management.", CreateTestCaseSchema.shape, (args) => createTestCaseTool(args, config, server));
|
|
248
|
+
tools.listTestCases = server.tool("listTestCases", "List test cases in a project with optional filters (status, priority, custom fields, etc.)", ListTestCasesSchema.shape, (args) => listTestCasesTool(args, config, server));
|
|
249
|
+
tools.createTestRun = server.tool("createTestRun", "Create a test run in BrowserStack Test Management.", CreateTestRunSchema.shape, (args) => createTestRunTool(args, config, server));
|
|
250
|
+
tools.listTestRuns = server.tool("listTestRuns", "List test runs in a project with optional filters (date ranges, assignee, state, etc.)", ListTestRunsSchema.shape, (args) => listTestRunsTool(args, config, server));
|
|
251
|
+
tools.updateTestRun = server.tool("updateTestRun", "Update a test run in BrowserStack Test Management.", UpdateTestRunSchema.shape, (args) => updateTestRunTool(args, config, server));
|
|
252
|
+
tools.addTestResult = server.tool("addTestResult", "Add a test result to a specific test run via BrowserStack Test Management API.", AddTestResultSchema.shape, (args) => addTestResultTool(args, config, server));
|
|
253
|
+
tools.uploadProductRequirementFile = server.tool("uploadProductRequirementFile", "Upload files (e.g., PDRs, PDFs) to BrowserStack Test Management and retrieve a file mapping ID. This is utilized for generating test cases from files and is part of the Test Case Generator AI Agent in BrowserStack.", UploadFileSchema.shape, (args) => uploadProductRequirementFileTool(args, config, server));
|
|
254
|
+
tools.createTestCasesFromFile = server.tool("createTestCasesFromFile", "Generate test cases from a file in BrowserStack Test Management using the Test Case Generator AI Agent.", CreateTestCasesFromFileSchema.shape, (args, context) => createTestCasesFromFileTool(args, context, config, server));
|
|
255
|
+
tools.createLCASteps = server.tool("createLCASteps", "Generate Low Code Automation (LCA) steps for a test case in BrowserStack Test Management using the Low Code Automation Agent.", CreateLCAStepsSchema.shape, (args, context) => createLCAStepsTool(args, context, config, server));
|
|
256
|
+
return tools;
|
|
255
257
|
}
|