mcp-scraper 0.3.13 → 0.3.15

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 (51) hide show
  1. package/dist/bin/api-server.cjs +1991 -508
  2. package/dist/bin/api-server.cjs.map +1 -1
  3. package/dist/bin/api-server.js +3 -3
  4. package/dist/bin/browser-agent-stdio-server.cjs +9 -9
  5. package/dist/bin/browser-agent-stdio-server.cjs.map +1 -1
  6. package/dist/bin/browser-agent-stdio-server.js +2 -2
  7. package/dist/bin/mcp-scraper-cli.cjs +1 -1
  8. package/dist/bin/mcp-scraper-cli.cjs.map +1 -1
  9. package/dist/bin/mcp-scraper-cli.js +1 -1
  10. package/dist/bin/mcp-scraper-combined-stdio-server.cjs +428 -47
  11. package/dist/bin/mcp-scraper-combined-stdio-server.cjs.map +1 -1
  12. package/dist/bin/mcp-scraper-combined-stdio-server.js +6 -5
  13. package/dist/bin/mcp-scraper-combined-stdio-server.js.map +1 -1
  14. package/dist/bin/mcp-scraper-install.cjs +2 -2
  15. package/dist/bin/mcp-scraper-install.cjs.map +1 -1
  16. package/dist/bin/mcp-scraper-install.js +2 -2
  17. package/dist/bin/mcp-stdio-server.cjs +419 -38
  18. package/dist/bin/mcp-stdio-server.cjs.map +1 -1
  19. package/dist/bin/mcp-stdio-server.js +2 -2
  20. package/dist/chunk-2MX5WOII.js +7 -0
  21. package/dist/chunk-2MX5WOII.js.map +1 -0
  22. package/dist/{chunk-DBQDG7EH.js → chunk-5H22TOXQ.js} +28 -1
  23. package/dist/chunk-5H22TOXQ.js.map +1 -0
  24. package/dist/{chunk-KPXMPAJ3.js → chunk-7Y6JDBML.js} +2 -2
  25. package/dist/chunk-7Y6JDBML.js.map +1 -0
  26. package/dist/{chunk-QAOIH5U2.js → chunk-WJ2LWHPA.js} +10 -10
  27. package/dist/chunk-WJ2LWHPA.js.map +1 -0
  28. package/dist/{chunk-YGV2XZDT.js → chunk-WQAIOY2D.js} +424 -39
  29. package/dist/chunk-WQAIOY2D.js.map +1 -0
  30. package/dist/{chunk-AZ5PKU4F.js → chunk-ZAUMSBV3.js} +2 -2
  31. package/dist/{db-BE4JVB3V.js → db-P76GVIFN.js} +2 -2
  32. package/dist/{server-LX65PB7D.js → server-UOQ2JIUQ.js} +1106 -93
  33. package/dist/server-UOQ2JIUQ.js.map +1 -0
  34. package/dist/{worker-FG7ZWEGA.js → worker-2WVKKCC7.js} +3 -3
  35. package/docs/final-tooling-spec.md +206 -0
  36. package/docs/mcp-tool-craft-lint.generated.md +1 -1
  37. package/docs/mcp-tool-design-guide.md +225 -0
  38. package/docs/mcp-tool-manifest.generated.json +13 -13
  39. package/docs/seo-crawl-report-spec.md +287 -0
  40. package/docs/tool-catalog-spec.md +388 -0
  41. package/package.json +2 -1
  42. package/dist/chunk-BEZJ4G32.js +0 -7
  43. package/dist/chunk-BEZJ4G32.js.map +0 -1
  44. package/dist/chunk-DBQDG7EH.js.map +0 -1
  45. package/dist/chunk-KPXMPAJ3.js.map +0 -1
  46. package/dist/chunk-QAOIH5U2.js.map +0 -1
  47. package/dist/chunk-YGV2XZDT.js.map +0 -1
  48. package/dist/server-LX65PB7D.js.map +0 -1
  49. /package/dist/{chunk-AZ5PKU4F.js.map → chunk-ZAUMSBV3.js.map} +0 -0
  50. /package/dist/{db-BE4JVB3V.js.map → db-P76GVIFN.js.map} +0 -0
  51. /package/dist/{worker-FG7ZWEGA.js.map → worker-2WVKKCC7.js.map} +0 -0
