Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,5 @@ process.on("exit", () => {
logger.flush();
});


export { setLogger } from "./logger.js";
export { BrowserStackMcpServer } from "./server-factory.js";
2 changes: 1 addition & 1 deletion src/server-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class BrowserStackMcpServer {
public getTools(): Record<string, RegisteredTool> {
return this.tools;
}

public getTool(name: string): RegisteredTool | undefined {
return this.tools[name];
}
Expand Down
21 changes: 16 additions & 5 deletions src/tools/live.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// File: src/tools/live.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";
import logger from "../logger.js";
import { startBrowserSession } from "./live-utils/start-session.js";
import { PlatformType } from "./live-utils/types.js";
import { trackMCP } from "../lib/instrumentation.js";
import { BrowserStackConfig } from "../lib/types.js";
import globalConfig from "../config.js";

// Define the schema shape
const LiveArgsShape = {
Expand Down Expand Up @@ -97,13 +97,24 @@ async function runBrowserSession(rawArgs: any, config: BrowserStackConfig) {
? await launchDesktopSession(args, config)
: await launchMobileSession(args, config);

return {
content: [
let response = [
{
type: "text" as const,
text: `✅ Session started. If it didn't open automatically, visit:\n${launchUrl}`,
},
];

if (globalConfig.REMOTE_MCP) {
response = [
{
type: "text" as const,
text: `✅ Session started. If it didn't open automatically, visit:\n${launchUrl}`,
text: `✅ To start the session. Click on ${launchUrl}`,
},
],
];
}

return {
content: response,
};
}

Expand Down