mcp-scraper 0.32.1 → 0.32.2

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 (39) hide show
  1. package/README.md +1 -1
  2. package/dist/bin/api-server.cjs +15 -7
  3. package/dist/bin/api-server.cjs.map +1 -1
  4. package/dist/bin/api-server.js +2 -2
  5. package/dist/bin/mcp-scraper-cli.cjs +3 -1
  6. package/dist/bin/mcp-scraper-cli.cjs.map +1 -1
  7. package/dist/bin/mcp-scraper-cli.js +3 -3
  8. package/dist/bin/mcp-scraper-install.cjs +1 -1
  9. package/dist/bin/mcp-scraper-install.cjs.map +1 -1
  10. package/dist/bin/mcp-scraper-install.js +1 -1
  11. package/dist/bin/mcp-stdio-server.cjs +3 -1
  12. package/dist/bin/mcp-stdio-server.cjs.map +1 -1
  13. package/dist/bin/mcp-stdio-server.js +3 -3
  14. package/dist/bin/paa-harvest.cjs +4 -2
  15. package/dist/bin/paa-harvest.cjs.map +1 -1
  16. package/dist/bin/paa-harvest.js +2 -2
  17. package/dist/{chunk-RDCCU7CQ.js → chunk-AEMABLEL.js} +5 -4
  18. package/dist/chunk-AEMABLEL.js.map +1 -0
  19. package/dist/{chunk-55M5CE5L.js → chunk-MKZIL4EA.js} +2 -2
  20. package/dist/{chunk-PTHY7NYD.js → chunk-V73MPRU6.js} +3 -1
  21. package/dist/chunk-V73MPRU6.js.map +1 -0
  22. package/dist/{chunk-2FY4VBAY.js → chunk-XEED325T.js} +3 -3
  23. package/dist/chunk-XLO5CZ6T.js +7 -0
  24. package/dist/chunk-XLO5CZ6T.js.map +1 -0
  25. package/dist/index.cjs +4 -2
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.js +2 -2
  28. package/dist/{server-GXTYKIAX.js → server-LTZDJHFG.js} +17 -11
  29. package/dist/{server-GXTYKIAX.js.map → server-LTZDJHFG.js.map} +1 -1
  30. package/dist/{worker-7DJYUACV.js → worker-ZZCZNY3R.js} +3 -3
  31. package/docs/mcp-tool-manifest.generated.json +2 -2
  32. package/package.json +1 -1
  33. package/dist/chunk-PTHY7NYD.js.map +0 -1
  34. package/dist/chunk-RDCCU7CQ.js.map +0 -1
  35. package/dist/chunk-VJBS6RPB.js +0 -7
  36. package/dist/chunk-VJBS6RPB.js.map +0 -1
  37. /package/dist/{chunk-55M5CE5L.js.map → chunk-MKZIL4EA.js.map} +0 -0
  38. /package/dist/{chunk-2FY4VBAY.js.map → chunk-XEED325T.js.map} +0 -0
  39. /package/dist/{worker-7DJYUACV.js.map → worker-ZZCZNY3R.js.map} +0 -0
package/README.md CHANGED
@@ -88,7 +88,7 @@ Build the branded one-click bundle:
88
88
  npm run build:mcpb
89
89
  ```
90
90
 
91
- The generated bundle is written to `build/mcpb/mcp-scraper-<version>.mcpb` and copied to `public/downloads/` for the hosted download. The current public bundle is `https://mcpscraper.dev/downloads/mcp-scraper.mcpb` (`0.32.1`, SHA-256 `a8b3ff927f58382f5e550cbe079a4276e448c6750858ec9712f2f945cd79ffa3`). Install it by opening or dragging it into Claude Desktop. Claude displays the `MCP Scraper` install card, icon, and API-key configuration field from the bundle manifest.
91
+ The generated bundle is written to `build/mcpb/mcp-scraper-<version>.mcpb` and copied to `public/downloads/` for the hosted download. The current public bundle is `https://mcpscraper.dev/downloads/mcp-scraper.mcpb` (`0.32.2`, SHA-256 `e4bcf7d1e722ab821eaceebb5acba77e19e3e7bba1326c3d41f77cb22a70f793`). Install it by opening or dragging it into Claude Desktop. Claude displays the `MCP Scraper` install card, icon, and API-key configuration field from the bundle manifest.
92
92
 
93
93
  The MCPB install exposes every tool — web-intelligence plus all `browser_*` tools — through the one `mcp-scraper` server.
94
94
 
