mcp-scraper 0.3.4 → 0.3.6
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 +10 -26
- package/dist/bin/api-server.cjs +7 -9
- package/dist/bin/api-server.cjs.map +1 -1
- package/dist/bin/api-server.js +1 -1
- package/dist/bin/browser-agent-stdio-server.cjs +12 -12
- package/dist/bin/browser-agent-stdio-server.cjs.map +1 -1
- package/dist/bin/browser-agent-stdio-server.js +2 -2
- package/dist/bin/mcp-scraper-cli.cjs +10 -11
- package/dist/bin/mcp-scraper-cli.cjs.map +1 -1
- package/dist/bin/mcp-scraper-cli.js +10 -11
- package/dist/bin/mcp-scraper-cli.js.map +1 -1
- package/dist/bin/mcp-scraper-combined-stdio-server.cjs +19 -19
- package/dist/bin/mcp-scraper-combined-stdio-server.cjs.map +1 -1
- package/dist/bin/mcp-scraper-combined-stdio-server.js +4 -4
- package/dist/bin/mcp-scraper-install.cjs +8 -8
- package/dist/bin/mcp-scraper-install.cjs.map +1 -1
- package/dist/bin/mcp-scraper-install.js +2 -2
- package/dist/bin/mcp-stdio-server.cjs +1 -1
- package/dist/bin/mcp-stdio-server.cjs.map +1 -1
- package/dist/bin/mcp-stdio-server.js +2 -2
- package/dist/chunk-IHXHQL53.js +7 -0
- package/dist/chunk-IHXHQL53.js.map +1 -0
- package/dist/{chunk-YFR36CPB.js → chunk-ROZEDHAA.js} +2 -2
- package/dist/{chunk-C3FGVJWH.js → chunk-RVYHP7QN.js} +8 -8
- package/dist/chunk-RVYHP7QN.js.map +1 -0
- package/dist/{chunk-IZ3YH6HC.js → chunk-TK4D2BZ5.js} +13 -13
- package/dist/chunk-TK4D2BZ5.js.map +1 -0
- package/dist/{server-DU3W7QTG.js → server-YSKBD2VX.js} +9 -11
- package/dist/{server-DU3W7QTG.js.map → server-YSKBD2VX.js.map} +1 -1
- package/docs/mcp-tool-craft-lint.generated.md +1 -1
- package/docs/mcp-tool-manifest.generated.json +12 -15
- package/package.json +1 -1
- package/dist/chunk-BLB4CEFA.js +0 -7
- package/dist/chunk-BLB4CEFA.js.map +0 -1
- package/dist/chunk-C3FGVJWH.js.map +0 -1
- package/dist/chunk-IZ3YH6HC.js.map +0 -1
- /package/dist/{chunk-YFR36CPB.js.map → chunk-ROZEDHAA.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generatedAt": "2026-06-23T16:
|
|
2
|
+
"generatedAt": "2026-06-23T16:49:30.837Z",
|
|
3
3
|
"counts": {
|
|
4
4
|
"main_stdio": 24,
|
|
5
5
|
"browser_agent_stdio": 22,
|
|
@@ -963,18 +963,17 @@
|
|
|
963
963
|
"hasStructuredContent": true,
|
|
964
964
|
"writesLocalFiles": false,
|
|
965
965
|
"symptomTriggers": [
|
|
966
|
-
"
|
|
966
|
+
"a developer explicitly wants to inspect local Chrome account/profile metadata on the MCP server machine"
|
|
967
967
|
],
|
|
968
968
|
"samplePrompts": [
|
|
969
|
-
"
|
|
970
|
-
"
|
|
971
|
-
"What browser profile should I use?"
|
|
969
|
+
"Developer: list local Chrome profiles",
|
|
970
|
+
"Developer: inspect Chrome profile metadata for seo@example.com"
|
|
972
971
|
],
|
|
973
972
|
"formatExamples": [
|
|
974
973
|
"email=\"seo@example.com\"",
|
|
975
974
|
"user_data_dir optional for nonstandard Chrome roots"
|
|
976
975
|
],
|
|
977
|
-
"negativeSpace": "
|
|
976
|
+
"negativeSpace": "Developer/local-machine helper only. Do not use this for customer AI visibility setup, reconnects, or hosted profile login. Use browser_profile_onboard at google.com and provide the watch_url instead.",
|
|
978
977
|
"producesHandlesFor": [
|
|
979
978
|
"browser_profile_import",
|
|
980
979
|
"browser_profile_onboard"
|
|
@@ -992,12 +991,11 @@
|
|
|
992
991
|
"hasStructuredContent": true,
|
|
993
992
|
"writesLocalFiles": true,
|
|
994
993
|
"symptomTriggers": [
|
|
995
|
-
"
|
|
994
|
+
"a developer explicitly wants to clone local Chrome browser state on the MCP server machine for local debugging"
|
|
996
995
|
],
|
|
997
996
|
"samplePrompts": [
|
|
998
|
-
"
|
|
999
|
-
"
|
|
1000
|
-
"Clone seo@example.com into MCP Scraper"
|
|
997
|
+
"Developer: import my Chrome profile for local browser mode",
|
|
998
|
+
"Developer: clone seo@example.com into MCP Scraper"
|
|
1001
999
|
],
|
|
1002
1000
|
"formatExamples": [
|
|
1003
1001
|
"email=\"seo@example.com\"",
|
|
@@ -1021,17 +1019,16 @@
|
|
|
1021
1019
|
"hasStructuredContent": true,
|
|
1022
1020
|
"writesLocalFiles": true,
|
|
1023
1021
|
"symptomTriggers": [
|
|
1024
|
-
"
|
|
1022
|
+
"a developer has already imported a local Chrome profile and wants to refresh the managed clone from normal Chrome"
|
|
1025
1023
|
],
|
|
1026
1024
|
"samplePrompts": [
|
|
1027
|
-
"
|
|
1028
|
-
"
|
|
1029
|
-
"Update my MCP browser profile after logging into Claude"
|
|
1025
|
+
"Developer: sync my imported browser profile",
|
|
1026
|
+
"Developer: refresh local Chrome profile clone"
|
|
1030
1027
|
],
|
|
1031
1028
|
"formatExamples": [
|
|
1032
1029
|
"name=\"seo-example-com\""
|
|
1033
1030
|
],
|
|
1034
|
-
"negativeSpace": "
|
|
1031
|
+
"negativeSpace": "Developer/local-machine helper only. Do not use this for customer AI visibility setup or reconnects; use browser_profile_onboard at google.com and close the hosted setup session to save.",
|
|
1035
1032
|
"producesHandlesFor": [
|
|
1036
1033
|
"browser_open"
|
|
1037
1034
|
],
|
package/package.json
CHANGED
package/dist/chunk-BLB4CEFA.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["export const PACKAGE_VERSION = '0.3.4'\n"],"mappings":";AAAO,IAAM,kBAAkB;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/install-terminal.ts"],"sourcesContent":["export interface InstallTerminalOptions {\n color?: boolean\n version: string\n apiKeyConfigured?: boolean\n}\n\ntype Tone = 'cyan' | 'lime' | 'amber' | 'red' | 'muted' | 'bold'\n\nconst CODES: Record<Tone | 'reset', string> = {\n reset: '\\x1b[0m',\n cyan: '\\x1b[36m',\n lime: '\\x1b[32m',\n amber: '\\x1b[33m',\n red: '\\x1b[31m',\n muted: '\\x1b[90m',\n bold: '\\x1b[1m',\n}\n\nfunction colorize(value: string, tone: Tone, enabled: boolean): string {\n if (!enabled) return value\n return `${CODES[tone]}${value}${CODES.reset}`\n}\n\nfunction toolRow(label: string, tools: string[], enabled: boolean): string {\n const padded = label.padEnd(9, ' ')\n return ` ${colorize(padded, 'muted', enabled)} ${tools.join(colorize(' . ', 'muted', enabled))}`\n}\n\nexport function renderInstallTerminal(options: InstallTerminalOptions): string {\n const color = options.color ?? true\n const apiKeyValue = options.apiKeyConfigured ? '$MCP_SCRAPER_API_KEY' : 'sk_live_your_key'\n const ascii = String.raw`\n __ __ ____ ____ \n| \\/ |/ ___| _ \\\n| |\\/| | | | |_) |\n| | | | |___| __/\n|_| |_|\\____|_|\n\n ____ ____ ____ _ ____ _____ ____\n/ ___| / ___| _ \\ / \\ | _ \\| ____| _ \\\n\\___ \\| | | |_) | / _ \\ | |_) | _| | |_) |\n ___) | |___| _ < / ___ \\| __/| |___| _ <\n|____/ \\____|_| \\_\\/_/ \\_\\_| |_____|_| \\_\\\n`\n\n const claudeCommand = [\n `MCP_SCRAPER_API_KEY=${apiKeyValue} npx -y -p mcp-scraper@latest \\\\`,\n ' mcp-scraper-cli agent install claude --apply',\n ].join('\\n')\n\n const codexConfig = [\n '[mcp_servers.mcp-scraper]',\n 'command = \"npx\"',\n 'args = [\"-y\", \"-p\", \"mcp-scraper@latest\", \"mcp-scraper-combined\"]',\n `env = { MCP_SCRAPER_API_KEY = \"${apiKeyValue}\" }`,\n ].join('\\n')\n\n return [\n colorize(`mcp-scraper v${options.version}`, 'bold', color),\n colorize('> mcp-scraper-install', 'muted', color),\n colorize(ascii, 'amber', color),\n `${colorize('MCP Scraper Agent', 'cyan', color)} . v${options.version} . mcpscraper.dev`,\n '1/1 install surfaces ready',\n colorize('Newest: local Chrome profile mode for browser_open, browser_profile_import/sync, and one-server MCP installs.', 'lime', color),\n '',\n `${colorize('Tools', 'cyan', color)} ${colorize('(46 MCP tools)', 'muted', color)}`,\n toolRow('search', ['harvest_paa', 'search_serp', 'maps_search', 'maps_place_intel'], color),\n toolRow('extract', ['extract_url', 'map_site_urls', 'extract_site', 'directory_workflow'], color),\n toolRow('build', ['rank_tracker_blueprint', 'cron plan', 'database prompt'], color),\n toolRow('media', ['youtube_harvest', 'youtube_transcribe', 'facebook_ad_search', 'facebook_page_intel', 'facebook_ad_transcribe', 'facebook_video_transcribe', 'instagram_profile_content', 'instagram_media_download'], color),\n toolRow('browser', ['browser_open', 'browser_profile_import', 'browser_profile_sync', 'browser_screenshot', 'browser_read', 'browser_locate', 'browser_replay_mark', 'browser_replay_annotate'], color),\n toolRow('account', ['credits_info', 'local reports', 'MCP resources'], color),\n `${colorize('Workflows', 'cyan', color)} ${colorize('(MCP + CLI + API)', 'muted', color)}`,\n toolRow('route', ['workflow_list', 'workflow_suggest', 'workflow_run', 'workflow_step', 'workflow_status', 'workflow_artifact_read'], color),\n toolRow('seo', ['directory', 'agent-packet', 'local audit', 'map/serp comparison', 'PAA/AIO briefs', 'scheduled runs'], color),\n '',\n colorize('Usage tips:', 'amber', color),\n 'Run mcp-scraper-install for this visible card. Run mcp-scraper-cli for setup utilities and subcommands.',\n 'Run mcp-scraper-combined in a human terminal to print this card; MCP clients get the same command as a silent stdio server.',\n 'Explicit card command: npx -y -p mcp-scraper@latest mcp-scraper-install',\n 'Local Chrome mode: mcp-scraper-cli browser import-chrome --email you@example.com --name chrome-default',\n 'Then: mcp-scraper-cli agent install claude --apply --browser-mode local --browser-profile chrome-default',\n 'Start with workflow_suggest for broad jobs like market analysis, ICP research, CRO audits, brand briefs, content gaps, and AI visibility.',\n 'For MCP clients, use mcp-scraper-combined so one install can mix SERP, Maps, browser, reports, and saved MCP resources.',\n 'If you hit the concurrency limit, add an extra slot for $5/month with mcp-scraper-cli billing concurrency checkout.',\n '',\n `${colorize('Ready.', 'lime', color)} Install the combined MCP server with one command:`,\n '',\n colorize('Setup doctor', 'amber', color),\n 'npx -y -p mcp-scraper@latest mcp-scraper-cli doctor',\n '',\n colorize('Local Chrome profile setup', 'amber', color),\n 'npx -y -p mcp-scraper@latest mcp-scraper-cli browser profiles --email you@example.com',\n 'npx -y -p mcp-scraper@latest mcp-scraper-cli browser import-chrome --email you@example.com --name chrome-default',\n '',\n colorize('Claude Code one-command setup', 'amber', color),\n claudeCommand,\n 'Then fully exit Claude Code and open a new Claude terminal. Check with: claude mcp list',\n '',\n colorize('Codex config', 'amber', color),\n codexConfig,\n '',\n colorize('Claude Desktop Extension', 'amber', color),\n 'Download: https://mcpscraper.dev/downloads/mcp-scraper.mcpb',\n '',\n colorize('Safety note:', 'muted', color),\n 'mcp-scraper-combined prints this card only when stdin/stdout are an interactive TTY. In MCP clients it writes only JSON-RPC to stdout.',\n 'Use --stdio or MCP_SCRAPER_FORCE_STDIO=1 to force server mode from a terminal.',\n '',\n ].join('\\n')\n}\n"],"mappings":";AAQA,IAAM,QAAwC;AAAA,EAC5C,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,KAAK;AAAA,EACL,OAAO;AAAA,EACP,MAAM;AACR;AAEA,SAAS,SAAS,OAAe,MAAY,SAA0B;AACrE,MAAI,CAAC,QAAS,QAAO;AACrB,SAAO,GAAG,MAAM,IAAI,CAAC,GAAG,KAAK,GAAG,MAAM,KAAK;AAC7C;AAEA,SAAS,QAAQ,OAAe,OAAiB,SAA0B;AACzE,QAAM,SAAS,MAAM,OAAO,GAAG,GAAG;AAClC,SAAO,KAAK,SAAS,QAAQ,SAAS,OAAO,CAAC,IAAI,MAAM,KAAK,SAAS,SAAS,SAAS,OAAO,CAAC,CAAC;AACnG;AAEO,SAAS,sBAAsB,SAA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AG,KAAK;AAAA,IAC5E,GAAG,SAAS,aAAa,QAAQ,KAAK,CAAC,KAAK,SAAS,qBAAqB,SAAS,KAAK,CAAC;AAAA,IACzF,QAAQ,SAAS,CAAC,iBAAiB,oBAAoB,gBAAgB,iBAAiB,mBAAmB,wBAAwB,GAAG,KAAK;AAAA,IAC3I,QAAQ,OAAO,CAAC,aAAa,gBAAgB,eAAe,uBAAuB,kBAAkB,gBAAgB,GAAG,KAAK;AAAA,IAC7H;AAAA,IACA,SAAS,eAAe,SAAS,KAAK;AAAA,IACtC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG,SAAS,UAAU,QAAQ,KAAK,CAAC;AAAA,IACpC;AAAA,IACA,SAAS,gBAAgB,SAAS,KAAK;AAAA,IACvC;AAAA,IACA;AAAA,IACA,SAAS,8BAA8B,SAAS,KAAK;AAAA,IACrD;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS,iCAAiC,SAAS,KAAK;AAAA,IACxD;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS,gBAAgB,SAAS,KAAK;AAAA,IACvC;AAAA,IACA;AAAA,IACA,SAAS,4BAA4B,SAAS,KAAK;AAAA,IACnD;AAAA,IACA;AAAA,IACA,SAAS,gBAAgB,SAAS,KAAK;AAAA,IACvC;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,KAAK,IAAI;AACb;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/mcp/browser-agent-mcp-server.ts","../src/services/browser-agent/local-browser-agent-service.ts","../src/mcp/browser-agent-tool-schemas.ts","../src/mcp/replay-annotator.ts"],"sourcesContent":["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'\nimport { mkdirSync, writeFileSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'node:path'\nimport { listLocalChromeProfiles, type LocalChromeProfile } from '../lib/chrome-profiles.js'\nimport { browserServiceProfileName, browserServiceProfileSaveChanges } from '../lib/browser-service-env.js'\nimport { importChromeProfile, localBrowserModeEnabled, syncImportedChromeProfile } from '../lib/local-browser-profiles.js'\nimport { LocalBrowserAgentService } from '../services/browser-agent/local-browser-agent-service.js'\nimport { PACKAGE_VERSION } from '../version.js'\nimport {\n BrowserOpenInputSchema,\n BrowserProfileListInputSchema,\n BrowserProfileOnboardInputSchema,\n BrowserProfileImportInputSchema,\n BrowserProfileSyncInputSchema,\n BrowserCaptureFanoutInputSchema,\n BrowserCaptureFanoutOutputSchema,\n BrowserSessionInputSchema,\n BrowserLocateInputSchema,\n BrowserGotoInputSchema,\n BrowserClickInputSchema,\n BrowserTypeInputSchema,\n BrowserScrollInputSchema,\n BrowserPressInputSchema,\n BrowserReplayStopInputSchema,\n BrowserReplayDownloadInputSchema,\n BrowserReplayMarkInputSchema,\n BrowserReplayAnnotateInputSchema,\n BrowserListInputSchema,\n BrowserOpenOutputSchema,\n BrowserScreenshotOutputSchema,\n BrowserReadOutputSchema,\n BrowserLocateOutputSchema,\n BrowserActionOutputSchema,\n BrowserReplayStartOutputSchema,\n BrowserReplayStopOutputSchema,\n BrowserListReplaysOutputSchema,\n BrowserReplayDownloadOutputSchema,\n BrowserReplayMarkOutputSchema,\n BrowserReplayAnnotateOutputSchema,\n BrowserCloseOutputSchema,\n BrowserListSessionsOutputSchema,\n BrowserProfileListOutputSchema,\n BrowserProfileOnboardOutputSchema,\n BrowserProfileImportOutputSchema,\n BrowserProfileSyncOutputSchema,\n} from './browser-agent-tool-schemas.js'\nimport { annotateReplayVideo } from './replay-annotator.js'\n\nexport interface BrowserAgentHttpOptions {\n baseUrl: string\n apiKey: string\n consoleBaseUrl?: string\n timeoutMs?: number\n}\n\nfunction structuredResult(value: Record<string, unknown>, isError = false): CallToolResult {\n return {\n content: [{ type: 'text', text: JSON.stringify(value) }],\n structuredContent: value,\n isError,\n }\n}\n\nfunction errorMessage(value: unknown): string {\n if (value && typeof value === 'object') {\n const data = value as Record<string, unknown>\n if (typeof data.error === 'string') return data.error\n if (typeof data.message === 'string') return data.message\n }\n return typeof value === 'string' ? value : 'Browser Agent request failed'\n}\n\nfunction errorResult(tool: string, value: unknown, sessionId: string | null = null, replayId: string | null = null): CallToolResult {\n return structuredResult({\n ok: false,\n tool,\n session_id: sessionId,\n ...(replayId !== null ? { replay_id: replayId } : {}),\n error: errorMessage(value),\n raw: value && typeof value === 'object' ? value as Record<string, unknown> : { value },\n }, true)\n}\n\nfunction actionResult(\n tool: string,\n sessionId: string,\n ok: boolean,\n data: unknown,\n nextRecommendedTool: string | null = 'browser_screenshot',\n): CallToolResult {\n if (!ok) return errorResult(tool, data, sessionId)\n return structuredResult({\n ok: true,\n tool,\n session_id: sessionId,\n result: data && typeof data === 'object' ? data as Record<string, unknown> : { value: data },\n nextRecommendedTool,\n })\n}\n\nfunction outputBaseDir(): string {\n return process.env.MCP_SCRAPER_OUTPUT_DIR?.trim() || join(homedir(), 'Downloads', 'mcp-scraper')\n}\n\nfunction safeFilePart(value: string): string {\n return value.replace(/[^a-zA-Z0-9._-]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 120) || 'replay'\n}\n\nfunction replayFilePath(sessionId: string, replayId: string, filename?: string): string {\n const requested = filename?.trim()\n const stamp = new Date().toISOString().replace(/[:.]/g, '-')\n const name = requested\n ? safeFilePart(requested).replace(/\\.mp4$/i, '')\n : `${stamp}-${safeFilePart(sessionId)}-${safeFilePart(replayId)}`\n return join(outputBaseDir(), 'browser-replays', `${name}.mp4`)\n}\n\nfunction annotatedReplayFilePath(sessionId: string, replayId: string, filename?: string): string {\n const requested = filename?.trim()\n if (requested) return replayFilePath(sessionId, replayId, requested)\n const stamp = new Date().toISOString().replace(/[:.]/g, '-')\n return replayFilePath(sessionId, replayId, `${stamp}-${safeFilePart(sessionId)}-${safeFilePart(replayId)}-annotated`)\n}\n\nfunction finiteNumber(value: unknown): value is number {\n return typeof value === 'number' && Number.isFinite(value)\n}\n\nfunction expandElementBounds(\n element: { left: number; top: number; width: number; height: number },\n viewport: { width?: number; height?: number } | undefined,\n padding: number,\n) {\n const sourceWidth = finiteNumber(viewport?.width) && viewport!.width > 0 ? viewport!.width : 1920\n const sourceHeight = finiteNumber(viewport?.height) && viewport!.height > 0 ? viewport!.height : 1080\n const left = Math.max(0, element.left - padding)\n const top = Math.max(0, element.top - padding)\n const right = Math.min(sourceWidth, element.left + element.width + padding)\n const bottom = Math.min(sourceHeight, element.top + element.height + padding)\n return {\n left,\n top,\n width: Math.max(1, right - left),\n height: Math.max(1, bottom - top),\n sourceWidth,\n sourceHeight,\n }\n}\n\nexport function buildBrowserAgentMcpServer(opts: BrowserAgentHttpOptions): McpServer {\n const server = new McpServer({ name: 'browser-agent', version: PACKAGE_VERSION })\n registerBrowserAgentMcpTools(server, opts)\n return server\n}\n\nexport function registerBrowserAgentMcpTools(server: McpServer, opts: BrowserAgentHttpOptions): void {\n const baseUrl = opts.baseUrl.replace(/\\/$/, '')\n const consoleBase = (opts.consoleBaseUrl ?? opts.baseUrl).replace(/\\/$/, '')\n const timeoutMs = opts.timeoutMs ?? 90_000\n const localBrowser = new LocalBrowserAgentService()\n\n async function req(method: string, path: string, body?: Record<string, unknown>): Promise<{ ok: boolean; data: any }> {\n try {\n const res = await fetch(`${baseUrl}${path}`, {\n method,\n headers: { 'Content-Type': 'application/json', 'x-api-key': opts.apiKey },\n body: body ? JSON.stringify(body) : undefined,\n signal: AbortSignal.timeout(timeoutMs),\n })\n const data = await res.json().catch(() => ({}))\n return { ok: res.ok, data }\n } catch (err) {\n return { ok: false, data: { error: err instanceof Error ? err.message : String(err) } }\n }\n }\n\n async function downloadReplay(\n sessionId: string,\n replayId: string,\n filename?: string,\n ): Promise<{ ok: boolean; data: any }> {\n const path = `/agent/sessions/${encodeURIComponent(sessionId)}/replays/${encodeURIComponent(replayId)}/download`\n try {\n const res = await fetch(`${baseUrl}${path}`, {\n method: 'GET',\n headers: { 'x-api-key': opts.apiKey },\n signal: AbortSignal.timeout(timeoutMs),\n })\n if (!res.ok) {\n const data = await res.json().catch(async () => ({ error: await res.text().catch(() => `HTTP ${res.status}`) }))\n return { ok: false, data }\n }\n const bytes = Buffer.from(await res.arrayBuffer())\n const filePath = replayFilePath(sessionId, replayId, filename)\n mkdirSync(join(outputBaseDir(), 'browser-replays'), { recursive: true })\n writeFileSync(filePath, bytes)\n return {\n ok: true,\n data: {\n replay_id: replayId,\n file_path: filePath,\n bytes: bytes.length,\n mime_type: res.headers.get('content-type') ?? 'video/mp4',\n download_url: `${baseUrl}${path}`,\n },\n }\n } catch (err) {\n return { ok: false, data: { error: err instanceof Error ? err.message : String(err) } }\n }\n }\n\n const annotations = (title: string, readOnly = false) => ({\n title,\n readOnlyHint: readOnly,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n })\n\n function selectChromeProfile(matches: LocalChromeProfile[], email?: string): LocalChromeProfile | null {\n const wanted = email?.trim().toLowerCase()\n if (!wanted) return matches[0] ?? null\n return matches.find(profile => profile.email.toLowerCase() === wanted) ?? matches[0] ?? null\n }\n\n function localReplayUnsupported(tool: string, sessionId: string | null = null, replayId: string | null = null): CallToolResult {\n return errorResult(tool, {\n error: 'Local browser mode does not support replay recording yet. Use hosted mode for browser_replay_* tools.',\n mode: 'local',\n }, sessionId, replayId)\n }\n\n server.registerTool(\n 'browser_profile_list',\n {\n title: 'List Local Chrome Profiles',\n description:\n 'List local Chrome profile metadata visible to this MCP server: account email, Chrome profile directory, local path, and a suggested managed browser profile name. This reads Chrome Local State only; it does not read cookies, passwords, browsing history, or copy local browser state. Use browser_profile_import when the user wants MCP Scraper to clone a local Chrome profile for local browser mode.',\n inputSchema: BrowserProfileListInputSchema,\n outputSchema: BrowserProfileListOutputSchema,\n annotations: annotations('List Local Chrome Profiles', true),\n },\n async input => {\n try {\n const profiles = await listLocalChromeProfiles(input.user_data_dir, input.email)\n return structuredResult({\n ok: true,\n tool: 'browser_profile_list',\n session_id: null,\n profiles,\n count: profiles.length,\n hint: 'For customer auth setup, use browser_profile_onboard so the user signs in through the hosted watch_url. Local import is only for developer/local-machine mode.',\n })\n } catch (err) {\n return errorResult('browser_profile_list', { error: err instanceof Error ? err.message : String(err) })\n }\n },\n )\n\n server.registerTool(\n 'browser_profile_import',\n {\n title: 'Import Local Chrome Profile',\n description:\n 'Clone one local Chrome profile into MCP Scraper managed storage for local browser mode. This copies browser state files such as cookies, history, local storage, session storage, and password database metadata into ~/.mcp-scraper/browser-profiles by default; it skips cache and lock files and never prints cookie or password values. Use this when the user wants browser_open to run locally with their existing logged-in Chrome state.',\n inputSchema: BrowserProfileImportInputSchema,\n outputSchema: BrowserProfileImportOutputSchema,\n annotations: { title: 'Import Local Chrome Profile', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },\n },\n async input => {\n try {\n const result = await importChromeProfile({\n email: input.email,\n name: input.name,\n chromeProfileDirectory: input.chrome_profile_directory,\n sourceUserDataDir: input.user_data_dir,\n outputDir: input.output_dir,\n overwrite: input.overwrite,\n browserExecutablePath: input.browser_executable_path,\n })\n return structuredResult({\n ok: true,\n tool: 'browser_profile_import',\n session_id: null,\n profile: result.profile,\n source_profile: result.sourceProfile,\n next_steps: [\n `Set MCP_SCRAPER_BROWSER_MODE=local in the MCP server config.`,\n `Set MCP_SCRAPER_BROWSER_PROFILE=${result.profile.name}.`,\n 'Restart the MCP client so it starts the local browser mode process.',\n 'Call browser_open with the same MCP server; it will open a local Chrome window using the cloned profile.',\n ],\n hint: 'The clone is local to this machine. Re-run browser_profile_sync after logging into new sites in normal Chrome.',\n })\n } catch (err) {\n return errorResult('browser_profile_import', { error: err instanceof Error ? err.message : String(err) })\n }\n },\n )\n\n server.registerTool(\n 'browser_profile_sync',\n {\n title: 'Sync Local Chrome Profile',\n description:\n 'Refresh an existing MCP Scraper managed local browser profile from the source Chrome profile recorded in its manifest. This overwrites the managed clone, copies browser state files again, skips cache and lock files, and never prints cookie or password values.',\n inputSchema: BrowserProfileSyncInputSchema,\n outputSchema: BrowserProfileSyncOutputSchema,\n annotations: { title: 'Sync Local Chrome Profile', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },\n },\n async input => {\n try {\n const result = await syncImportedChromeProfile(input.name, {\n outputDir: input.output_dir,\n browserExecutablePath: input.browser_executable_path,\n })\n return structuredResult({\n ok: true,\n tool: 'browser_profile_sync',\n session_id: null,\n profile: result.profile,\n source_profile: result.sourceProfile,\n hint: `Refreshed ${result.profile.name}. Restart local browser sessions that were using this profile.`,\n })\n } catch (err) {\n return errorResult('browser_profile_sync', { error: err instanceof Error ? err.message : String(err) })\n }\n },\n )\n\n server.registerTool(\n 'browser_profile_onboard',\n {\n title: 'Connect Hosted Browser Profile',\n description:\n 'Create or load a saved MCP Scraper hosted browser profile and open a direct no-proxy setup browser with profile saving enabled. This is the customer auth setup and reconnect flow: open Google, give the user the watch_url, have them click Sign in and complete login, then call browser_close to save cookies and local storage. If a saved profile later shows login controls, run this same setup flow again. Do not use local Chrome import for this customer setup.',\n inputSchema: BrowserProfileOnboardInputSchema,\n outputSchema: BrowserProfileOnboardOutputSchema,\n annotations: annotations('Connect Hosted Browser Profile'),\n },\n async input => {\n let chromeProfile: LocalChromeProfile | null = null\n if (input.email) {\n try {\n chromeProfile = selectChromeProfile(await listLocalChromeProfiles(input.user_data_dir, input.email), input.email)\n } catch (err) {\n return errorResult('browser_profile_onboard', { error: err instanceof Error ? err.message : String(err) })\n }\n }\n const profile = input.profile?.trim() || chromeProfile?.recommendedKernelProfileName || browserServiceProfileName()\n if (!profile) {\n return errorResult('browser_profile_onboard', {\n error: 'profile is required when no email match or BROWSER_AGENT_PROFILE_NAME is available',\n })\n }\n const setupUrl = input.url ?? 'https://google.com/'\n const open = await req('POST', '/agent/sessions', {\n label: input.label ?? `Profile setup: ${profile}`,\n profile,\n save_profile_changes: true,\n disable_default_proxy: true,\n timeout_seconds: input.timeout_seconds,\n })\n if (!open.ok) return errorResult('browser_profile_onboard', open.data)\n const session = open.data\n const goto = await req('POST', `/agent/sessions/${session.session_id}/goto`, { url: setupUrl })\n if (!goto.ok) return errorResult('browser_profile_onboard', goto.data, session.session_id)\n return structuredResult({\n ok: true,\n tool: 'browser_profile_onboard',\n session_id: session.session_id,\n watch_url: `${consoleBase}/console/${session.session_id}`,\n live_view_url: session.live_view_url ?? null,\n profile,\n setup_url: setupUrl,\n chrome_profile: chromeProfile,\n next_steps: [\n 'Open the watch_url and let the user click Sign in on Google.',\n 'After the user confirms login is complete, call browser_close with this session_id to persist cookies and local storage to the saved profile.',\n 'If the saved profile later shows login controls or disconnects, repeat browser_profile_onboard and close the setup session again.',\n 'Use BROWSER_AGENT_PROFILE_NAME or browser_open.profile with this profile name for future authenticated sessions.',\n ],\n raw: session,\n })\n },\n )\n\n server.registerTool(\n 'browser_open',\n {\n title: 'Open Browser Session',\n description:\n 'Open a direct no-proxy hosted browser session you can drive. Pass a saved profile name to load an authenticated session for a site. For customer login setup or reconnects, use browser_profile_onboard first so the user signs in through a watch_url, then call browser_close to save the profile. Returns a session_id used by all other browser_* tools.',\n inputSchema: BrowserOpenInputSchema,\n outputSchema: BrowserOpenOutputSchema,\n annotations: annotations('Open Browser Session'),\n },\n async input => {\n if (localBrowserModeEnabled()) {\n try {\n const session = await localBrowser.open(input)\n return structuredResult({\n ok: true,\n tool: 'browser_open',\n session_id: session.session_id,\n watch_url: session.watch_url,\n live_view_url: null,\n url: input.url ?? null,\n hint: 'Local Chrome is open on this machine. Call browser_screenshot to see the page and click by x,y coordinates.',\n raw: session,\n })\n } catch (err) {\n return errorResult('browser_open', { error: err instanceof Error ? err.message : String(err), mode: 'local' })\n }\n }\n const profile = input.profile ?? browserServiceProfileName()\n const saveProfileChanges = input.save_profile_changes ?? browserServiceProfileSaveChanges()\n const open = await req('POST', '/agent/sessions', {\n label: input.label,\n ...(profile ? { profile } : {}),\n ...(profile && typeof saveProfileChanges === 'boolean' ? { save_profile_changes: saveProfileChanges } : {}),\n disable_default_proxy: true,\n timeout_seconds: input.timeout_seconds,\n })\n if (!open.ok) return errorResult('browser_open', open.data)\n const session = open.data\n if (input.url) {\n await req('POST', `/agent/sessions/${session.session_id}/goto`, { url: input.url })\n }\n return structuredResult({\n ok: true,\n tool: 'browser_open',\n session_id: session.session_id,\n watch_url: `${consoleBase}/console/${session.session_id}`,\n live_view_url: session.live_view_url ?? null,\n url: input.url ?? null,\n hint: 'Call browser_screenshot to see the page. Click by the x,y of an element from the snapshot.',\n raw: session,\n })\n },\n )\n\n server.registerTool(\n 'browser_screenshot',\n {\n title: 'See Page (Screenshot + Elements)',\n description:\n 'Capture what the browser currently shows. Returns a screenshot image PLUS a text snapshot listing interactive elements with their center x,y coordinates, the page url and title, and visible text. This is your primary way to perceive the page. Click elements by their listed x,y. If a Cloudflare/CAPTCHA challenge is visible, wait and screenshot again rather than clicking it.',\n inputSchema: BrowserSessionInputSchema,\n outputSchema: BrowserScreenshotOutputSchema,\n annotations: annotations('See Page', true),\n },\n async input => {\n if (localBrowserModeEnabled()) {\n try {\n const res = await localBrowser.screenshot(input.session_id)\n const content: CallToolResult['content'] = []\n if (res.image_base64) content.push({ type: 'image', data: res.image_base64, mimeType: res.mime_type })\n const structured = {\n ok: true,\n tool: 'browser_screenshot',\n session_id: input.session_id,\n url: res.url ?? null,\n title: res.title ?? null,\n text: res.text,\n elements: res.elements,\n screenshot: { mime_type: res.mime_type, inline: true },\n }\n content.push({ type: 'text', text: JSON.stringify(structured) })\n return { content, structuredContent: structured }\n } catch (err) {\n return errorResult('browser_screenshot', { error: err instanceof Error ? err.message : String(err), mode: 'local' }, input.session_id)\n }\n }\n const res = await req('POST', `/agent/sessions/${input.session_id}/screenshot`)\n if (!res.ok) return errorResult('browser_screenshot', res.data, input.session_id)\n const { image_base64, mime_type, url, title, elements, text } = res.data\n const content: CallToolResult['content'] = []\n if (image_base64) content.push({ type: 'image', data: image_base64, mimeType: mime_type ?? 'image/png' })\n const structured = {\n ok: true,\n tool: 'browser_screenshot',\n session_id: input.session_id,\n url: url ?? null,\n title: title ?? null,\n text: typeof text === 'string' ? text : '',\n elements: Array.isArray(elements) ? elements : [],\n screenshot: image_base64 ? { mime_type: mime_type ?? 'image/png', inline: true } : null,\n }\n content.push({\n type: 'text',\n text: JSON.stringify(structured),\n })\n return { content, structuredContent: structured }\n },\n )\n\n server.registerTool(\n 'browser_read',\n {\n title: 'Read Page Text + Elements',\n description:\n 'Return the page url, title, visible text, and the list of interactive elements (with x,y) without an image. Cheaper than browser_screenshot when you only need to read content or find a target element to click.',\n inputSchema: BrowserSessionInputSchema,\n outputSchema: BrowserReadOutputSchema,\n annotations: annotations('Read Page', true),\n },\n async input => {\n if (localBrowserModeEnabled()) {\n try {\n const res = await localBrowser.read(input.session_id)\n return structuredResult({\n ok: true,\n tool: 'browser_read',\n session_id: input.session_id,\n url: res.url ?? null,\n title: res.title ?? null,\n text: res.text,\n elements: res.elements,\n raw: res,\n })\n } catch (err) {\n return errorResult('browser_read', { error: err instanceof Error ? err.message : String(err), mode: 'local' }, input.session_id)\n }\n }\n const res = await req('POST', `/agent/sessions/${input.session_id}/read`)\n if (!res.ok) return errorResult('browser_read', res.data, input.session_id)\n return structuredResult({\n ok: true,\n tool: 'browser_read',\n session_id: input.session_id,\n url: res.data?.url ?? null,\n title: res.data?.title ?? null,\n text: typeof res.data?.text === 'string' ? res.data.text : '',\n elements: Array.isArray(res.data?.elements) ? res.data.elements : [],\n raw: res.data,\n })\n },\n )\n\n server.registerTool(\n 'browser_locate',\n {\n title: 'Locate DOM Targets',\n description:\n 'Locate exact visible DOM elements or text ranges in the current browser viewport and return left/top/width/height bounds in screenshot pixels. Use this before drawing annotations or when a callout must literally circle, box, underline, or point to a real element. Prefer CSS selectors for exact UI elements; use text when selector is unknown. When a replay is actively recording, the result includes replay_elapsed_seconds for timing.',\n inputSchema: BrowserLocateInputSchema,\n outputSchema: BrowserLocateOutputSchema,\n annotations: annotations('Locate DOM Targets', true),\n },\n async input => {\n if (localBrowserModeEnabled()) {\n try {\n const res = await localBrowser.locate(input.session_id, input.targets)\n return structuredResult({\n ok: true,\n tool: 'browser_locate',\n session_id: input.session_id,\n url: res.url ?? null,\n title: res.title ?? null,\n viewport: res.viewport ?? null,\n replay: null,\n targets: Array.isArray(res.targets) ? res.targets : [],\n raw: res,\n })\n } catch (err) {\n return errorResult('browser_locate', { error: err instanceof Error ? err.message : String(err), mode: 'local' }, input.session_id)\n }\n }\n const res = await req('POST', `/agent/sessions/${input.session_id}/locate`, { targets: input.targets })\n if (!res.ok) return errorResult('browser_locate', res.data, input.session_id)\n return structuredResult({\n ok: true,\n tool: 'browser_locate',\n session_id: input.session_id,\n url: res.data?.url ?? null,\n title: res.data?.title ?? null,\n viewport: res.data?.viewport ?? null,\n replay: res.data?.replay ?? null,\n targets: Array.isArray(res.data?.targets) ? res.data.targets : [],\n raw: res.data,\n })\n },\n )\n\n server.registerTool(\n 'browser_goto',\n {\n title: 'Navigate To URL',\n description: 'Navigate an existing browser session to a URL when the user asks you to go to another page or continue browsing in the same session. Use browser_open first if no session exists. Follow with browser_screenshot to see redirects, login walls, CAPTCHA/Cloudflare state, or the loaded page.',\n inputSchema: BrowserGotoInputSchema,\n outputSchema: BrowserActionOutputSchema,\n annotations: annotations('Navigate To URL'),\n },\n async input => {\n if (localBrowserModeEnabled()) {\n try {\n const res = await localBrowser.goto(input.session_id, input.url)\n return actionResult('browser_goto', input.session_id, true, res, 'browser_screenshot')\n } catch (err) {\n return errorResult('browser_goto', { error: err instanceof Error ? err.message : String(err), mode: 'local' }, input.session_id)\n }\n }\n const res = await req('POST', `/agent/sessions/${input.session_id}/goto`, { url: input.url })\n return actionResult('browser_goto', input.session_id, res.ok, res.data, 'browser_screenshot')\n },\n )\n\n server.registerTool(\n 'browser_click',\n {\n title: 'Click',\n description: 'Click a visible page target using screenshot pixel coordinates. Use this when the user asks you to press a button, open a menu, choose a result, or activate a visible UI element. Use x/y only from the latest browser_screenshot, browser_read, or browser_locate result; do not guess coordinates. Follow with browser_screenshot when the click may change the page.',\n inputSchema: BrowserClickInputSchema,\n outputSchema: BrowserActionOutputSchema,\n annotations: annotations('Click'),\n },\n async input => {\n if (localBrowserModeEnabled()) {\n try {\n const res = await localBrowser.click(input.session_id, input)\n return actionResult('browser_click', input.session_id, true, res, 'browser_screenshot')\n } catch (err) {\n return errorResult('browser_click', { error: err instanceof Error ? err.message : String(err), mode: 'local' }, input.session_id)\n }\n }\n const res = await req('POST', `/agent/sessions/${input.session_id}/click`, {\n x: input.x,\n y: input.y,\n button: input.button,\n num_clicks: input.num_clicks,\n })\n return actionResult('browser_click', input.session_id, res.ok, res.data, 'browser_screenshot')\n },\n )\n\n server.registerTool(\n 'browser_type',\n {\n title: 'Type Text',\n description: 'Type text into the currently focused browser field. Use this when the user asks you to fill a search box, form field, login field, or editable text area. Click or Tab to the field first if focus is uncertain. Use browser_press with [\"Return\"] to submit, and browser_screenshot afterward when page state matters.',\n inputSchema: BrowserTypeInputSchema,\n outputSchema: BrowserActionOutputSchema,\n annotations: annotations('Type Text'),\n },\n async input => {\n if (localBrowserModeEnabled()) {\n try {\n const res = await localBrowser.type(input.session_id, input)\n return actionResult('browser_type', input.session_id, true, res, 'browser_screenshot')\n } catch (err) {\n return errorResult('browser_type', { error: err instanceof Error ? err.message : String(err), mode: 'local' }, input.session_id)\n }\n }\n const res = await req('POST', `/agent/sessions/${input.session_id}/type`, { text: input.text, delay: input.delay })\n return actionResult('browser_type', input.session_id, res.ok, res.data, 'browser_screenshot')\n },\n )\n\n server.registerTool(\n 'browser_scroll',\n {\n title: 'Scroll',\n description: 'Scroll the page to reveal more content before reading, clicking, or locating elements. Positive delta_y scrolls down; negative delta_y scrolls up. Follow with browser_screenshot or browser_read to inspect newly revealed content.',\n inputSchema: BrowserScrollInputSchema,\n outputSchema: BrowserActionOutputSchema,\n annotations: annotations('Scroll'),\n },\n async input => {\n if (localBrowserModeEnabled()) {\n try {\n const res = await localBrowser.scroll(input.session_id, input)\n return actionResult('browser_scroll', input.session_id, true, res, 'browser_screenshot')\n } catch (err) {\n return errorResult('browser_scroll', { error: err instanceof Error ? err.message : String(err), mode: 'local' }, input.session_id)\n }\n }\n const res = await req('POST', `/agent/sessions/${input.session_id}/scroll`, {\n delta_y: input.delta_y,\n delta_x: input.delta_x,\n x: input.x,\n y: input.y,\n })\n return actionResult('browser_scroll', input.session_id, res.ok, res.data, 'browser_screenshot')\n },\n )\n\n server.registerTool(\n 'browser_press',\n {\n title: 'Press Keys',\n description: 'Press keyboard keys or combinations in the active browser session. Use this for submit, Escape, Tab navigation, select-all, or keyboard shortcuts. Examples: [\"Return\"], [\"Escape\"], [\"Tab\"], [\"Ctrl+a\"], [\"Ctrl+Shift+Tab\"]. Use browser_type for text entry and browser_screenshot after keypresses that may change the page.',\n inputSchema: BrowserPressInputSchema,\n outputSchema: BrowserActionOutputSchema,\n annotations: annotations('Press Keys'),\n },\n async input => {\n if (localBrowserModeEnabled()) {\n try {\n const res = await localBrowser.press(input.session_id, input)\n return actionResult('browser_press', input.session_id, true, res, 'browser_screenshot')\n } catch (err) {\n return errorResult('browser_press', { error: err instanceof Error ? err.message : String(err), mode: 'local' }, input.session_id)\n }\n }\n const res = await req('POST', `/agent/sessions/${input.session_id}/press`, { keys: input.keys })\n return actionResult('browser_press', input.session_id, res.ok, res.data, 'browser_screenshot')\n },\n )\n\n server.registerTool(\n 'browser_replay_start',\n {\n title: 'Start Recording',\n description: 'Start recording an MP4 replay of the session. Returns replay_id, view_url when available, and a download_url. Use to capture a task for later review; stop with browser_replay_stop.',\n inputSchema: BrowserSessionInputSchema,\n outputSchema: BrowserReplayStartOutputSchema,\n annotations: annotations('Start Recording'),\n },\n async input => {\n if (localBrowserModeEnabled()) return localReplayUnsupported('browser_replay_start', input.session_id)\n const res = await req('POST', `/agent/sessions/${input.session_id}/replay/start`)\n if (!res.ok) return errorResult('browser_replay_start', res.data, input.session_id)\n return structuredResult({\n ok: true,\n tool: 'browser_replay_start',\n session_id: input.session_id,\n replay_id: res.data?.replay_id ?? res.data?.replayId ?? null,\n view_url: res.data?.view_url ?? res.data?.viewUrl ?? null,\n download_url: res.data?.download_url ?? res.data?.downloadUrl ?? null,\n raw: res.data,\n })\n },\n )\n\n server.registerTool(\n 'browser_replay_stop',\n {\n title: 'Stop Recording',\n description: 'Stop a replay recording and expose the final view_url and download_url. Use browser_replay_download to save the MP4 locally.',\n inputSchema: BrowserReplayStopInputSchema,\n outputSchema: BrowserReplayStopOutputSchema,\n annotations: annotations('Stop Recording'),\n },\n async input => {\n if (localBrowserModeEnabled()) return localReplayUnsupported('browser_replay_stop', input.session_id, input.replay_id)\n const res = await req('POST', `/agent/sessions/${input.session_id}/replay/stop`, { replay_id: input.replay_id })\n if (!res.ok) return errorResult('browser_replay_stop', res.data, input.session_id, input.replay_id)\n return structuredResult({\n ok: true,\n tool: 'browser_replay_stop',\n session_id: input.session_id,\n replay_id: res.data?.replay_id ?? res.data?.replayId ?? input.replay_id,\n view_url: res.data?.view_url ?? res.data?.viewUrl ?? null,\n download_url: res.data?.download_url ?? res.data?.downloadUrl ?? null,\n raw: res.data,\n })\n },\n )\n\n server.registerTool(\n 'browser_list_replays',\n {\n title: 'List Replay Videos',\n description: 'List replay recordings for a browser session, including final view_url and authenticated download_url values when available.',\n inputSchema: BrowserSessionInputSchema,\n outputSchema: BrowserListReplaysOutputSchema,\n annotations: annotations('List Replay Videos', true),\n },\n async input => {\n if (localBrowserModeEnabled()) return localReplayUnsupported('browser_list_replays', input.session_id)\n const res = await req('GET', `/agent/sessions/${input.session_id}/replays`)\n if (!res.ok) return errorResult('browser_list_replays', res.data, input.session_id)\n const replays = Array.isArray(res.data?.replays) ? res.data.replays : []\n return structuredResult({\n ok: true,\n tool: 'browser_list_replays',\n session_id: input.session_id,\n replays,\n count: replays.length,\n })\n },\n )\n\n server.registerTool(\n 'browser_replay_download',\n {\n title: 'Download Replay MP4',\n description: 'Download a replay recording through MCP Scraper and save the MP4 locally under MCP_SCRAPER_OUTPUT_DIR/browser-replays. Use after browser_replay_stop or browser_list_replays.',\n inputSchema: BrowserReplayDownloadInputSchema,\n outputSchema: BrowserReplayDownloadOutputSchema,\n annotations: annotations('Download Replay MP4'),\n },\n async input => {\n if (localBrowserModeEnabled()) return localReplayUnsupported('browser_replay_download', input.session_id, input.replay_id)\n const res = await downloadReplay(input.session_id, input.replay_id, input.filename)\n if (!res.ok) return errorResult('browser_replay_download', res.data, input.session_id, input.replay_id)\n return structuredResult({\n ok: true,\n tool: 'browser_replay_download',\n session_id: input.session_id,\n replay_id: input.replay_id,\n file_path: res.data?.file_path ?? null,\n bytes: typeof res.data?.bytes === 'number' ? res.data.bytes : null,\n mime_type: res.data?.mime_type ?? null,\n download_url: res.data?.download_url ?? null,\n })\n },\n )\n\n server.registerTool(\n 'browser_replay_mark',\n {\n title: 'Mark Replay Annotation',\n description:\n 'While a replay is actively recording, locate one exact DOM target and return a ready-to-use annotation object with DOM bounds and replay-relative timing. Use this instead of guessing start_seconds or drawing rough rectangles. Workflow: start browser_replay_start, navigate until the target is visible and stable, call browser_replay_mark for each callout, then stop the replay and pass the returned annotations to browser_replay_annotate.',\n inputSchema: BrowserReplayMarkInputSchema,\n outputSchema: BrowserReplayMarkOutputSchema,\n annotations: annotations('Mark Replay Annotation', true),\n },\n async input => {\n if (localBrowserModeEnabled()) return localReplayUnsupported('browser_replay_mark', input.session_id)\n const res = await req('POST', `/agent/sessions/${input.session_id}/locate`, { targets: [input.target] })\n if (!res.ok) return errorResult('browser_replay_mark', res.data, input.session_id)\n const target = res.data?.targets?.[0]\n const element = target?.element\n const elapsed = res.data?.replay?.replay_elapsed_seconds\n if (!target?.found || !element) {\n return errorResult('browser_replay_mark', { error: target?.error ?? 'target not found in current viewport', target }, input.session_id)\n }\n if (!finiteNumber(elapsed)) {\n return errorResult('browser_replay_mark', { error: 'no active replay clock found; call browser_replay_start before browser_replay_mark' }, input.session_id)\n }\n const padded = expandElementBounds(element, res.data?.viewport, input.padding ?? 8)\n const start = Math.max(0, elapsed + (input.start_offset_seconds ?? -0.25))\n const duration = input.duration_seconds ?? 4\n const annotation = {\n type: input.type ?? 'box',\n start_seconds: Number(start.toFixed(3)),\n end_seconds: Number((start + duration).toFixed(3)),\n left: Math.round(padded.left),\n top: Math.round(padded.top),\n width: Math.round(padded.width),\n height: Math.round(padded.height),\n ...(input.label ? { label: input.label } : {}),\n ...(input.color ? { color: input.color } : {}),\n ...(input.thickness ? { thickness: input.thickness } : {}),\n }\n return structuredResult({\n ok: true,\n tool: 'browser_replay_mark',\n session_id: input.session_id,\n replay_id: res.data?.replay?.replay_id ?? res.data?.replay?.replayId ?? null,\n annotation,\n source_width: padded.sourceWidth,\n source_height: padded.sourceHeight,\n replay: res.data.replay,\n target,\n hint: 'Append annotation to your annotations array. Use source_width/source_height with browser_replay_annotate.',\n })\n },\n )\n\n server.registerTool(\n 'browser_replay_annotate',\n {\n title: 'Annotate Replay MP4',\n description:\n 'Download a browser replay MP4, render visual annotations over it, and save a new annotated MP4 locally. Use this after browser_replay_stop when the user wants proof videos with circles, boxes, arrows, underlines, or labels. For accurate timing and placement, prefer annotations returned by browser_replay_mark while the replay is recording; otherwise use exact left/top/width/height bounds from browser_locate. If the replay video size differs from the screenshot coordinate space, pass source_width and source_height.',\n inputSchema: BrowserReplayAnnotateInputSchema,\n outputSchema: BrowserReplayAnnotateOutputSchema,\n annotations: annotations('Annotate Replay MP4'),\n },\n async input => {\n if (localBrowserModeEnabled()) return localReplayUnsupported('browser_replay_annotate', input.session_id, input.replay_id)\n const sourceName = input.filename ? `${input.filename}-source` : undefined\n const downloaded = await downloadReplay(input.session_id, input.replay_id, sourceName)\n if (!downloaded.ok) return errorResult('browser_replay_annotate', downloaded.data, input.session_id, input.replay_id)\n try {\n const sourcePath = String(downloaded.data.file_path)\n const outputPath = annotatedReplayFilePath(input.session_id, input.replay_id, input.filename)\n mkdirSync(join(outputBaseDir(), 'browser-replays'), { recursive: true })\n const result = await annotateReplayVideo(sourcePath, outputPath, {\n annotations: input.annotations,\n sourceWidth: input.source_width,\n sourceHeight: input.source_height,\n sourceLeftOffset: input.source_left_offset,\n sourceTopOffset: input.source_top_offset,\n })\n return structuredResult({\n ok: true,\n tool: 'browser_replay_annotate',\n session_id: input.session_id,\n replay_id: input.replay_id,\n source_file_path: sourcePath,\n annotated_file_path: result.filePath,\n bytes: result.bytes,\n width: result.width,\n height: result.height,\n annotation_count: result.annotationCount,\n mime_type: 'video/mp4',\n })\n } catch (err) {\n return errorResult('browser_replay_annotate', { error: err instanceof Error ? err.message : String(err) }, input.session_id, input.replay_id)\n }\n },\n )\n\n server.registerTool(\n 'browser_close',\n {\n title: 'Close Browser Session',\n description: 'Close and release a browser session when the task is done, when the user asks to stop the browser, or when active browser billing should end. Use browser_list_sessions first if you need to recover the session_id.',\n inputSchema: BrowserSessionInputSchema,\n outputSchema: BrowserCloseOutputSchema,\n annotations: { title: 'Close Browser Session', readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },\n },\n async input => {\n if (localBrowserModeEnabled()) {\n try {\n const res = await localBrowser.close(input.session_id)\n return structuredResult({\n ok: true,\n tool: 'browser_close',\n session_id: input.session_id,\n closed: true,\n raw: res,\n })\n } catch (err) {\n return errorResult('browser_close', { error: err instanceof Error ? err.message : String(err), mode: 'local' }, input.session_id)\n }\n }\n const res = await req('DELETE', `/agent/sessions/${input.session_id}`)\n if (!res.ok) return errorResult('browser_close', res.data, input.session_id)\n return structuredResult({\n ok: true,\n tool: 'browser_close',\n session_id: input.session_id,\n closed: true,\n raw: res.data,\n })\n },\n )\n\n server.registerTool(\n 'browser_list_sessions',\n {\n title: 'List Browser Sessions',\n description: 'List browser sessions and their status, with a watch_url for each. Use this to recover a session_id, find an active browser, or decide which session to close. Use browser_open to create a new session.',\n inputSchema: BrowserListInputSchema,\n outputSchema: BrowserListSessionsOutputSchema,\n annotations: annotations('List Browser Sessions', true),\n },\n async input => {\n if (localBrowserModeEnabled()) {\n const sessions = localBrowser.list(input.include_closed)\n return structuredResult({\n ok: true,\n tool: 'browser_list_sessions',\n session_id: null,\n sessions,\n count: sessions.length,\n })\n }\n const res = await req('GET', `/agent/sessions${input.include_closed ? '?all=1' : ''}`)\n if (!res.ok) return errorResult('browser_list_sessions', res.data)\n const sessions = (res.data.sessions ?? []).map((s: any) => ({ ...s, watch_url: `${consoleBase}/console/${s.session_id}` }))\n return structuredResult({\n ok: true,\n tool: 'browser_list_sessions',\n session_id: null,\n sessions,\n count: sessions.length,\n })\n },\n )\n\n server.registerTool(\n 'browser_capture_fanout',\n {\n title: 'Capture AI Search Fan-Out',\n description:\n 'Capture the query fan-out behind a ChatGPT or Claude web-search answer for Answer Engine Optimization (AEO): the exact sub-queries the model issued, every researched URL split into cited vs browsed-only (with citation frequency and snippet), each source tagged by category (First-party/vendor, News/media, Reddit, Social/video, Encyclopedia, Review site, Docs, Blog), plus top sourced sites and citation order. This returns the raw structured data; YOU analyze it — classify each sub-query by funnel stage (Problem-aware, Solution-aware, Decision-aware, Retention) and type (BoFu, Branded, Comparison, How-to, Search operator), name the brands the model researched, and give AEO insights. Sample asks: \"capture the fan-out for this ChatGPT answer\", \"what did Claude search and cite for best CRM\", \"show the sub-queries and sources behind this AI answer\". WRITE NOTE: passing prompt submits a real message in the user\\'s logged-in account (a new conversation turn) — only send when the user wants that; omit prompt to capture a prompt the user just ran. Setup, if not already connected or if the profile disconnected: call browser_profile_onboard, give the user the watch_url, let them click Sign in on Google, then call browser_close after they confirm login. After that, browser_open the saved direct no-proxy profile and go to chatgpt.com or claude.ai. Fan-out is captured only as it streams, so the session must be open when the prompt runs. NOT for Google AI Overview citations — use harvest_paa for those; this tool is ChatGPT and Claude only.',\n inputSchema: BrowserCaptureFanoutInputSchema,\n outputSchema: BrowserCaptureFanoutOutputSchema,\n annotations: annotations('Capture AI Search Fan-Out'),\n },\n async input => {\n const emit = (result: Record<string, unknown>, exports: unknown) => structuredResult({\n ok: true,\n tool: 'browser_capture_fanout',\n session_id: input.session_id,\n platform: result.platform,\n captured_at: result.capturedAt,\n prompt: result.prompt,\n meta: result.meta,\n queries: result.queries,\n browsed_urls: result.browsedUrls,\n cited_urls: result.citedUrls,\n browsed_only: result.browsedOnly,\n snippets: result.snippets,\n counts: result.counts,\n aggregates: result.aggregates,\n first_party_domain: result.firstPartyDomain,\n exports: exports ?? null,\n ...(result.debug ? { debug: result.debug } : {}),\n })\n if (localBrowserModeEnabled()) {\n try {\n const { result, exports } = await localBrowser.captureFanout(input.session_id, input)\n return emit(result as unknown as Record<string, unknown>, exports)\n } catch (err) {\n return errorResult('browser_capture_fanout', { error: err instanceof Error ? err.message : String(err), mode: 'local' }, input.session_id)\n }\n }\n const res = await req('POST', `/agent/sessions/${input.session_id}/capture-fanout`, {\n prompt: input.prompt,\n wait_ms: input.wait_ms,\n first_party_domain: input.first_party_domain,\n export: false,\n })\n if (!res.ok) return errorResult('browser_capture_fanout', res.data, input.session_id)\n const hosted = (res.data?.result ?? res.data) as Record<string, unknown>\n return emit(hosted, res.data?.exports ?? null)\n },\n )\n\n}\n","import { randomUUID } from 'node:crypto'\nimport { existsSync } from 'node:fs'\nimport { basename } from 'node:path'\nimport { chromium } from 'playwright-extra'\nimport StealthPlugin from 'puppeteer-extra-plugin-stealth'\nimport type { BrowserContext, Page } from 'playwright'\n\nchromium.use(StealthPlugin())\nimport {\n defaultChromeExecutablePath,\n loadImportedBrowserProfile,\n type ImportedBrowserProfileManifest,\n} from '../../lib/local-browser-profiles.js'\nimport type {\n BrowserCaptureFanoutInput,\n BrowserClickInput,\n BrowserLocateInput,\n BrowserOpenInput,\n BrowserPressInput,\n BrowserScrollInput,\n BrowserTypeInput,\n} from '../../mcp/browser-agent-tool-schemas.js'\nimport { runFanoutCapture, type FanoutCaptureOutput } from '../fanout/run-capture.js'\n\ninterface LocalBrowserContextState {\n key: string\n context: BrowserContext\n profile: ResolvedLocalBrowserProfile\n}\n\ninterface ResolvedLocalBrowserProfile {\n name: string\n userDataDir: string\n browserExecutablePath: string | null\n manifest: ImportedBrowserProfileManifest | null\n}\n\ninterface LocalBrowserSessionState {\n sessionId: string\n label: string | null\n page: Page\n contextKey: string\n profileName: string\n userDataDir: string\n createdAt: string\n lastActionAt: string\n closedAt: string | null\n status: 'open' | 'closed'\n timeout?: NodeJS.Timeout\n}\n\ntype ReadPageResult = {\n url: string\n title: string\n text: string\n elements: Array<Record<string, unknown>>\n viewport: Record<string, unknown>\n}\n\nfunction directProfileDir(): string | undefined {\n return process.env.MCP_SCRAPER_BROWSER_PROFILE_DIR?.trim() || undefined\n}\n\nfunction configuredProfileName(profile?: string): string {\n return profile?.trim()\n || process.env.MCP_SCRAPER_BROWSER_PROFILE?.trim()\n || (directProfileDir() ? basename(directProfileDir()!) : 'default')\n}\n\nfunction launchExecutablePath(profile: ResolvedLocalBrowserProfile): string | undefined {\n const configured = process.env.MCP_SCRAPER_BROWSER_EXECUTABLE?.trim()\n || profile.browserExecutablePath\n || defaultChromeExecutablePath()\n return configured && existsSync(configured) ? configured : undefined\n}\n\nfunction ignoreDefaultArgsFor(executablePath?: string): string[] | undefined {\n if (!executablePath) return undefined\n if (process.platform !== 'darwin') return undefined\n if (!/Google Chrome\\.app\\/Contents\\/MacOS\\/Google Chrome$/.test(executablePath)) return undefined\n return ['--password-store=basic', '--use-mock-keychain']\n}\n\nfunction normalizeKeyCombo(value: string): string {\n return value\n .split('+')\n .map(part => {\n const trimmed = part.trim()\n const lower = trimmed.toLowerCase()\n if (lower === 'ctrl' || lower === 'control') return 'Control'\n if (lower === 'cmd' || lower === 'command' || lower === 'meta') return 'Meta'\n if (lower === 'option' || lower === 'alt') return 'Alt'\n if (lower === 'return') return 'Enter'\n if (lower === 'esc') return 'Escape'\n if (trimmed.length === 1) return trimmed.toUpperCase()\n return trimmed\n })\n .join('+')\n}\n\nfunction sessionSummary(session: LocalBrowserSessionState): Record<string, unknown> {\n return {\n session_id: session.sessionId,\n status: session.status,\n label: session.label,\n profile: session.profileName,\n user_data_dir: session.userDataDir,\n created_at: session.createdAt,\n last_action_at: session.lastActionAt,\n closed_at: session.closedAt,\n watch_url: `local://browser-session/${session.sessionId}`,\n url: session.status === 'open' ? session.page.url() : null,\n }\n}\n\nexport class LocalBrowserAgentService {\n private readonly contexts = new Map<string, LocalBrowserContextState>()\n private readonly sessions = new Map<string, LocalBrowserSessionState>()\n\n async open(input: BrowserOpenInput): Promise<Record<string, unknown>> {\n const profile = await this.resolveProfile(input.profile)\n const contextState = await this.ensureContext(profile)\n const pages = contextState.context.pages()\n const page = pages.length === 1 && !this.hasOpenSessionForContext(contextState.key)\n ? pages[0]\n : await contextState.context.newPage()\n const now = new Date().toISOString()\n const sessionId = `lbs_${randomUUID().replace(/-/g, '').slice(0, 20)}`\n const session: LocalBrowserSessionState = {\n sessionId,\n label: input.label ?? null,\n page,\n contextKey: contextState.key,\n profileName: profile.name,\n userDataDir: profile.userDataDir,\n createdAt: now,\n lastActionAt: now,\n closedAt: null,\n status: 'open',\n }\n const timeoutSeconds = input.timeout_seconds ?? 600\n if (timeoutSeconds > 0) {\n session.timeout = setTimeout(() => {\n void this.close(sessionId)\n }, timeoutSeconds * 1000)\n session.timeout.unref()\n }\n this.sessions.set(sessionId, session)\n\n if (input.url) await this.goto(sessionId, input.url)\n\n return {\n session_id: sessionId,\n watch_url: `local://browser-session/${sessionId}`,\n live_view_url: null,\n profile: profile.name,\n user_data_dir: profile.userDataDir,\n url: input.url ?? null,\n mode: 'local',\n }\n }\n\n async screenshot(sessionId: string): Promise<ReadPageResult & { image_base64: string; mime_type: string }> {\n const session = this.requireOpenSession(sessionId)\n await this.waitForPage(session.page)\n const image = await session.page.screenshot({ type: 'png', fullPage: false })\n const page = await this.read(sessionId)\n return {\n ...page,\n image_base64: image.toString('base64'),\n mime_type: 'image/png',\n }\n }\n\n async read(sessionId: string): Promise<ReadPageResult> {\n const session = this.requireOpenSession(sessionId)\n await this.waitForPage(session.page)\n this.touch(session)\n const title = await session.page.title().catch(() => '')\n const snapshot = await session.page.evaluate(() => {\n const cssEscape = (value: string) => {\n const escapeFn = (globalThis as { CSS?: { escape?: (input: string) => string } }).CSS?.escape\n return escapeFn ? escapeFn(value) : value.replace(/[\"\\\\#.:>+~[\\]()]/g, '\\\\$&')\n }\n const textFor = (element: Element): string => {\n const html = element as HTMLInputElement & HTMLElement\n return (\n element.getAttribute('aria-label')\n || element.getAttribute('title')\n || html.placeholder\n || html.value\n || html.innerText\n || element.textContent\n || ''\n ).replace(/\\s+/g, ' ').trim()\n }\n const selectorFor = (element: Element): string => {\n const id = (element as HTMLElement).id\n if (id) return `#${cssEscape(id)}`\n const name = element.getAttribute('name')\n const tag = element.tagName.toLowerCase()\n if (name) return `${tag}[name=\"${name.replace(/\"/g, '\\\\\"')}\"]`\n const parts: string[] = []\n let current: Element | null = element\n while (current && current !== document.body && parts.length < 4) {\n const currentTag = current.tagName.toLowerCase()\n const parent: Element | null = current.parentElement\n if (!parent) {\n parts.unshift(currentTag)\n break\n }\n const children = Array.from(parent.children) as Element[]\n const siblings = children.filter((child: Element) => child.tagName === current!.tagName)\n const index = siblings.indexOf(current) + 1\n parts.unshift(siblings.length > 1 ? `${currentTag}:nth-of-type(${index})` : currentTag)\n current = parent\n }\n return parts.join(' > ') || tag\n }\n const candidates = Array.from(document.querySelectorAll<HTMLElement>(\n 'a, button, input, textarea, select, summary, [role], [contenteditable=\"true\"], [tabindex]:not([tabindex=\"-1\"])',\n ))\n const elements = candidates\n .map((element, index) => {\n const rect = element.getBoundingClientRect()\n const style = window.getComputedStyle(element)\n const visible = rect.width > 0\n && rect.height > 0\n && style.display !== 'none'\n && style.visibility !== 'hidden'\n && Number(style.opacity || '1') > 0\n if (!visible) return null\n const label = textFor(element)\n return {\n index,\n tag: element.tagName.toLowerCase(),\n role: element.getAttribute('role') || null,\n text: label.slice(0, 180),\n selector: selectorFor(element),\n x: Math.round(rect.left + rect.width / 2),\n y: Math.round(rect.top + rect.height / 2),\n left: Math.round(rect.left),\n top: Math.round(rect.top),\n width: Math.round(rect.width),\n height: Math.round(rect.height),\n }\n })\n .filter(Boolean)\n .slice(0, 120)\n\n return {\n text: (document.body?.innerText || '').replace(/\\n{3,}/g, '\\n\\n').slice(0, 30_000),\n elements,\n viewport: {\n width: window.innerWidth,\n height: window.innerHeight,\n devicePixelRatio: window.devicePixelRatio,\n scrollX: window.scrollX,\n scrollY: window.scrollY,\n },\n }\n })\n\n return {\n url: session.page.url(),\n title,\n text: snapshot.text,\n elements: snapshot.elements as Array<Record<string, unknown>>,\n viewport: snapshot.viewport,\n }\n }\n\n async locate(sessionId: string, targets: BrowserLocateInput['targets']): Promise<Record<string, unknown>> {\n const session = this.requireOpenSession(sessionId)\n this.touch(session)\n const located = []\n for (const target of targets) {\n try {\n const locator = target.selector\n ? session.page.locator(target.selector)\n : session.page.getByText(target.text ?? '', { exact: target.match === 'exact' })\n const selected = locator.nth(target.index ?? 0)\n await selected.waitFor({ state: 'visible', timeout: 3000 }).catch(() => undefined)\n const box = await selected.boundingBox()\n const text = await selected.textContent({ timeout: 1000 }).catch(() => null)\n located.push({\n input: target,\n found: Boolean(box),\n element: box\n ? {\n left: Math.round(box.x),\n top: Math.round(box.y),\n width: Math.round(box.width),\n height: Math.round(box.height),\n x: Math.round(box.x + box.width / 2),\n y: Math.round(box.y + box.height / 2),\n text: (text ?? '').replace(/\\s+/g, ' ').trim().slice(0, 220),\n }\n : null,\n })\n } catch (err) {\n located.push({\n input: target,\n found: false,\n element: null,\n error: err instanceof Error ? err.message : String(err),\n })\n }\n }\n const read = await this.read(sessionId)\n return {\n url: read.url,\n title: read.title,\n viewport: read.viewport,\n replay: null,\n targets: located,\n }\n }\n\n async goto(sessionId: string, url: string): Promise<Record<string, unknown>> {\n const session = this.requireOpenSession(sessionId)\n this.touch(session)\n const response = await session.page.goto(url, { waitUntil: 'domcontentloaded', timeout: 45_000 }).catch(err => {\n throw new Error(err instanceof Error ? err.message : String(err))\n })\n await this.waitForPage(session.page)\n return {\n ok: true,\n url: session.page.url(),\n status: response?.status() ?? null,\n mode: 'local',\n }\n }\n\n async click(sessionId: string, input: BrowserClickInput): Promise<Record<string, unknown>> {\n const session = this.requireOpenSession(sessionId)\n this.touch(session)\n await session.page.mouse.click(input.x, input.y, {\n button: input.button ?? 'left',\n clickCount: input.num_clicks ?? 1,\n })\n await this.waitForPage(session.page)\n return { ok: true, mode: 'local', url: session.page.url() }\n }\n\n async type(sessionId: string, input: BrowserTypeInput): Promise<Record<string, unknown>> {\n const session = this.requireOpenSession(sessionId)\n this.touch(session)\n await session.page.keyboard.type(input.text, { delay: input.delay })\n return { ok: true, mode: 'local', url: session.page.url() }\n }\n\n async scroll(sessionId: string, input: BrowserScrollInput): Promise<Record<string, unknown>> {\n const session = this.requireOpenSession(sessionId)\n this.touch(session)\n if (typeof input.x === 'number' && typeof input.y === 'number') {\n await session.page.mouse.move(input.x, input.y)\n }\n await session.page.mouse.wheel((input.delta_x ?? 0) * 120, (input.delta_y ?? 5) * 120)\n await session.page.waitForTimeout(150).catch(() => undefined)\n return { ok: true, mode: 'local', url: session.page.url() }\n }\n\n async press(sessionId: string, input: BrowserPressInput): Promise<Record<string, unknown>> {\n const session = this.requireOpenSession(sessionId)\n this.touch(session)\n for (const key of input.keys) {\n await session.page.keyboard.press(normalizeKeyCombo(key))\n }\n await this.waitForPage(session.page)\n return { ok: true, mode: 'local', url: session.page.url() }\n }\n\n async close(sessionId: string): Promise<Record<string, unknown>> {\n const session = this.sessions.get(sessionId)\n if (!session || session.status === 'closed') {\n return { ok: true, closed: true, already_closed: true, mode: 'local' }\n }\n if (session.timeout) clearTimeout(session.timeout)\n session.status = 'closed'\n session.closedAt = new Date().toISOString()\n await session.page.close().catch(() => undefined)\n await this.closeContextIfUnused(session.contextKey)\n return { ok: true, closed: true, mode: 'local' }\n }\n\n list(includeClosed = false): Record<string, unknown>[] {\n return Array.from(this.sessions.values())\n .filter(session => includeClosed || session.status === 'open')\n .map(sessionSummary)\n }\n\n async captureFanout(sessionId: string, input: BrowserCaptureFanoutInput): Promise<FanoutCaptureOutput> {\n const session = this.requireOpenSession(sessionId)\n this.touch(session)\n return runFanoutCapture(session.page, input)\n }\n\n async screenshotOnly(sessionId: string): Promise<string> {\n const session = this.requireOpenSession(sessionId)\n await this.waitForPage(session.page)\n const img = await session.page.screenshot({ type: 'png', fullPage: false })\n return img.toString('base64')\n }\n\n private async resolveProfile(profile?: string): Promise<ResolvedLocalBrowserProfile> {\n const directDir = directProfileDir()\n const requestedName = configuredProfileName(profile)\n if (directDir && (!profile || requestedName === process.env.MCP_SCRAPER_BROWSER_PROFILE?.trim())) {\n return {\n name: requestedName,\n userDataDir: directDir,\n browserExecutablePath: process.env.MCP_SCRAPER_BROWSER_EXECUTABLE?.trim() || defaultChromeExecutablePath() || null,\n manifest: null,\n }\n }\n const manifest = await loadImportedBrowserProfile(requestedName)\n return {\n name: manifest.name,\n userDataDir: manifest.userDataDir,\n browserExecutablePath: manifest.browserExecutablePath,\n manifest,\n }\n }\n\n private async ensureContext(profile: ResolvedLocalBrowserProfile): Promise<LocalBrowserContextState> {\n const existing = this.contexts.get(profile.userDataDir)\n if (existing) return existing\n const executablePath = launchExecutablePath(profile)\n const context = await chromium.launchPersistentContext(profile.userDataDir, {\n headless: false,\n viewport: { width: 1440, height: 900 },\n acceptDownloads: true,\n ...(executablePath ? { executablePath } : {}),\n ...(ignoreDefaultArgsFor(executablePath) ? { ignoreDefaultArgs: ignoreDefaultArgsFor(executablePath) } : {}),\n })\n const state = { key: profile.userDataDir, context, profile }\n context.on('close', () => {\n this.contexts.delete(profile.userDataDir)\n const closedAt = new Date().toISOString()\n for (const session of this.sessions.values()) {\n if (session.contextKey === profile.userDataDir && session.status === 'open') {\n session.status = 'closed'\n session.closedAt = closedAt\n if (session.timeout) clearTimeout(session.timeout)\n }\n }\n })\n this.contexts.set(profile.userDataDir, state)\n return state\n }\n\n private requireOpenSession(sessionId: string): LocalBrowserSessionState {\n const session = this.sessions.get(sessionId)\n if (!session || session.status !== 'open') throw new Error(`Local browser session not found or closed: ${sessionId}`)\n return session\n }\n\n private touch(session: LocalBrowserSessionState): void {\n session.lastActionAt = new Date().toISOString()\n }\n\n private hasOpenSessionForContext(contextKey: string): boolean {\n return Array.from(this.sessions.values()).some(session => session.contextKey === contextKey && session.status === 'open')\n }\n\n private async closeContextIfUnused(contextKey: string): Promise<void> {\n if (this.hasOpenSessionForContext(contextKey)) return\n const state = this.contexts.get(contextKey)\n if (!state) return\n this.contexts.delete(contextKey)\n await state.context.close().catch(() => undefined)\n }\n\n private async waitForPage(page: Page): Promise<void> {\n await page.waitForLoadState('domcontentloaded', { timeout: 5_000 }).catch(() => undefined)\n await page.waitForTimeout(200).catch(() => undefined)\n }\n}\n","import { z } from 'zod'\n\nconst NullableString = z.string().nullable()\nconst BrowserRawObject = z.record(z.unknown())\n\nconst BrowserElementOutput = z.record(z.unknown())\n\nconst BrowserBaseOutput = {\n ok: z.boolean().describe('Whether the browser-agent action succeeded.'),\n tool: z.string().describe('Browser Agent MCP tool that produced this response.'),\n session_id: NullableString.describe('Browser session id when the response is scoped to a session.'),\n}\n\nconst BrowserReplayBaseOutput = {\n ...BrowserBaseOutput,\n replay_id: NullableString.describe('Replay id when the response is scoped to a replay.'),\n}\n\nexport const BrowserOpenInputSchema = {\n label: z.string().optional().describe('Optional human label for this session, shown in the watch console.'),\n url: z.string().url().optional().describe('Optional URL to navigate to immediately after opening.'),\n profile: z.string().optional().describe('Optional saved hosted profile name to load a logged-in session for a site.'),\n save_profile_changes: z.boolean().optional().describe('Persist cookies and local storage back to the named profile when the session is closed. Use this for profile setup or intentional auth refreshes; avoid parallel sessions writing to the same profile.'),\n timeout_seconds: z.number().int().min(60).max(259200).optional().describe('How long the direct no-proxy browser session may live before auto-termination. Defaults to 600. The browser idles into a zero-cost standby between actions, so a longer timeout is cheap.'),\n}\nexport type BrowserOpenInput = z.infer<ReturnType<typeof z.object<typeof BrowserOpenInputSchema>>>\n\nexport const BrowserProfileListInputSchema = {\n email: z.string().optional().describe('Optional Chrome account email or displayed profile name to filter for, for example seo@example.com.'),\n user_data_dir: z.string().optional().describe('Optional Chrome user data directory. Defaults to the current OS Chrome profile root.'),\n}\nexport type BrowserProfileListInput = z.infer<ReturnType<typeof z.object<typeof BrowserProfileListInputSchema>>>\n\nexport const BrowserProfileOnboardInputSchema = {\n email: z.string().optional().describe('Optional account email used to derive a stable MCP Scraper profile name. This does not import cookies or browser state.'),\n profile: z.string().optional().describe('Optional saved MCP Scraper hosted browser profile name to create or load. If omitted, email is used to derive one.'),\n user_data_dir: z.string().optional().describe('Optional Chrome metadata directory for deriving a profile name only. This is not a local browser setup path.'),\n url: z.string().url().optional().describe('Setup URL to open after creating the direct no-proxy browser. Defaults to https://google.com/ so the user can click Sign in.'),\n label: z.string().optional().describe('Optional human label for this setup session.'),\n timeout_seconds: z.number().int().min(60).max(259200).optional().describe('How long the direct no-proxy setup session may live before auto-termination. Defaults to 600.'),\n}\nexport type BrowserProfileOnboardInput = z.infer<ReturnType<typeof z.object<typeof BrowserProfileOnboardInputSchema>>>\n\nexport const BrowserProfileImportInputSchema = {\n email: z.string().optional().describe('Optional Chrome account email or displayed profile name to select from Chrome Local State.'),\n name: z.string().optional().describe('Name for the managed MCP Scraper browser profile. Defaults to a slug derived from the selected Chrome account.'),\n chrome_profile_directory: z.string().optional().describe('Optional Chrome profile directory to import, for example Default or Profile 1.'),\n user_data_dir: z.string().optional().describe('Optional source Chrome user data directory. Defaults to the current OS Chrome profile root.'),\n output_dir: z.string().optional().describe('Optional managed profile base directory. Defaults to ~/.mcp-scraper/browser-profiles.'),\n browser_executable_path: z.string().optional().describe('Optional Chrome executable path for local browser launches. Defaults to the installed Google Chrome path when found.'),\n overwrite: z.boolean().default(false).describe('Overwrite an existing managed profile clone with the same name.'),\n}\nexport type BrowserProfileImportInput = z.infer<ReturnType<typeof z.object<typeof BrowserProfileImportInputSchema>>>\n\nexport const BrowserProfileSyncInputSchema = {\n name: z.string().describe('Managed MCP Scraper browser profile name to refresh from its recorded source Chrome profile.'),\n output_dir: z.string().optional().describe('Optional managed profile base directory. Defaults to ~/.mcp-scraper/browser-profiles.'),\n browser_executable_path: z.string().optional().describe('Optional Chrome executable path to store in the refreshed profile manifest.'),\n}\nexport type BrowserProfileSyncInput = z.infer<ReturnType<typeof z.object<typeof BrowserProfileSyncInputSchema>>>\n\nexport const BrowserSessionInputSchema = {\n session_id: z.string().describe('The session id returned by browser_open or browser_list_sessions. Use only a returned session_id; do not construct one yourself.'),\n}\nexport type BrowserSessionInput = z.infer<ReturnType<typeof z.object<typeof BrowserSessionInputSchema>>>\n\nexport const BrowserLocateTargetSchema = z.object({\n name: z.string().optional().describe('Optional label for this target, echoed in the result.'),\n selector: z.string().optional().describe('CSS selector for the exact DOM element to locate, for example h1, input[name=\"q\"], or [data-testid=\"result\"].'),\n text: z.string().optional().describe('Visible text to locate when a selector is not known. The tool returns the text range bounds when possible.'),\n match: z.enum(['contains', 'exact']).default('contains').describe('How to match text targets. Defaults to contains.'),\n index: z.number().int().min(0).default(0).describe('Zero-based match index when multiple elements match.'),\n}).refine(value => Boolean(value.selector || value.text), {\n message: 'target requires selector or text',\n})\n\nexport const BrowserLocateInputSchema = {\n session_id: z.string().describe('The session id returned by browser_open or browser_list_sessions. Use only a returned session_id; do not construct one yourself.'),\n targets: z.array(BrowserLocateTargetSchema).min(1).max(20).describe('DOM targets to locate in the current viewport. Use selectors for exact elements, or text for visible text ranges.'),\n}\nexport type BrowserLocateInput = z.infer<ReturnType<typeof z.object<typeof BrowserLocateInputSchema>>>\n\nexport const BrowserGotoInputSchema = {\n session_id: z.string().describe('The session id returned by browser_open or browser_list_sessions. Use only a returned session_id; do not construct one yourself.'),\n url: z.string().url().describe('URL to navigate the browser to.'),\n}\nexport type BrowserGotoInput = z.infer<ReturnType<typeof z.object<typeof BrowserGotoInputSchema>>>\n\nexport const BrowserClickInputSchema = {\n session_id: z.string().describe('The session id returned by browser_open or browser_list_sessions. Use only a returned session_id; do not construct one yourself.'),\n x: z.number().describe('X coordinate to click, in screenshot pixels. Use only coordinates from the latest browser_screenshot, browser_read, or browser_locate result; do not guess.'),\n y: z.number().describe('Y coordinate to click, in screenshot pixels. Use only coordinates from the latest browser_screenshot, browser_read, or browser_locate result; do not guess.'),\n button: z.enum(['left', 'right', 'middle']).default('left').describe('Mouse button.'),\n num_clicks: z.number().int().min(1).max(3).optional().describe('Number of clicks, e.g. 2 for double-click.'),\n}\nexport type BrowserClickInput = z.infer<ReturnType<typeof z.object<typeof BrowserClickInputSchema>>>\n\nexport const BrowserTypeInputSchema = {\n session_id: z.string().describe('The session id returned by browser_open or browser_list_sessions. Use only a returned session_id; do not construct one yourself.'),\n text: z.string().describe('Text to type at the current focus. Click a field first to focus it.'),\n delay: z.number().int().min(0).max(500).optional().describe('Optional per-keystroke delay in ms for human-like typing.'),\n}\nexport type BrowserTypeInput = z.infer<ReturnType<typeof z.object<typeof BrowserTypeInputSchema>>>\n\nexport const BrowserScrollInputSchema = {\n session_id: z.string().describe('The session id returned by browser_open or browser_list_sessions. Use only a returned session_id; do not construct one yourself.'),\n delta_y: z.number().default(5).describe('Vertical scroll in wheel units. Positive scrolls down, negative up.'),\n delta_x: z.number().default(0).describe('Horizontal scroll in wheel units.'),\n x: z.number().optional().describe('X position to scroll at. Defaults to screen center.'),\n y: z.number().optional().describe('Y position to scroll at. Defaults to screen center.'),\n}\nexport type BrowserScrollInput = z.infer<ReturnType<typeof z.object<typeof BrowserScrollInputSchema>>>\n\nexport const BrowserPressInputSchema = {\n session_id: z.string().describe('The session id returned by browser_open or browser_list_sessions. Use only a returned session_id; do not construct one yourself.'),\n keys: z.array(z.string()).min(1).describe('Keys or combinations to press, e.g. [\"Return\"], [\"Ctrl+a\"], [\"Ctrl+Shift+Tab\"].'),\n}\nexport type BrowserPressInput = z.infer<ReturnType<typeof z.object<typeof BrowserPressInputSchema>>>\n\nexport const BrowserReplayStopInputSchema = {\n session_id: z.string().describe('The session id returned by browser_open or browser_list_sessions. Use only a returned session_id; do not construct one yourself.'),\n replay_id: z.string().describe('The replay id returned by browser_replay_start or browser_list_replays. Use only a returned replay_id; do not construct one yourself.'),\n}\nexport type BrowserReplayStopInput = z.infer<ReturnType<typeof z.object<typeof BrowserReplayStopInputSchema>>>\n\nexport const BrowserReplayDownloadInputSchema = {\n session_id: z.string().describe('The session id returned by browser_open or browser_list_sessions. Use only a returned session_id; do not construct one yourself.'),\n replay_id: z.string().describe('The replay id returned by browser_replay_start or browser_list_replays. Use only a returned replay_id; do not construct one yourself.'),\n filename: z.string().optional().describe('Optional local MP4 filename. Defaults to a timestamped replay filename.'),\n}\nexport type BrowserReplayDownloadInput = z.infer<ReturnType<typeof z.object<typeof BrowserReplayDownloadInputSchema>>>\n\nexport const BrowserReplayAnnotationSchema = z.object({\n type: z.enum(['box', 'circle', 'underline', 'arrow', 'label']).default('box').describe('Annotation style to draw over the replay.'),\n start_seconds: z.number().min(0).default(0).describe('When the annotation should appear in the replay.'),\n end_seconds: z.number().min(0).optional().describe('When the annotation should disappear. Defaults to two seconds after start_seconds.'),\n left: z.number().optional().describe('Target left edge in browser screenshot pixels. Use element.left from browser_screenshot/browser_read.'),\n top: z.number().optional().describe('Target top edge in browser screenshot pixels. Use element.top from browser_screenshot/browser_read.'),\n width: z.number().positive().optional().describe('Target width in browser screenshot pixels. Use element.width from browser_screenshot/browser_read.'),\n height: z.number().positive().optional().describe('Target height in browser screenshot pixels. Use element.height from browser_screenshot/browser_read.'),\n x: z.number().optional().describe('Point target x coordinate in browser screenshot pixels when no box is available.'),\n y: z.number().optional().describe('Point target y coordinate in browser screenshot pixels when no box is available.'),\n from_x: z.number().optional().describe('Arrow start x coordinate in browser screenshot pixels. Defaults near the target.'),\n from_y: z.number().optional().describe('Arrow start y coordinate in browser screenshot pixels. Defaults near the target.'),\n to_x: z.number().optional().describe('Arrow target x coordinate in browser screenshot pixels. Defaults to the target box center.'),\n to_y: z.number().optional().describe('Arrow target y coordinate in browser screenshot pixels. Defaults to the target box center.'),\n label: z.string().max(120).optional().describe('Optional text callout to render near the annotation.'),\n color: z.string().regex(/^#?[0-9a-fA-F]{6}$/).optional().describe('Annotation color as hex, for example #ff3b30.'),\n thickness: z.number().min(1).max(24).optional().describe('Stroke thickness in pixels. Defaults to 5.'),\n})\n\nexport const BrowserReplayMarkInputSchema = {\n session_id: z.string().describe('The session id returned by browser_open or browser_list_sessions. Use only a returned session_id; do not construct one yourself. A replay must already be recording.'),\n target: BrowserLocateTargetSchema.describe('The exact DOM element or text range to mark in the current viewport.'),\n type: z.enum(['box', 'circle', 'underline', 'arrow']).default('box').describe('Annotation style to generate. Labels are included on the returned annotation when label is provided.'),\n label: z.string().max(120).optional().describe('Optional callout text to render near the target.'),\n color: z.string().regex(/^#?[0-9a-fA-F]{6}$/).optional().describe('Annotation color as hex, for example #ff3b30.'),\n thickness: z.number().min(1).max(24).optional().describe('Stroke thickness in pixels. Defaults to 5.'),\n padding: z.number().min(0).max(80).default(8).describe('Pixels to expand the DOM bounds so the highlight does not touch the text edge.'),\n start_offset_seconds: z.number().min(-5).max(10).default(-0.25).describe('Offset from the current replay time. Negative values make the callout appear just before the mark action is captured.'),\n duration_seconds: z.number().min(0.5).max(30).default(4).describe('How long the generated annotation should remain visible.'),\n}\nexport type BrowserReplayMarkInput = z.infer<ReturnType<typeof z.object<typeof BrowserReplayMarkInputSchema>>>\n\nexport const BrowserReplayAnnotateInputSchema = {\n session_id: z.string().describe('The session id returned by browser_open or browser_list_sessions. Use only a returned session_id; do not construct one yourself.'),\n replay_id: z.string().describe('The replay id returned by browser_replay_start or browser_list_replays. Use only a returned replay_id; do not construct one yourself.'),\n annotations: z.array(BrowserReplayAnnotationSchema).min(1).max(50).describe('Timed overlay annotations to render on the replay. Prefer annotations returned by browser_replay_mark; otherwise use exact DOM bounds from browser_locate/browser_screenshot/browser_read.'),\n filename: z.string().optional().describe('Optional output MP4 filename. Defaults to a timestamped annotated replay filename.'),\n source_width: z.number().positive().optional().describe('Width of the screenshot coordinate space used for annotations. Defaults to the replay video width.'),\n source_height: z.number().positive().optional().describe('Height of the coordinate space used for annotations. When this is a page viewport height smaller than the replay video height, the annotator infers the browser chrome top offset.'),\n source_left_offset: z.number().min(0).optional().describe('Optional explicit X offset from annotation coordinates to replay video coordinates. Usually omitted.'),\n source_top_offset: z.number().min(0).optional().describe('Optional explicit Y offset from annotation coordinates to replay video coordinates. Usually omitted because browser chrome offset is inferred when source_height is a page viewport height.'),\n}\nexport type BrowserReplayAnnotateInput = z.infer<ReturnType<typeof z.object<typeof BrowserReplayAnnotateInputSchema>>>\n\nexport const BrowserListInputSchema = {\n include_closed: z.boolean().default(false).describe('Include closed sessions in the list.'),\n}\nexport type BrowserListInput = z.infer<ReturnType<typeof z.object<typeof BrowserListInputSchema>>>\n\nexport const BrowserCaptureFanoutInputSchema = {\n session_id: z.string().describe('The session id returned by browser_open or browser_list_sessions. The session must be on chatgpt.com or claude.ai and logged in through a saved hosted profile. Use only a returned session_id; do not construct one yourself.'),\n prompt: z.string().optional().describe('Optional prompt to type into the chat composer and submit before capturing. Omit to passively capture the fan-out of a prompt the user just ran in the visible browser. The prompt must trigger web search for there to be a fan-out.'),\n wait_ms: z.number().int().min(0).max(180000).optional().describe('How long to wait for the answer stream to finish before parsing. Defaults to 90000 when a prompt is sent, 8000 for passive capture. Capture ends as soon as the answer stream finishes.'),\n first_party_domain: z.string().optional().describe('The brand/site being researched, for example example.com. Sources on this domain are tagged First-party/vendor. Set this when the prompt is about a specific business.'),\n reset: z.boolean().default(false).describe('Clear any previously buffered stream for this page before capturing. Use when re-running to avoid mixing turns.'),\n export: z.boolean().default(false).describe('When true, write JSON, CSV, TSV exports (queries, citations, sources, domains) and a self-contained HTML report to MCP_SCRAPER_OUTPUT_DIR/fanout and return their paths.'),\n}\nexport type BrowserCaptureFanoutInput = z.infer<ReturnType<typeof z.object<typeof BrowserCaptureFanoutInputSchema>>>\n\nconst FanoutSourceOutput = z.object({\n url: z.string(),\n domain: z.string(),\n title: z.string(),\n cited: z.boolean(),\n timesCited: z.number().int().min(0),\n snippet: z.string(),\n round: z.number().int().nullable(),\n siteType: z.string().describe('URL category: First-party/vendor, News/media, Reddit, Social/video, Encyclopedia, Review site, Docs, or Blog.'),\n})\n\nexport const BrowserCaptureFanoutOutputSchema = {\n ...BrowserBaseOutput,\n tool: z.literal('browser_capture_fanout'),\n platform: z.enum(['ChatGPT', 'Claude']).describe('Which AI-search surface the fan-out was captured from.'),\n captured_at: z.string(),\n prompt: z.string().describe('The user prompt that triggered the captured fan-out, when recoverable.'),\n meta: z.object({\n model: z.string(),\n finishType: z.string(),\n title: z.string(),\n rounds: z.number().int().min(0),\n }),\n queries: z.array(z.string()).describe('Every web-search sub-query the model issued, in capture order. Classify these by funnel stage and type yourself from the text.'),\n browsed_urls: z.array(FanoutSourceOutput).describe('Every researched URL (cited and browsed-only), cited first.'),\n cited_urls: z.array(FanoutSourceOutput).describe('The subset of researched URLs actually cited in the final answer.'),\n browsed_only: z.array(FanoutSourceOutput).describe('Researched URLs the model pulled but did not cite.'),\n snippets: z.array(z.object({ url: z.string(), domain: z.string(), title: z.string(), text: z.string() })),\n counts: z.object({\n subQueries: z.number().int().min(0),\n browsed: z.number().int().min(0),\n cited: z.number().int().min(0),\n browsedOnly: z.number().int().min(0),\n }),\n aggregates: z.object({\n topSites: z.array(z.object({ domain: z.string(), count: z.number().int(), cited: z.boolean(), timesCited: z.number().int(), siteType: z.string() })),\n citationOrder: z.array(z.object({ rank: z.number().int(), domain: z.string(), url: z.string(), timesCited: z.number().int() })),\n byCategory: z.record(z.number().int()),\n }).describe('Objective aggregates: top sourced sites by frequency, citation order, and URL-category counts.'),\n first_party_domain: z.string().nullable(),\n exports: z.object({\n dir: z.string(),\n json: z.string(),\n queriesCsv: z.string(),\n queriesTsv: z.string(),\n citationsCsv: z.string(),\n sourcesCsv: z.string(),\n domainsCsv: z.string(),\n report: z.string(),\n }).nullable().describe('Local file paths when export=true, otherwise null.'),\n debug: z.object({\n interceptorReady: z.boolean(),\n rawBytes: z.number().int().min(0),\n unmappedKeys: z.array(z.string()),\n note: z.string(),\n }).optional(),\n}\n\nexport const BrowserOpenOutputSchema = {\n ok: z.boolean(),\n tool: z.literal('browser_open'),\n session_id: z.string().describe('Session id returned by browser_open. Use only this exact value in later browser_* calls; do not construct one yourself.'),\n watch_url: z.string().describe('Human watch/takeover URL for this browser session.'),\n live_view_url: NullableString.describe('Raw live-view URL from the browser service when available.'),\n url: NullableString.describe('Initial URL requested by the caller, when provided.'),\n hint: z.string(),\n raw: BrowserRawObject.optional(),\n}\n\nexport const BrowserProfileListOutputSchema = {\n ok: z.boolean(),\n tool: z.literal('browser_profile_list'),\n session_id: z.null(),\n profiles: z.array(BrowserRawObject),\n count: z.number().int().min(0),\n hint: z.string(),\n}\n\nexport const BrowserProfileOnboardOutputSchema = {\n ok: z.boolean(),\n tool: z.literal('browser_profile_onboard'),\n session_id: z.string(),\n watch_url: z.string(),\n live_view_url: NullableString,\n profile: z.string(),\n setup_url: z.string(),\n chrome_profile: BrowserRawObject.nullable(),\n next_steps: z.array(z.string()),\n raw: BrowserRawObject.optional(),\n}\n\nexport const BrowserProfileImportOutputSchema = {\n ok: z.boolean(),\n tool: z.literal('browser_profile_import'),\n session_id: z.null(),\n profile: BrowserRawObject,\n source_profile: BrowserRawObject,\n next_steps: z.array(z.string()),\n hint: z.string(),\n}\n\nexport const BrowserProfileSyncOutputSchema = {\n ok: z.boolean(),\n tool: z.literal('browser_profile_sync'),\n session_id: z.null(),\n profile: BrowserRawObject,\n source_profile: BrowserRawObject,\n hint: z.string(),\n}\n\nexport const BrowserScreenshotOutputSchema = {\n ...BrowserBaseOutput,\n tool: z.literal('browser_screenshot'),\n url: NullableString,\n title: NullableString,\n text: z.string(),\n elements: z.array(BrowserElementOutput),\n screenshot: z.object({\n mime_type: z.string(),\n inline: z.boolean(),\n }).nullable(),\n}\n\nexport const BrowserReadOutputSchema = {\n ...BrowserBaseOutput,\n tool: z.literal('browser_read'),\n url: NullableString,\n title: NullableString,\n text: z.string(),\n elements: z.array(BrowserElementOutput),\n raw: BrowserRawObject.optional(),\n}\n\nexport const BrowserLocateOutputSchema = {\n ...BrowserBaseOutput,\n tool: z.literal('browser_locate'),\n url: NullableString,\n title: NullableString,\n viewport: BrowserRawObject.nullable(),\n replay: BrowserRawObject.nullable(),\n targets: z.array(BrowserRawObject),\n raw: BrowserRawObject.optional(),\n}\n\nexport const BrowserActionOutputSchema = {\n ...BrowserBaseOutput,\n result: BrowserRawObject.describe('Provider action result. Check ok and follow with browser_screenshot/browser_read when page state matters.'),\n nextRecommendedTool: z.string().nullable(),\n}\n\nexport const BrowserReplayStartOutputSchema = {\n ...BrowserReplayBaseOutput,\n tool: z.literal('browser_replay_start'),\n view_url: NullableString,\n download_url: NullableString,\n raw: BrowserRawObject.optional(),\n}\n\nexport const BrowserReplayStopOutputSchema = {\n ...BrowserReplayBaseOutput,\n tool: z.literal('browser_replay_stop'),\n view_url: NullableString,\n download_url: NullableString,\n raw: BrowserRawObject.optional(),\n}\n\nexport const BrowserListReplaysOutputSchema = {\n ...BrowserBaseOutput,\n tool: z.literal('browser_list_replays'),\n replays: z.array(BrowserRawObject),\n count: z.number().int().min(0),\n}\n\nexport const BrowserReplayDownloadOutputSchema = {\n ...BrowserReplayBaseOutput,\n tool: z.literal('browser_replay_download'),\n file_path: NullableString,\n bytes: z.number().int().min(0).nullable(),\n mime_type: NullableString,\n download_url: NullableString,\n}\n\nexport const BrowserReplayMarkOutputSchema = {\n ...BrowserReplayBaseOutput,\n tool: z.literal('browser_replay_mark'),\n annotation: BrowserRawObject,\n source_width: z.number().nullable(),\n source_height: z.number().nullable(),\n target: BrowserRawObject.nullable(),\n hint: z.string(),\n}\n\nexport const BrowserReplayAnnotateOutputSchema = {\n ...BrowserReplayBaseOutput,\n tool: z.literal('browser_replay_annotate'),\n source_file_path: NullableString,\n annotated_file_path: NullableString,\n bytes: z.number().int().min(0).nullable(),\n width: z.number().int().min(0).nullable(),\n height: z.number().int().min(0).nullable(),\n annotation_count: z.number().int().min(0).nullable(),\n mime_type: NullableString,\n}\n\nexport const BrowserCloseOutputSchema = {\n ...BrowserBaseOutput,\n tool: z.literal('browser_close'),\n closed: z.boolean(),\n raw: BrowserRawObject.optional(),\n}\n\nexport const BrowserListSessionsOutputSchema = {\n ok: z.boolean(),\n tool: z.literal('browser_list_sessions'),\n session_id: z.null(),\n sessions: z.array(BrowserRawObject),\n count: z.number().int().min(0),\n}\n","import { execFile } from 'node:child_process'\nimport { mkdtemp, rm, stat, writeFile } from 'node:fs/promises'\nimport { tmpdir } from 'node:os'\nimport { join } from 'node:path'\nimport { promisify } from 'node:util'\n\nconst execFileAsync = promisify(execFile)\n\nexport type ReplayAnnotationType = 'box' | 'circle' | 'underline' | 'arrow' | 'label'\n\nexport interface ReplayAnnotation {\n type?: ReplayAnnotationType\n start_seconds?: number\n end_seconds?: number\n left?: number\n top?: number\n width?: number\n height?: number\n x?: number\n y?: number\n from_x?: number\n from_y?: number\n to_x?: number\n to_y?: number\n label?: string\n color?: string\n thickness?: number\n}\n\nexport interface AnnotateReplayOptions {\n annotations: ReplayAnnotation[]\n sourceWidth?: number\n sourceHeight?: number\n sourceLeftOffset?: number\n sourceTopOffset?: number\n}\n\ninterface Size {\n width: number\n height: number\n}\n\ninterface Rect {\n left: number\n top: number\n width: number\n height: number\n}\n\ninterface CoordinateTransform {\n scaleX: number\n scaleY: number\n offsetX: number\n offsetY: number\n}\n\nexport interface AnnotatedReplayResult {\n filePath: string\n bytes: number\n width: number\n height: number\n annotationCount: number\n}\n\nfunction finiteNumber(value: unknown): value is number {\n return typeof value === 'number' && Number.isFinite(value)\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, value))\n}\n\nfunction formatAssTime(seconds: number): string {\n const safe = Math.max(0, seconds)\n const hours = Math.floor(safe / 3600)\n const minutes = Math.floor((safe % 3600) / 60)\n const wholeSeconds = Math.floor(safe % 60)\n const centiseconds = Math.floor((safe - Math.floor(safe)) * 100)\n return `${hours}:${String(minutes).padStart(2, '0')}:${String(wholeSeconds).padStart(2, '0')}.${String(centiseconds).padStart(2, '0')}`\n}\n\nfunction cssHexToAssColor(color?: string): string {\n const normalized = color?.trim().match(/^#?([0-9a-fA-F]{6})$/)?.[1] ?? 'ff3b30'\n const red = normalized.slice(0, 2)\n const green = normalized.slice(2, 4)\n const blue = normalized.slice(4, 6)\n return `&H${blue}${green}${red}&`\n}\n\nfunction escapeAssText(value: string): string {\n return value\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\\{/g, '\\\\{')\n .replace(/\\}/g, '\\\\}')\n .replace(/\\r?\\n/g, '\\\\N')\n}\n\nfunction resolveCoordinateTransform(video: Size, source: Size, options: AnnotateReplayOptions): CoordinateTransform {\n const explicitOffsetX = finiteNumber(options.sourceLeftOffset) ? options.sourceLeftOffset : null\n const explicitOffsetY = finiteNumber(options.sourceTopOffset) ? options.sourceTopOffset : null\n const inferredTopOffset =\n explicitOffsetY == null &&\n Math.round(source.width) === Math.round(video.width) &&\n source.height < video.height &&\n video.height - source.height <= 220\n ? video.height - source.height\n : 0\n const offsetX = explicitOffsetX ?? 0\n const offsetY = explicitOffsetY ?? inferredTopOffset\n return {\n scaleX: (video.width - offsetX) / source.width,\n scaleY: (video.height - offsetY) / source.height,\n offsetX,\n offsetY,\n }\n}\n\nfunction transformPoint(x: number, y: number, transform: CoordinateTransform): { x: number; y: number } {\n return {\n x: x * transform.scaleX + transform.offsetX,\n y: y * transform.scaleY + transform.offsetY,\n }\n}\n\nfunction scaleRect(annotation: ReplayAnnotation, transform: CoordinateTransform): Rect {\n if (\n finiteNumber(annotation.left) &&\n finiteNumber(annotation.top) &&\n finiteNumber(annotation.width) &&\n finiteNumber(annotation.height)\n ) {\n const origin = transformPoint(annotation.left, annotation.top, transform)\n return {\n left: origin.x,\n top: origin.y,\n width: annotation.width * transform.scaleX,\n height: annotation.height * transform.scaleY,\n }\n }\n if (finiteNumber(annotation.x) && finiteNumber(annotation.y)) {\n const radius = finiteNumber(annotation.width) ? annotation.width / 2 : 28\n const point = transformPoint(annotation.x, annotation.y, transform)\n return {\n left: point.x - radius * transform.scaleX,\n top: point.y - radius * transform.scaleY,\n width: radius * 2 * transform.scaleX,\n height: radius * 2 * transform.scaleY,\n }\n }\n throw new Error('annotation needs either left/top/width/height or x/y')\n}\n\nfunction rectPath(rect: Rect): string {\n const x1 = Math.round(rect.left)\n const y1 = Math.round(rect.top)\n const x2 = Math.round(rect.left + rect.width)\n const y2 = Math.round(rect.top + rect.height)\n return `m ${x1} ${y1} l ${x2} ${y1} l ${x2} ${y2} l ${x1} ${y2} l ${x1} ${y1}`\n}\n\nfunction ellipsePath(rect: Rect): string {\n const cx = rect.left + rect.width / 2\n const cy = rect.top + rect.height / 2\n const rx = Math.max(4, rect.width / 2)\n const ry = Math.max(4, rect.height / 2)\n const points: string[] = []\n for (let i = 0; i <= 32; i += 1) {\n const t = (Math.PI * 2 * i) / 32\n const x = Math.round(cx + Math.cos(t) * rx)\n const y = Math.round(cy + Math.sin(t) * ry)\n points.push(`${i === 0 ? 'm' : 'l'} ${x} ${y}`)\n }\n return points.join(' ')\n}\n\nfunction filledRectPath(left: number, top: number, width: number, height: number): string {\n return rectPath({ left, top, width, height })\n}\n\nfunction arrowPath(fromX: number, fromY: number, toX: number, toY: number, thickness: number): string {\n const dx = toX - fromX\n const dy = toY - fromY\n const length = Math.max(1, Math.hypot(dx, dy))\n const ux = dx / length\n const uy = dy / length\n const px = -uy\n const py = ux\n const half = thickness / 2\n const head = Math.max(14, thickness * 4)\n const baseX = toX - ux * head\n const baseY = toY - uy * head\n const p1x = Math.round(fromX + px * half)\n const p1y = Math.round(fromY + py * half)\n const p2x = Math.round(baseX + px * half)\n const p2y = Math.round(baseY + py * half)\n const p3x = Math.round(baseX + px * head * 0.55)\n const p3y = Math.round(baseY + py * head * 0.55)\n const p4x = Math.round(toX)\n const p4y = Math.round(toY)\n const p5x = Math.round(baseX - px * head * 0.55)\n const p5y = Math.round(baseY - py * head * 0.55)\n const p6x = Math.round(baseX - px * half)\n const p6y = Math.round(baseY - py * half)\n const p7x = Math.round(fromX - px * half)\n const p7y = Math.round(fromY - py * half)\n return `m ${p1x} ${p1y} l ${p2x} ${p2y} l ${p3x} ${p3y} l ${p4x} ${p4y} l ${p5x} ${p5y} l ${p6x} ${p6y} l ${p7x} ${p7y} l ${p1x} ${p1y}`\n}\n\nfunction eventLine(start: number, end: number, body: string): string {\n return `Dialogue: 0,${formatAssTime(start)},${formatAssTime(end)},Default,,0,0,0,,${body}`\n}\n\nfunction labelLine(start: number, end: number, x: number, y: number, label: string): string {\n const safeX = Math.round(x)\n const safeY = Math.round(y)\n return eventLine(\n start,\n end,\n `{\\\\an7\\\\pos(${safeX},${safeY})\\\\fs30\\\\bord4\\\\shad0\\\\c&HFFFFFF&\\\\3c&H000000&}${escapeAssText(label)}`,\n )\n}\n\nfunction shapeLine(start: number, end: number, path: string, color: string, thickness: number, filled = false): string {\n const fillAlpha = filled ? '&H00&' : '&HFF&'\n const border = filled ? 0 : thickness\n return eventLine(\n start,\n end,\n `{\\\\an7\\\\pos(0,0)\\\\p1\\\\bord${border}\\\\shad0\\\\1a${fillAlpha}\\\\1c${color}\\\\3c${color}}${path}`,\n )\n}\n\nexport function buildAssSubtitle(options: AnnotateReplayOptions, video: Size): string {\n const source = {\n width: options.sourceWidth && options.sourceWidth > 0 ? options.sourceWidth : video.width,\n height: options.sourceHeight && options.sourceHeight > 0 ? options.sourceHeight : video.height,\n }\n const transform = resolveCoordinateTransform(video, source, options)\n const lines: string[] = []\n for (const annotation of options.annotations) {\n const start = Math.max(0, annotation.start_seconds ?? 0)\n const end = annotation.end_seconds && annotation.end_seconds > start ? annotation.end_seconds : start + 2\n const type = annotation.type ?? 'box'\n const color = cssHexToAssColor(annotation.color)\n const thickness = Math.round(clamp(annotation.thickness ?? 5, 2, 24))\n if (type === 'label') {\n if (!annotation.label) throw new Error('label annotation needs label')\n const rect = scaleRect(annotation, transform)\n lines.push(labelLine(start, end, rect.left, Math.max(8, rect.top), annotation.label))\n continue\n }\n if (type === 'arrow') {\n const rect = finiteNumber(annotation.to_x) && finiteNumber(annotation.to_y)\n ? null\n : scaleRect(annotation, transform)\n const toPoint = finiteNumber(annotation.to_x) && finiteNumber(annotation.to_y)\n ? transformPoint(annotation.to_x, annotation.to_y, transform)\n : null\n const toX = toPoint ? toPoint.x : rect!.left + rect!.width / 2\n const toY = toPoint ? toPoint.y : rect!.top + rect!.height / 2\n const fromPoint = finiteNumber(annotation.from_x) && finiteNumber(annotation.from_y)\n ? transformPoint(annotation.from_x, annotation.from_y, transform)\n : null\n const fromX = fromPoint ? fromPoint.x : clamp(toX - 120, 12, video.width - 12)\n const fromY = fromPoint ? fromPoint.y : clamp(toY - 90, 12, video.height - 12)\n lines.push(shapeLine(start, end, arrowPath(fromX, fromY, toX, toY, thickness), color, thickness, true))\n if (annotation.label) lines.push(labelLine(start, end, fromX + 8, Math.max(96, fromY - 36), annotation.label))\n continue\n }\n const rect = scaleRect(annotation, transform)\n if (type === 'underline') {\n const underlineTop = rect.top + rect.height + thickness\n lines.push(shapeLine(start, end, filledRectPath(rect.left, underlineTop, rect.width, thickness), color, 0, true))\n } else if (type === 'circle') {\n lines.push(shapeLine(start, end, ellipsePath(rect), color, thickness))\n } else {\n lines.push(shapeLine(start, end, rectPath(rect), color, thickness))\n }\n if (annotation.label) lines.push(labelLine(start, end, rect.left, Math.max(8, rect.top - 38), annotation.label))\n }\n\n return [\n '[Script Info]',\n 'ScriptType: v4.00+',\n `PlayResX: ${Math.round(video.width)}`,\n `PlayResY: ${Math.round(video.height)}`,\n 'ScaledBorderAndShadow: yes',\n '',\n '[V4+ Styles]',\n 'Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding',\n 'Style: Default,Arial,30,&H00FFFFFF,&H000000FF,&H00000000,&H90000000,0,0,0,0,100,100,0,0,1,2,0,7,0,0,0,1',\n '',\n '[Events]',\n 'Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text',\n ...lines,\n '',\n ].join('\\n')\n}\n\nasync function videoSize(inputFilePath: string): Promise<Size> {\n const { stdout } = await execFileAsync('ffprobe', [\n '-v',\n 'error',\n '-select_streams',\n 'v:0',\n '-show_entries',\n 'stream=width,height',\n '-of',\n 'json',\n inputFilePath,\n ], { maxBuffer: 1024 * 1024 })\n const parsed = JSON.parse(stdout) as { streams?: Array<{ width?: number; height?: number }> }\n const stream = parsed.streams?.[0]\n if (!stream?.width || !stream.height) throw new Error('could not read replay video dimensions')\n return { width: stream.width, height: stream.height }\n}\n\nfunction ffmpegFilterPath(path: string): string {\n return path.replace(/\\\\/g, '\\\\\\\\').replace(/:/g, '\\\\:')\n}\n\nexport async function annotateReplayVideo(\n inputFilePath: string,\n outputFilePath: string,\n options: AnnotateReplayOptions,\n): Promise<AnnotatedReplayResult> {\n if (!options.annotations.length) throw new Error('annotations must include at least one item')\n const size = await videoSize(inputFilePath)\n const tmp = await mkdtemp(join(tmpdir(), 'mcp-scraper-ass-'))\n const assPath = join(tmp, 'annotations.ass')\n try {\n await writeFile(assPath, buildAssSubtitle(options, size), 'utf8')\n await execFileAsync('ffmpeg', [\n '-y',\n '-i',\n inputFilePath,\n '-vf',\n `ass=${ffmpegFilterPath(assPath)}`,\n '-c:v',\n 'libx264',\n '-pix_fmt',\n 'yuv420p',\n '-movflags',\n '+faststart',\n '-c:a',\n 'copy',\n outputFilePath,\n ], { maxBuffer: 1024 * 1024 * 20 })\n const out = await stat(outputFilePath)\n return {\n filePath: outputFilePath,\n bytes: out.size,\n width: size.width,\n height: size.height,\n annotationCount: options.annotations.length,\n }\n } finally {\n await rm(tmp, { recursive: true, force: true })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SAAS,iBAAiB;AA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