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
@@ -9,7 +9,7 @@ import {
9
9
  } from "../chunk-F44RBOJ5.js";
10
10
  import {
11
11
  PACKAGE_VERSION
12
- } from "../chunk-ROCXJOVY.js";
12
+ } from "../chunk-2CQXHSWC.js";
13
13
 
14
14
  // src/cli/human-cli.ts
15
15
  import { Command } from "commander";
@@ -108,6 +108,9 @@ var HttpMcpToolExecutor = class {
108
108
  facebookAdTranscribe(input) {
109
109
  return this.call("/facebook/transcribe", input);
110
110
  }
111
+ facebookVideoTranscribe(input) {
112
+ return this.call("/facebook/video-transcribe", input, this.httpTimeoutOverrideMs ?? 24e4);
113
+ }
111
114
  mapsPlaceIntel(input) {
112
115
  return this.call("/maps/place", input);
113
116
  }
@@ -138,7 +141,7 @@ var import_node_os2 = require("os");
138
141
  var import_node_path2 = require("path");
139
142
 
140
143
  // src/version.ts
141
- var PACKAGE_VERSION = "0.2.14";
144
+ var PACKAGE_VERSION = "0.2.15";
142
145
 
143
146
  // src/mcp/browser-agent-tool-schemas.ts
144
147
  var import_zod = require("zod");
@@ -1918,6 +1921,62 @@ ${chunkRows}` : "",
1918
1921
  ].filter(Boolean).join("\n");
1919
1922
  return oneBlock(full);
1920
1923
  }
1924
+ function formatFacebookVideoTranscribe(raw, input) {
1925
+ const parsed = parseData(raw);
1926
+ if ("error" in parsed) return { content: [{ type: "text", text: parsed.error }], isError: true };
1927
+ const d = parsed.data;
1928
+ const text = d.text ?? "";
1929
+ const chunks = d.chunks ?? [];
1930
+ const wordCount = text.trim() ? text.trim().split(/\s+/).length : 0;
1931
+ const durSec = d.durationMs ? (d.durationMs / 1e3).toFixed(0) : "\u2014";
1932
+ const videoDuration = typeof d.videoDurationSec === "number" ? `${Math.round(d.videoDurationSec)}s` : "\u2014";
1933
+ const label = d.videoId ? `Facebook Organic Video \`${d.videoId}\`` : "Facebook Organic Video";
1934
+ const chunkRows = chunks.slice(0, 50).map((c) => {
1935
+ const sec = Number.isFinite(c.timestamp[0]) ? Math.floor(c.timestamp[0]) : 0;
1936
+ const mm = String(Math.floor(sec / 60)).padStart(2, "0");
1937
+ const ss = String(sec % 60).padStart(2, "0");
1938
+ return `| ${mm}:${ss} | ${cell(truncate(c.text, 120))} |`;
1939
+ }).join("\n");
1940
+ const full = [
1941
+ `# ${label} Transcript`,
1942
+ d.ownerName ? `**Owner:** ${d.ownerName}` : "",
1943
+ `**Video duration:** ${videoDuration} \xB7 **Transcribed in:** ${durSec}s \xB7 **${wordCount} words**`,
1944
+ d.pageUrl ? `**Page URL:** ${d.pageUrl}` : `**Page URL:** ${input.url}`,
1945
+ d.videoUrl ? `**Extracted MP4:** \`${d.videoUrl}\`` : "",
1946
+ `
1947
+ ## Full Transcript
1948
+ ${text}`,
1949
+ chunks.length ? `
1950
+ ## Timestamped Chunks
1951
+ | Time | Text |
1952
+ |------|------|
1953
+ ${chunkRows}` : "",
1954
+ `
1955
+ ---
1956
+ \u{1F4A1} To download the extracted MP4, call the Facebook media endpoint with the extracted MP4 URL.`
1957
+ ].filter(Boolean).join("\n");
1958
+ return {
1959
+ ...oneBlock(full),
1960
+ structuredContent: {
1961
+ sourceUrl: d.sourceUrl ?? input.url,
1962
+ pageUrl: d.pageUrl ?? input.url,
1963
+ videoId: d.videoId ?? null,
1964
+ ownerName: d.ownerName ?? null,
1965
+ selectedQuality: d.selectedQuality ?? input.quality ?? "best",
1966
+ bitrate: typeof d.bitrate === "number" ? d.bitrate : null,
1967
+ videoDurationSec: typeof d.videoDurationSec === "number" ? d.videoDurationSec : null,
1968
+ videoUrl: d.videoUrl ?? "",
1969
+ wordCount,
1970
+ chunkCount: chunks.length,
1971
+ transcriptText: text,
1972
+ chunks: chunks.map((c) => ({
1973
+ startSec: Number.isFinite(c.timestamp[0]) ? c.timestamp[0] : 0,
1974
+ endSec: Number.isFinite(c.timestamp[1]) ? c.timestamp[1] : 0,
1975
+ text: c.text
1976
+ }))
1977
+ }
1978
+ };
1979
+ }
1921
1980
 
