mcp-scraper 0.3.3 → 0.3.5

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.
Files changed (37) hide show
  1. package/README.md +17 -29
  2. package/dist/bin/api-server.cjs +10 -5
  3. package/dist/bin/api-server.cjs.map +1 -1
  4. package/dist/bin/api-server.js +1 -1
  5. package/dist/bin/browser-agent-stdio-server.cjs +32 -29
  6. package/dist/bin/browser-agent-stdio-server.cjs.map +1 -1
  7. package/dist/bin/browser-agent-stdio-server.js +2 -2
  8. package/dist/bin/mcp-scraper-cli.cjs +10 -11
  9. package/dist/bin/mcp-scraper-cli.cjs.map +1 -1
  10. package/dist/bin/mcp-scraper-cli.js +10 -11
  11. package/dist/bin/mcp-scraper-cli.js.map +1 -1
  12. package/dist/bin/mcp-scraper-combined-stdio-server.cjs +39 -36
  13. package/dist/bin/mcp-scraper-combined-stdio-server.cjs.map +1 -1
  14. package/dist/bin/mcp-scraper-combined-stdio-server.js +4 -4
  15. package/dist/bin/mcp-scraper-install.cjs +8 -8
  16. package/dist/bin/mcp-scraper-install.cjs.map +1 -1
  17. package/dist/bin/mcp-scraper-install.js +2 -2
  18. package/dist/bin/mcp-stdio-server.cjs +1 -1
  19. package/dist/bin/mcp-stdio-server.cjs.map +1 -1
  20. package/dist/bin/mcp-stdio-server.js +2 -2
  21. package/dist/{chunk-RLBJ3QNC.js → chunk-CMK5MMEE.js} +33 -30
  22. package/dist/chunk-CMK5MMEE.js.map +1 -0
  23. package/dist/chunk-GHBU5SGQ.js +7 -0
  24. package/dist/chunk-GHBU5SGQ.js.map +1 -0
  25. package/dist/{chunk-C3FGVJWH.js → chunk-RVYHP7QN.js} +8 -8
  26. package/dist/chunk-RVYHP7QN.js.map +1 -0
  27. package/dist/{chunk-MGWGZBL5.js → chunk-WZT3XKES.js} +2 -2
  28. package/dist/{server-D3XHIEQN.js → server-BC4Z2L4P.js} +12 -7
  29. package/dist/{server-D3XHIEQN.js.map → server-BC4Z2L4P.js.map} +1 -1
  30. package/docs/mcp-tool-craft-lint.generated.md +1 -1
  31. package/docs/mcp-tool-manifest.generated.json +21 -24
  32. package/package.json +1 -1
  33. package/dist/chunk-C3FGVJWH.js.map +0 -1
  34. package/dist/chunk-PVXDEREW.js +0 -7
  35. package/dist/chunk-PVXDEREW.js.map +0 -1
  36. package/dist/chunk-RLBJ3QNC.js.map +0 -1
  37. /package/dist/{chunk-MGWGZBL5.js.map → chunk-WZT3XKES.js.map} +0 -0
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  HttpMcpToolExecutor,
4
4
  buildPaaExtractorMcpServer
5
- } from "../chunk-MGWGZBL5.js";
5
+ } from "../chunk-WZT3XKES.js";
6
6
  import "../chunk-M2S27J6Z.js";
7
7
  import "../chunk-LFATOGDF.js";
8
- import "../chunk-PVXDEREW.js";
8
+ import "../chunk-GHBU5SGQ.js";
9
9
 
10
10
  // bin/mcp-stdio-server.ts
11
11
  import { readFileSync } from "fs";
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-DUEW4EOO.js";
16
16
  import {
17
17
  PACKAGE_VERSION
18
- } from "./chunk-PVXDEREW.js";
18
+ } from "./chunk-GHBU5SGQ.js";
19
19
 
20
20
  // src/mcp/browser-agent-mcp-server.ts
