mcp-scraper 0.2.14 → 0.2.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 (33) hide show
  1. package/README.md +3 -2
  2. package/dist/bin/api-server.cjs +314 -23
  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 +1 -1
  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 +1 -1
  9. package/dist/bin/mcp-scraper-cli.cjs.map +1 -1
  10. package/dist/bin/mcp-scraper-cli.js +1 -1
  11. package/dist/bin/mcp-scraper-combined-stdio-server.cjs +89 -1
  12. package/dist/bin/mcp-scraper-combined-stdio-server.cjs.map +1 -1
  13. package/dist/bin/mcp-scraper-combined-stdio-server.js +3 -3
  14. package/dist/bin/mcp-scraper-install.cjs +3 -3
  15. package/dist/bin/mcp-scraper-install.cjs.map +1 -1
  16. package/dist/bin/mcp-scraper-install.js +3 -3
  17. package/dist/bin/mcp-scraper-install.js.map +1 -1
  18. package/dist/bin/mcp-stdio-server.cjs +89 -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-2CQXHSWC.js +7 -0
  22. package/dist/chunk-2CQXHSWC.js.map +1 -0
  23. package/dist/{chunk-IWQTNY2E.js → chunk-Q4DFONIK.js} +90 -2
  24. package/dist/chunk-Q4DFONIK.js.map +1 -0
  25. package/dist/{chunk-ZV2XXYR7.js → chunk-TIPUIEJN.js} +2 -2
  26. package/dist/{server-7QP6HQJJ.js → server-VD2TD3AD.js} +220 -23
  27. package/dist/server-VD2TD3AD.js.map +1 -0
  28. package/package.json +1 -1
  29. package/dist/chunk-IWQTNY2E.js.map +0 -1
  30. package/dist/chunk-ROCXJOVY.js +0 -7
  31. package/dist/chunk-ROCXJOVY.js.map +0 -1
  32. package/dist/server-7QP6HQJJ.js.map +0 -1
  33. /package/dist/{chunk-ZV2XXYR7.js.map → chunk-TIPUIEJN.js.map} +0 -0
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  HttpMcpToolExecutor,
4
4
  buildPaaExtractorMcpServer
5
- } from "../chunk-IWQTNY2E.js";
5
+ } from "../chunk-Q4DFONIK.js";
6
6
  import "../chunk-M2S27J6Z.js";
7
- import "../chunk-ROCXJOVY.js";
7
+ import "../chunk-2CQXHSWC.js";
8
8
 
9
9
  // bin/mcp-stdio-server.ts
10
10
  import { readFileSync } from "fs";
@@ -0,0 +1,7 @@
1
+ // src/version.ts
2
+ var PACKAGE_VERSION = "0.2.15";
3
+
4
+ export {
5
+ PACKAGE_VERSION
6
+ };
7
+ //# sourceMappingURL=chunk-2CQXHSWC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/version.ts"],"sourcesContent":["export const PACKAGE_VERSION = '0.2.15'\n"],"mappings":";AAAO,IAAM,kBAAkB;","names":[]}
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-M2S27J6Z.js";
4
4
  import {
5
5
  PACKAGE_VERSION
6
- } from "./chunk-ROCXJOVY.js";
6
+ } from "./chunk-2CQXHSWC.js";
7
7
 
8
8
  // src/harvest-timeout.ts
9
9
  var VERCEL_FUNCTION_MAX_MS = 3e5;