1922
1981
  // src/mcp/mcp-tool-schemas.ts
1923
1982
  var import_zod2 = require("zod");
@@ -1973,6 +2032,10 @@ var FacebookAdSearchInputSchema = {
1973
2032
  var FacebookAdTranscribeInputSchema = {
1974
2033
  videoUrl: import_zod2.z.string().url().describe("Facebook CDN video URL from a facebook_page_intel result")
1975
2034
  };
2035
+ var FacebookVideoTranscribeInputSchema = {
2036
+ url: import_zod2.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."),
2037
+ quality: import_zod2.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.")
2038
+ };
1976
2039
  var MapsPlaceIntelInputSchema = {
1977
2040
  businessName: import_zod2.z.string().min(1).describe('Business name only. If user says "Elite Roofing Denver CO", use businessName="Elite Roofing" and location="Denver, CO".'),
1978
2041
  location: import_zod2.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.'),
@@ -2338,6 +2401,24 @@ var FacebookPageIntelOutputSchema = {
2338
2401
  variations: import_zod2.z.number().int().nullable()
2339
2402
  }))
2340
2403
  };
2404
+ var FacebookVideoTranscribeOutputSchema = {
2405
+ sourceUrl: import_zod2.z.string().url(),
2406
+ pageUrl: import_zod2.z.string().url(),
2407
+ videoId: NullableString,
2408
+ ownerName: NullableString,
2409
+ selectedQuality: import_zod2.z.string(),
2410
+ bitrate: import_zod2.z.number().int().nullable(),
2411
+ videoDurationSec: import_zod2.z.number().nullable(),
2412
+ videoUrl: import_zod2.z.string().url(),
2413
+ wordCount: import_zod2.z.number().int().min(0),
2414
+ chunkCount: import_zod2.z.number().int().min(0),
2415
+ transcriptText: import_zod2.z.string(),
2416
+ chunks: import_zod2.z.array(import_zod2.z.object({
2417
+ startSec: import_zod2.z.number(),
2418
+ endSec: import_zod2.z.number(),
2419
+ text: import_zod2.z.string()
2420
+ }))
2421
+ };
2341
2422
  var CreditsInfoInputSchema = {
2342
2423
  item: import_zod2.z.string().optional().describe('Optional tool, action, or feature to look up, e.g. "maps reviews", "extract_url", "YouTube transcription", or "concurrency"'),
2343
2424
  includeLedger: import_zod2.z.boolean().default(false).describe("Whether to include recent credit ledger entries")
@@ -2832,6 +2913,13 @@ function registerPaaExtractorMcpTools(server2, executor, options = {}) {
2832
2913
  inputSchema: FacebookAdTranscribeInputSchema,
2833
2914
  annotations: liveWebToolAnnotations("Facebook Ad Transcription")
2834
2915
  }, async (input) => formatFacebookAdTranscribe(await executor.facebookAdTranscribe(input), input));
2916
+ server2.registerTool("facebook_video_transcribe", {
2917
+ title: "Facebook Organic Video Transcription",
2918
+ 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."),
2919
+ inputSchema: FacebookVideoTranscribeInputSchema,
2920
+ outputSchema: FacebookVideoTranscribeOutputSchema,
2921
+ annotations: liveWebToolAnnotations("Facebook Organic Video Transcription")
2922
+ }, async (input) => formatFacebookVideoTranscribe(await executor.facebookVideoTranscribe(input), input));
2835
2923
  server2.registerTool("maps_place_intel", {
2836
2924
  title: "Google Maps Business Profile Details",
2837
2925
  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.'),