@@ -13834,8 +13834,8 @@ function positiveIntFromEnv(name, fallback) {
13834
13834
  function proxyIdSuffix(proxyId) {
13835
13835
  return proxyId ? proxyId.slice(-6) : null;
13836
13836
  }
13837
- function serpArrivalUrl(googleUrl) {
13838
- const base = process.env.SERP_REDIRECT_BASE?.trim().replace(/\/+$/, "");
13837
+ function serpArrivalUrl(googleUrl, baseOverride) {
13838
+ const base = (baseOverride ?? process.env.SERP_REDIRECT_BASE)?.trim().replace(/\/+$/, "");
13839
13839
  if (!base) return googleUrl;
13840
13840
  return `${base}/g/${Buffer.from(googleUrl, "utf8").toString("base64url")}`;
13841
13841
  }
@@ -17394,6 +17394,8 @@ var init_schemas3 = __esm({
17394
17394
  includeServices: import_zod17.z.boolean().default(false),
17395
17395
  proxyMode: import_zod17.z.enum(["location", "configured", "none"]).default(DEFAULT_MAPS_PROXY_MODE),
17396
17396
  proxyZip: import_zod17.z.string().regex(/^\d{5}$/).optional(),
17397
+ serpRedirect: import_zod17.z.boolean().optional(),
17398
+ forceDirectEgress: import_zod17.z.boolean().optional(),
17397
17399
  debug: import_zod17.z.boolean().default(false),
17398
17400
  kernelApiKey: import_zod17.z.string().optional(),
17399
17401
  kernelProxyId: import_zod17.z.string().optional(),
@@ -19260,14 +19262,16 @@ function buildGoogleOrganicSearchUrl(input) {
19260
19262
  if (input.location) params.set("uule", encodeUule(normalizeLocation(input.location)));
19261
19263
  return `https://www.google.com/search?${params.toString()}`;
19262
19264
  }
19263
- var LOCAL_RESULTS_PAGE_LIMIT, LOCAL_RESULTS_WAIT_MS, MapsSearchExtractor;
19265
+ var LOCAL_RESULTS_PAGE_LIMIT, LOCAL_RESULTS_WAIT_MS, MAPS_REDIRECT_BASE, MapsSearchExtractor;
19264
19266
  var init_MapsSearchExtractor = __esm({
19265
19267
  "src/extractor/MapsSearchExtractor.ts"() {
19266
19268
  "use strict";
19267
19269
  init_errors();
19270
+ init_BrowserDriver();
19268
19271
  init_uule();
19269
19272
  LOCAL_RESULTS_PAGE_LIMIT = 8;
19270
19273
  LOCAL_RESULTS_WAIT_MS = 1e3;
19274
+ MAPS_REDIRECT_BASE = "https://serp-redirector.vercel.app";
19271
19275
  MapsSearchExtractor = class {
19272
19276
  constructor(driver) {
19273
19277
  this.driver = driver;
@@ -19277,21 +19281,23 @@ var init_MapsSearchExtractor = __esm({
19277
19281
  const startMs = Date.now();
19278
19282
  const searchQuery = [options.query, options.location].filter(Boolean).join(" ");
19279
19283
  const searchUrl = buildGoogleOrganicSearchUrl(options);
19284
+ const keepDefaultProxy = !options.forceDirectEgress && options.proxyMode !== "location" && options.proxyMode !== "configured" && !options.kernelProxyId;
19280
19285
  const config = {
19281
19286
  headless: options.headless,
19282
19287
  kernelApiKey: options.kernelApiKey,
19283
19288
  kernelProxyId: options.kernelProxyId,
19284
19289
  kernelProxyResolution: options.kernelProxyResolution,
19285
19290
  proxyMode: options.proxyMode,
19286
- keepDefaultProxy: options.proxyMode !== "location" && options.proxyMode !== "configured" && !options.kernelProxyId,
19291
+ keepDefaultProxy,
19287
19292
  viewport: { width: 1280, height: 900 },
19288
19293
  locale: `${options.hl}-${options.gl.toUpperCase()}`,
19289
19294
  debug: options.debug
19290
19295
  };
19296
+ const navUrl = options.serpRedirect ? serpArrivalUrl(searchUrl, process.env.SERP_REDIRECT_BASE?.trim() || MAPS_REDIRECT_BASE) : searchUrl;
19291
19297
  try {
19292
19298
  await this.driver.launch(config);
19293
19299
  const page = this.driver.getPage();
19294
- await page.goto(searchUrl, { waitUntil: "domcontentloaded", timeout: 6e4 });
19300
+ await page.goto(navUrl, { waitUntil: "domcontentloaded", timeout: 6e4 });
19295
19301
  await page.waitForTimeout(LOCAL_RESULTS_WAIT_MS);
19296
19302
  if (await this.detectBlock(page)) throw new CaptchaError(RECAPTCHA_INSTRUCTIONS);
19297
19303
  const reachedFinder = await this.clickIntoLocalFinder(page);
@@ -20164,7 +20170,9 @@ async function runMapsSearchWithRotation(options) {
20164
20170
  ...options,
20165
20171
  proxyZip,
20166
20172
  kernelProxyId: options.proxyMode === "none" ? void 0 : resolution2.kernelProxyId,
20167
- kernelProxyResolution: resolution2.resolution
20173
+ kernelProxyResolution: resolution2.resolution,
20174
+ serpRedirect: options.proxyMode === "none" && attemptIndex >= 1 && attemptIndex < maxAttempts - 1,
20175
+ forceDirectEgress: options.proxyMode === "none" && attemptIndex >= 1
20168
20176
  };
20169
20177
  const isHeadfulEscalation = attemptIndex === maxAttempts - 1;
20170
20178
  const baseCtx = currentCostContext();
@@ -29786,7 +29794,7 @@ var PACKAGE_VERSION;
29786
29794
  var init_version = __esm({
29787
29795
  "src/version.ts"() {
29788
29796
  "use strict";
29789
- PACKAGE_VERSION = "0.32.1";
29797
+ PACKAGE_VERSION = "0.32.2";
29790
29798
  }
29791
29799
  });
29792
29800