@@ -1020,6 +1020,62 @@ ${chunkRows}` : "",
1020
1020
  ].filter(Boolean).join("\n");
1021
1021
  return oneBlock(full);
1022
1022
  }
1023
+ function formatFacebookVideoTranscribe(raw, input) {
1024
+ const parsed = parseData(raw);
1025
+ if ("error" in parsed) return { content: [{ type: "text", text: parsed.error }], isError: true };
1026
+ const d = parsed.data;
1027
+ const text = d.text ?? "";
1028
+ const chunks = d.chunks ?? [];
1029
+ const wordCount = text.trim() ? text.trim().split(/\s+/).length : 0;
1030
+ const durSec = d.durationMs ? (d.durationMs / 1e3).toFixed(0) : "\u2014";
1031
+ const videoDuration = typeof d.videoDurationSec === "number" ? `${Math.round(d.videoDurationSec)}s` : "\u2014";
1032
+ const label = d.videoId ? `Facebook Organic Video \`${d.videoId}\`` : "Facebook Organic Video";
1033
+ const chunkRows = chunks.slice(0, 50).map((c) => {
1034
+ const sec = Number.isFinite(c.timestamp[0]) ? Math.floor(c.timestamp[0]) : 0;
1035
+ const mm = String(Math.floor(sec / 60)).padStart(2, "0");
1036
+ const ss = String(sec % 60).padStart(2, "0");
1037
+ return `| ${mm}:${ss} | ${cell(truncate(c.text, 120))} |`;
1038
+ }).join("\n");
1039
+ const full = [
1040
+ `# ${label} Transcript`,
1041
+ d.ownerName ? `**Owner:** ${d.ownerName}` : "",
1042
+ `**Video duration:** ${videoDuration} \xB7 **Transcribed in:** ${durSec}s \xB7 **${wordCount} words**`,
1043
+ d.pageUrl ? `**Page URL:** ${d.pageUrl}` : `**Page URL:** ${input.url}`,
1044
+ d.videoUrl ? `**Extracted MP4:** \`${d.videoUrl}\`` : "",
1045
+ `
1046
+ ## Full Transcript
1047
+ ${text}`,
1048
+ chunks.length ? `
1049
+ ## Timestamped Chunks
1050
+ | Time | Text |
1051
+ |------|------|
1052
+ ${chunkRows}` : "",
1053
+ `
1054
+ ---
1055
+ \u{1F4A1} To download the extracted MP4, call the Facebook media endpoint with the extracted MP4 URL.`
1056
+ ].filter(Boolean).join("\n");
1057
+ return {
1058
+ ...oneBlock(full),
1059
+ structuredContent: {
1060
+ sourceUrl: d.sourceUrl ?? input.url,
1061
+ pageUrl: d.pageUrl ?? input.url,
1062
+ videoId: d.videoId ?? null,
1063
+ ownerName: d.ownerName ?? null,
1064
+ selectedQuality: d.selectedQuality ?? input.quality ?? "best",
1065
+ bitrate: typeof d.bitrate === "number" ? d.bitrate : null,
1066
+ videoDurationSec: typeof d.videoDurationSec === "number" ? d.videoDurationSec : null,
1067
+ videoUrl: d.videoUrl ?? "",
1068
+ wordCount,
1069
+ chunkCount: chunks.length,
1070
+ transcriptText: text,
1071
+ chunks: chunks.map((c) => ({
1072
+ startSec: Number.isFinite(c.timestamp[0]) ? c.timestamp[0] : 0,
1073
+ endSec: Number.isFinite(c.timestamp[1]) ? c.timestamp[1] : 0,
1074
+ text: c.text
1075
+ }))
1076
+ }
1077
+ };
1078
+ }
1023
1079
 
1024
1080
  // src/mcp/mcp-tool-schemas.ts
1025
1081
  import { z } from "zod";
@@ -1075,6 +1131,10 @@ var FacebookAdSearchInputSchema = {
1075
1131
  var FacebookAdTranscribeInputSchema = {
1076
1132
  videoUrl: z.string().url().describe("Facebook CDN video URL from a facebook_page_intel result")
1077
1133
  };
1134
+ var FacebookVideoTranscribeInputSchema = {
1135
+ url: z.string().url().describe("Organic Facebook reel, video, watch, or share URL. The tool renders the page, extracts the best public Facebook CDN MP4 URL, then transcribes it."),
1136
+ quality: z.enum(["best", "hd", "sd"]).default("best").describe("Preferred progressive MP4 quality. Use best by default; hd prefers the highest HD progressive URL; sd forces the SD URL.")
1137
+ };
1078
1138
  var MapsPlaceIntelInputSchema = {
1079
1139
  businessName: z.string().min(1).describe('Business name only. If user says "Elite Roofing Denver CO", use businessName="Elite Roofing" and location="Denver, CO".'),
1080
1140
  location: z.string().min(1).describe('City/region/country where the business should be searched, e.g. "Denver, CO". Infer from the user request when possible.'),
@@ -1440,6 +1500,24 @@ var FacebookPageIntelOutputSchema = {
1440
1500
  variations: z.number().int().nullable()
1441
1501
  }))