@@ -17,9 +17,9 @@ loadDotEnv();
17
17
  async function main() {
18
18
  const [{ serve }, { app }, { startWorker }, { migrate }] = await Promise.all([
19
19
  import("@hono/node-server"),
20
- import("../server-LX65PB7D.js"),
21
- import("../worker-FG7ZWEGA.js"),
22
- import("../db-BE4JVB3V.js")
20
+ import("../server-UOQ2JIUQ.js"),
21
+ import("../worker-2WVKKCC7.js"),
22
+ import("../db-P76GVIFN.js")
23
23
  ]);
24
24
  const PORT = parseInt(process.env.PORT ?? "3001");
25
25
  try {
@@ -178,7 +178,7 @@ render();
178
178
  }
179
179
 
180
180
  // src/version.ts
181
- var PACKAGE_VERSION = "0.3.13";
181
+ var PACKAGE_VERSION = "0.3.15";
182
182
 
183
183
  // src/mcp/browser-agent-tool-schemas.ts
184
184
  var import_zod = require("zod");
@@ -329,7 +329,7 @@ var FanoutSourceOutput = import_zod.z.object({
329
329
  });
330
330
  var BrowserCaptureFanoutOutputSchema = {
331
331
  ...BrowserBaseOutput,
332
- tool: import_zod.z.literal("browser_capture_fanout"),
332
+ tool: import_zod.z.literal("query_fanout_workflow"),
333
333
  platform: import_zod.z.enum(["ChatGPT", "Claude"]).describe("Which AI-search surface the fan-out was captured from."),
334
334
  captured_at: import_zod.z.string(),
335
335
  prompt: import_zod.z.string().describe("The user prompt that triggered the captured fan-out, when recoverable."),
@@ -875,13 +875,13 @@ function registerBrowserAgentMcpTools(server2, opts) {
875
875
  const baseUrl2 = opts.baseUrl.replace(/\/$/, "");
876
876
  const consoleBase = (opts.consoleBaseUrl ?? opts.baseUrl).replace(/\/$/, "");
877
877
  const timeoutMs = opts.timeoutMs ?? 9e4;
878
- async function req(method, path, body) {
878
+ async function req(method, path, body, requestTimeoutMs = timeoutMs) {
879
879
  try {
880
880
  const res = await fetch(`${baseUrl2}${path}`, {
881
881
  method,
882
882
  headers: { "Content-Type": "application/json", "x-api-key": opts.apiKey },
883
883
  body: body ? JSON.stringify(body) : void 0,
884
- signal: AbortSignal.timeout(timeoutMs)
884
+ signal: AbortSignal.timeout(requestTimeoutMs)
885
885
  });
886
886
  const data = await res.json().catch(() => ({}));
887
887
  return { ok: res.ok, data };
@@ -1433,7 +1433,7 @@ function registerBrowserAgentMcpTools(server2, opts) {
1433
1433
  }
1434
1434
  );
1435
1435
  server2.registerTool(
1436
- "browser_capture_fanout",
1436
+ "query_fanout_workflow",
1437
1437
  {
1438
1438
  title: "Capture AI Search Fan-Out",
1439
1439
  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. Set export=true for durable JSON, CSV, TSV, and HTML artifacts; export paths are returned relative to MCP_SCRAPER_OUTPUT_DIR. 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 complete login, then call browser_profile_status until status is AUTHENTICATED. 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.`,
@@ -1444,7 +1444,7 @@ function registerBrowserAgentMcpTools(server2, opts) {
1444
1444
  async (input) => {
1445
1445
  const emit = (result, exports3) => structuredResult({
1446
1446
  ok: true,
1447
- tool: "browser_capture_fanout",
1447
+ tool: "query_fanout_workflow",
1448
1448
  session_id: input.session_id,
1449
1449
  platform: result.platform,
1450
1450
  captured_at: result.capturedAt,
@@ -1467,8 +1467,8 @@ function registerBrowserAgentMcpTools(server2, opts) {
1467
1467
  first_party_domain: input.first_party_domain,
1468
1468
  reset: input.reset,
1469
1469
  export: input.export
1470
- });
1471
- if (!res.ok) return errorResult("browser_capture_fanout", res.data, input.session_id);
1470
+ }, Math.max(timeoutMs, (input.wait_ms ?? (input.prompt ? 9e4 : 8e3)) + 3e4));
1471
+ if (!res.ok) return errorResult("query_fanout_workflow", res.data, input.session_id);
1472
1472
  const hosted = res.data?.result ?? res.data;
1473
1473
  let exports2 = res.data?.exports ?? null;
1474
1474
  if (input.export && !exports2 && isEnrichedFanout(hosted)) {
@@ -1476,7 +1476,7 @@ function registerBrowserAgentMcpTools(server2, opts) {
1476
1476
  exports2 = exportFanout(hosted);
1477
1477
  } catch (err) {
1478
1478
  return errorResult(
1479
- "browser_capture_fanout",
1479
+ "query_fanout_workflow",
1480
1480
  {
1481
1481
  error: `Fan-out captured but local export failed: ${err instanceof Error ? err.message : String(err)}`,
1482
1482
  result: hosted