diff --git a/src/index.ts b/src/index.ts index 2c5d1a7f..dec3584b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -48,6 +48,5 @@ process.on("exit", () => { logger.flush(); }); - export { setLogger } from "./logger.js"; export { BrowserStackMcpServer } from "./server-factory.js"; diff --git a/src/server-factory.ts b/src/server-factory.ts index 228e3bbe..70887201 100644 --- a/src/server-factory.ts +++ b/src/server-factory.ts @@ -80,7 +80,7 @@ export class BrowserStackMcpServer { public getTools(): Record { return this.tools; } - + public getTool(name: string): RegisteredTool | undefined { return this.tools[name]; } diff --git a/src/tools/live.ts b/src/tools/live.ts index b1aa42e1..f6fd9487 100644 --- a/src/tools/live.ts +++ b/src/tools/live.ts @@ -1,4 +1,3 @@ -// File: src/tools/live.ts import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import logger from "../logger.js"; @@ -6,6 +5,7 @@ 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 = { @@ -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, }; }