1442
1502
  };
1503
+ var FacebookVideoTranscribeOutputSchema = {
1504
+ sourceUrl: z.string().url(),
1505
+ pageUrl: z.string().url(),
1506
+ videoId: NullableString,
1507
+ ownerName: NullableString,
1508
+ selectedQuality: z.string(),
1509
+ bitrate: z.number().int().nullable(),
1510
+ videoDurationSec: z.number().nullable(),
1511
+ videoUrl: z.string().url(),
1512
+ wordCount: z.number().int().min(0),
1513
+ chunkCount: z.number().int().min(0),
1514
+ transcriptText: z.string(),
1515
+ chunks: z.array(z.object({
1516
+ startSec: z.number(),
1517
+ endSec: z.number(),
1518
+ text: z.string()
1519
+ }))
1520
+ };
1443
1521
  var CreditsInfoInputSchema = {
1444
1522
  item: z.string().optional().describe('Optional tool, action, or feature to look up, e.g. "maps reviews", "extract_url", "YouTube transcription", or "concurrency"'),
1445
1523
  includeLedger: z.boolean().default(false).describe("Whether to include recent credit ledger entries")
@@ -1939,6 +2017,13 @@ function registerPaaExtractorMcpTools(server, executor, options = {}) {
1939
2017
  inputSchema: FacebookAdTranscribeInputSchema,
1940
2018
  annotations: liveWebToolAnnotations("Facebook Ad Transcription")
1941
2019
  }, async (input) => formatFacebookAdTranscribe(await executor.facebookAdTranscribe(input), input));
2020
+ server.registerTool("facebook_video_transcribe", {
2021
+ title: "Facebook Organic Video Transcription",
2022
+ description: withReportNote("Transcribe audio from an organic Facebook reel, video, watch, or share URL. Renders the Facebook page, extracts the best public Facebook CDN MP4 URL from the page state, then returns the full transcript, timestamped chunks, and extracted MP4 URL."),
2023
+ inputSchema: FacebookVideoTranscribeInputSchema,
2024
+ outputSchema: FacebookVideoTranscribeOutputSchema,
2025
+ annotations: liveWebToolAnnotations("Facebook Organic Video Transcription")
2026
+ }, async (input) => formatFacebookVideoTranscribe(await executor.facebookVideoTranscribe(input), input));
1942
2027
  server.registerTool("maps_place_intel", {
1943
2028
  title: "Google Maps Business Profile Details",
1944
2029
  description: withReportNote('Extract Google Maps business intelligence for one known/named business: rating, review count, category, address, phone, website, hours, booking URL, review histogram, review topics, about attributes, entity IDs, and optional review cards. Do not use this for category searches, local market prospect lists, or requests for multiple GMB/GBP profiles; use maps_search first for those. Split business name from location (e.g. "Elite Roofing Denver CO" => businessName "Elite Roofing", location "Denver, CO"). Pass includeReviews true when the user asks for reviews/customer pain.'),
@@ -2068,6 +2153,9 @@ var HttpMcpToolExecutor = class {
2068
2153
  facebookAdTranscribe(input) {
2069
2154
  return this.call("/facebook/transcribe", input);
2070
2155
  }
2156
+ facebookVideoTranscribe(input) {
2157
+ return this.call("/facebook/video-transcribe", input, this.httpTimeoutOverrideMs ?? 24e4);
2158
+ }
2071
2159
  mapsPlaceIntel(input) {
2072
2160
  return this.call("/maps/place", input);
2073
2161
  }
@@ -2102,4 +2190,4 @@ export {
2102
2190
  registerPaaExtractorMcpTools,
2103
2191
  HttpMcpToolExecutor
2104
2192
  };
2105
- //# sourceMappingURL=chunk-IWQTNY2E.js.map
2193
+ //# sourceMappingURL=chunk-Q4DFONIK.js.map