21
21
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
@@ -408,21 +408,21 @@ var BrowserReplayBaseOutput = {
408
408
  var BrowserOpenInputSchema = {
409
409
  label: z.string().optional().describe("Optional human label for this session, shown in the watch console."),
410
410
  url: z.string().url().optional().describe("Optional URL to navigate to immediately after opening."),
411
- profile: z.string().optional().describe("Optional saved profile name to load a logged-in session for a site."),
411
+ profile: z.string().optional().describe("Optional saved hosted profile name to load a logged-in session for a site."),
412
412
  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."),
413
- timeout_seconds: z.number().int().min(60).max(259200).optional().describe("How long the 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.")
413
+ 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.")
414
414
  };
415
415
  var BrowserProfileListInputSchema = {
416
416
  email: z.string().optional().describe("Optional Chrome account email or displayed profile name to filter for, for example seo@example.com."),
417
417
  user_data_dir: z.string().optional().describe("Optional Chrome user data directory. Defaults to the current OS Chrome profile root.")
418
418
  };
419
419
  var BrowserProfileOnboardInputSchema = {
420
- email: z.string().optional().describe("Optional local Chrome account email to find and convert into a suggested Kernel profile name."),
421
- profile: z.string().optional().describe("Optional Kernel browser profile name to create/load. If omitted, email is used to derive one."),
422
- user_data_dir: z.string().optional().describe("Optional Chrome user data directory for email lookup. Defaults to the current OS Chrome profile root."),
423
- url: z.string().url().optional().describe("Setup URL to open after creating the browser. Defaults to https://accounts.google.com/."),
420
+ 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."),
421
+ 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."),
422
+ 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."),
423
+ 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."),
424
424
  label: z.string().optional().describe("Optional human label for this setup session."),
425
- timeout_seconds: z.number().int().min(60).max(259200).optional().describe("How long the setup session may live before auto-termination. Defaults to 600.")
425
+ 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.")
426
426
  };
427
427
  var BrowserProfileImportInputSchema = {
428
428
  email: z.string().optional().describe("Optional Chrome account email or displayed profile name to select from Chrome Local State."),
@@ -533,7 +533,7 @@ var BrowserListInputSchema = {
533
533
  include_closed: z.boolean().default(false).describe("Include closed sessions in the list.")
534
534
  };
535
535
  var BrowserCaptureFanoutInputSchema = {
536
- session_id: z.string().describe("The session id returned by browser_open or browser_list_sessions. The session must be a local-mode session on chatgpt.com or claude.ai that is logged in. Use only a returned session_id; do not construct one yourself."),
536
+ 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."),
537
537
  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."),
538
538
  wait_ms: z.number().int().min(0).max(18e4).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."),
539
539
  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."),
@@ -1149,11 +1149,11 @@ function registerBrowserAgentMcpTools(server, opts) {
1149
1149
  server.registerTool(
1150
1150
  "browser_profile_list",
1151
1151
  {
1152
- title: "List Local Chrome Profiles",
1153
- description: "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.",
1152
+ title: "Developer: List Local Chrome Profiles",
1153
+ description: "Developer/local-machine helper only. 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. Do not use this for customer AI visibility setup or reconnects; use browser_profile_onboard at Google and provide the hosted watch_url instead.",
1154
1154
  inputSchema: BrowserProfileListInputSchema,
1155
1155
  outputSchema: BrowserProfileListOutputSchema,
1156
- annotations: annotations("List Local Chrome Profiles", true)
1156
+ annotations: annotations("Developer: List Local Chrome Profiles", true)
1157
1157
  },
1158
1158
  async (input) => {
1159
1159
  try {
@@ -1164,7 +1164,7 @@ function registerBrowserAgentMcpTools(server, opts) {
1164
1164
  session_id: null,
1165
1165
  profiles,
1166
1166
  count: profiles.length,
1167
- hint: "Use browser_profile_import to clone one profile for local mode. Use browser_profile_onboard only for hosted Kernel profile setup."
1167
+ 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."
1168
1168
  });
1169
1169
  } catch (err) {
1170
1170
  return errorResult("browser_profile_list", { error: err instanceof Error ? err.message : String(err) });
@@ -1174,11 +1174,11 @@ function registerBrowserAgentMcpTools(server, opts) {
1174
1174
  server.registerTool(
1175
1175
  "browser_profile_import",
1176
1176
  {
1177
- title: "Import Local Chrome Profile",
1178
- description: "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.",
1177
+ title: "Developer: Import Local Chrome Profile",
1178
+ description: "Developer/local-machine helper only. 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. Do not use this for customer AI visibility setup or reconnects; use browser_profile_onboard at Google and provide the hosted watch_url instead.",
1179
1179
  inputSchema: BrowserProfileImportInputSchema,
1180
1180
  outputSchema: BrowserProfileImportOutputSchema,
1181
- annotations: { title: "Import Local Chrome Profile", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false }
1181
+ annotations: { title: "Developer: Import Local Chrome Profile", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false }
1182
1182
  },
1183
1183
  async (input) => {
1184
1184
  try {
@@ -1203,7 +1203,7 @@ function registerBrowserAgentMcpTools(server, opts) {
1203
1203
  "Restart the MCP client so it starts the local browser mode process.",
1204
1204
  "Call browser_open with the same MCP server; it will open a local Chrome window using the cloned profile."
1205
1205
  ],
1206
- hint: "The clone is local to this machine. Re-run browser_profile_sync after logging into new sites in normal Chrome."
1206
+ hint: "Developer-only local clone. For customer auth setup, use browser_profile_onboard at Google, provide the hosted watch_url, then browser_close to save the hosted profile."
1207
1207
  });
1208
1208
  } catch (err) {
1209
1209
  return errorResult("browser_profile_import", { error: err instanceof Error ? err.message : String(err) });
@@ -1213,11 +1213,11 @@ function registerBrowserAgentMcpTools(server, opts) {
1213
1213
  server.registerTool(
1214
1214
  "browser_profile_sync",
1215
1215
  {
1216
- title: "Sync Local Chrome Profile",
1217
- description: "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.",
1216
+ title: "Developer: Sync Local Chrome Profile",
1217
+ description: "Developer/local-machine helper only. 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. Do not use this for customer AI visibility setup or reconnects; use browser_profile_onboard at Google and provide the hosted watch_url instead.",
1218
1218
  inputSchema: BrowserProfileSyncInputSchema,
1219
1219
  outputSchema: BrowserProfileSyncOutputSchema,
1220
- annotations: { title: "Sync Local Chrome Profile", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false }
1220
+ annotations: { title: "Developer: Sync Local Chrome Profile", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false }
1221
1221
  },
1222
1222
  async (input) => {
1223
1223
  try {
@@ -1231,7 +1231,7 @@ function registerBrowserAgentMcpTools(server, opts) {
1231
1231
  session_id: null,
1232
1232
  profile: result.profile,
1233
1233
  source_profile: result.sourceProfile,
1234
- hint: `Refreshed ${result.profile.name}. Restart local browser sessions that were using this profile.`
1234
+ hint: `Developer-only local clone refreshed for ${result.profile.name}. Customer reconnects should use browser_profile_onboard with the same hosted profile name.`
1235
1235
  });
1236
1236
  } catch (err) {
1237
1237
  return errorResult("browser_profile_sync", { error: err instanceof Error ? err.message : String(err) });
@@ -1241,11 +1241,11 @@ function registerBrowserAgentMcpTools(server, opts) {
1241
1241
  server.registerTool(
1242
1242
  "browser_profile_onboard",
1243
1243
  {
1244
- title: "Onboard Hosted Browser Profile",
1245
- description: "Create or load a saved hosted Kernel browser profile and open a live setup browser with profile saving enabled. Use this only for hosted browser mode. If email is provided, the tool reads local Chrome profile metadata only to suggest the Kernel profile name; it does not import local cookies. For local browser mode with real Chrome state, use browser_profile_import instead.",
1244
+ title: "Connect Hosted Browser Profile",
1245
+ description: "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.",
1246
1246
  inputSchema: BrowserProfileOnboardInputSchema,
1247
1247
  outputSchema: BrowserProfileOnboardOutputSchema,
1248
- annotations: annotations("Onboard Hosted Browser Profile")
1248
+ annotations: annotations("Connect Hosted Browser Profile")
1249
1249
  },
1250
1250
  async (input) => {
1251
1251
  let chromeProfile = null;
@@ -1262,11 +1262,12 @@ function registerBrowserAgentMcpTools(server, opts) {
1262
1262
  error: "profile is required when no email match or BROWSER_AGENT_PROFILE_NAME is available"
1263
1263
  });
1264
1264
  }
1265
- const setupUrl = input.url ?? "https://accounts.google.com/";
1265
+ const setupUrl = input.url ?? "https://google.com/";
1266
1266
  const open = await req("POST", "/agent/sessions", {
1267
1267
  label: input.label ?? `Profile setup: ${profile}`,
1268
1268
  profile,
1269
1269
  save_profile_changes: true,
1270
+ disable_default_proxy: true,
1270
1271
  timeout_seconds: input.timeout_seconds
1271
1272
  });
1272
1273
  if (!open.ok) return errorResult("browser_profile_onboard", open.data);
@@ -1283,8 +1284,9 @@ function registerBrowserAgentMcpTools(server, opts) {
1283
1284
  setup_url: setupUrl,
1284
1285
  chrome_profile: chromeProfile,
1285
1286
  next_steps: [
1286
- "Open the watch_url and complete the login manually.",
1287
- "After login is complete, call browser_close with this session_id to persist cookies and local storage to the Kernel profile.",
1287
+ "Open the watch_url and let the user click Sign in on Google.",
1288
+ "After the user confirms login is complete, call browser_close with this session_id to persist cookies and local storage to the saved profile.",
1289
+ "If the saved profile later shows login controls or disconnects, repeat browser_profile_onboard and close the setup session again.",
1288
1290
  "Use BROWSER_AGENT_PROFILE_NAME or browser_open.profile with this profile name for future authenticated sessions."
1289
1291
  ],
1290
1292
  raw: session
@@ -1295,7 +1297,7 @@ function registerBrowserAgentMcpTools(server, opts) {
1295
1297
  "browser_open",
1296
1298
  {
1297
1299
  title: "Open Browser Session",
1298
- description: "Open a browser you can drive. By default this creates a hosted cloud browser with a watch_url; when MCP_SCRAPER_BROWSER_MODE=local it opens a local Google Chrome window against an imported MCP Scraper Chrome profile. Returns a session_id used by all other browser_* tools. In hosted mode, anti-bot stealth and automatic CAPTCHA/Cloudflare solving are on by default. Call browser_close when done.",
1300
+ description: "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.",
1299
1301
  inputSchema: BrowserOpenInputSchema,
1300
1302
  outputSchema: BrowserOpenOutputSchema,
1301
1303
  annotations: annotations("Open Browser Session")
@@ -1324,6 +1326,7 @@ function registerBrowserAgentMcpTools(server, opts) {
1324
1326
  label: input.label,
1325
1327
  ...profile ? { profile } : {},
1326
1328
  ...profile && typeof saveProfileChanges === "boolean" ? { save_profile_changes: saveProfileChanges } : {},
1329
+ disable_default_proxy: true,
1327
1330
  timeout_seconds: input.timeout_seconds
1328
1331
  });
1329
1332
  if (!open.ok) return errorResult("browser_open", open.data);
@@ -1861,7 +1864,7 @@ function registerBrowserAgentMcpTools(server, opts) {
1861
1864
  "browser_capture_fanout",
1862
1865
  {
1863
1866
  title: "Capture AI Search Fan-Out",
1864
- description: `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 \u2014 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) \u2014 only send when the user wants that; omit prompt to capture a prompt the user just ran. Setup, if not already done: import a logged-in session with browser_profile_import (local Chrome) or browser_profile_onboard (hosted Kernel), then browser_open and browser_goto 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 \u2014 use harvest_paa for those; this tool is ChatGPT and Claude only.`,
1867
+ description: `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 \u2014 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) \u2014 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 \u2014 use harvest_paa for those; this tool is ChatGPT and Claude only.`,
1865
1868
  inputSchema: BrowserCaptureFanoutInputSchema,
1866
1869
  outputSchema: BrowserCaptureFanoutOutputSchema,
1867
1870
  annotations: annotations("Capture AI Search Fan-Out")
@@ -1911,4 +1914,4 @@ export {
1911
1914
  buildBrowserAgentMcpServer,
1912
1915
  registerBrowserAgentMcpTools
1913
1916
  };
1914
- //# sourceMappingURL=chunk-RLBJ3QNC.js.map
1917
+ //# sourceMappingURL=chunk-CMK5MMEE.js.map