mcp-scraper 0.2.14 → 0.2.16
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.
- package/README.md +6 -5
- package/dist/bin/api-server.cjs +321 -29
- package/dist/bin/api-server.cjs.map +1 -1
- package/dist/bin/api-server.js +1 -1
- package/dist/bin/browser-agent-stdio-server.cjs +1 -1
- package/dist/bin/browser-agent-stdio-server.cjs.map +1 -1
- package/dist/bin/browser-agent-stdio-server.js +2 -2
- package/dist/bin/mcp-scraper-cli.cjs +1 -1
- package/dist/bin/mcp-scraper-cli.cjs.map +1 -1
- package/dist/bin/mcp-scraper-cli.js +1 -1
- package/dist/bin/mcp-scraper-combined-stdio-server.cjs +95 -6
- package/dist/bin/mcp-scraper-combined-stdio-server.cjs.map +1 -1
- package/dist/bin/mcp-scraper-combined-stdio-server.js +3 -3
- package/dist/bin/mcp-scraper-install.cjs +4 -4
- package/dist/bin/mcp-scraper-install.cjs.map +1 -1
- package/dist/bin/mcp-scraper-install.js +4 -4
- package/dist/bin/mcp-scraper-install.js.map +1 -1
- package/dist/bin/mcp-stdio-server.cjs +95 -6
- package/dist/bin/mcp-stdio-server.cjs.map +1 -1
- package/dist/bin/mcp-stdio-server.js +2 -2
- package/dist/{chunk-ZV2XXYR7.js → chunk-ATJAINML.js} +2 -2
- package/dist/{chunk-IWQTNY2E.js → chunk-FMC3V54I.js} +96 -7
- package/dist/chunk-FMC3V54I.js.map +1 -0
- package/dist/chunk-KE4JZDLV.js +7 -0
- package/dist/chunk-KE4JZDLV.js.map +1 -0
- package/dist/{server-7QP6HQJJ.js → server-KSEQLZNP.js} +221 -24
- package/dist/server-KSEQLZNP.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-IWQTNY2E.js.map +0 -1
- package/dist/chunk-ROCXJOVY.js +0 -7
- package/dist/chunk-ROCXJOVY.js.map +0 -1
- package/dist/server-7QP6HQJJ.js.map +0 -1
- /package/dist/{chunk-ZV2XXYR7.js.map → chunk-ATJAINML.js.map} +0 -0
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
HttpMcpToolExecutor,
|
|
4
4
|
buildPaaExtractorMcpServer
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-FMC3V54I.js";
|
|
6
6
|
import "../chunk-M2S27J6Z.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-KE4JZDLV.js";
|
|
8
8
|
|
|
9
9
|
// bin/mcp-stdio-server.ts
|
|
10
10
|
import { readFileSync } from "fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PACKAGE_VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KE4JZDLV.js";
|
|
4
4
|
|
|
5
5
|
// src/mcp/browser-agent-mcp-server.ts
|
|
6
6
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -790,4 +790,4 @@ export {
|
|
|
790
790
|
buildBrowserAgentMcpServer,
|
|
791
791
|
registerBrowserAgentMcpTools
|
|
792
792
|
};
|
|
793
|
-
//# sourceMappingURL=chunk-
|
|
793
|
+
//# sourceMappingURL=chunk-ATJAINML.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-M2S27J6Z.js";
|
|
4
4
|
import {
|
|
5
5
|
PACKAGE_VERSION
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KE4JZDLV.js";
|
|
7
7
|
|
|
8
8
|
// src/harvest-timeout.ts
|
|
9
9
|
var VERCEL_FUNCTION_MAX_MS = 3e5;
|
|
@@ -570,7 +570,8 @@ ${adBlocks}`,
|
|
|
570
570
|
`
|
|
571
571
|
---
|
|
572
572
|
\u{1F4A1} **Tips**
|
|
573
|
-
- Transcribe video ads: use \`facebook_ad_transcribe\` with the \`videoUrl\` above
|
|
573
|
+
- Transcribe video ads: use \`facebook_ad_transcribe\` with the direct \`videoUrl\` above
|
|
574
|
+
- Transcribe organic Facebook reels/posts: use \`facebook_video_transcribe\` with the public Facebook URL
|
|
574
575
|
- Find other advertisers: use \`facebook_ad_search\``
|
|
575
576
|
].filter(Boolean).join("\n");
|
|
576
577
|
return {
|
|
@@ -1016,10 +1017,66 @@ ${text}`,
|
|
|
1016
1017
|
${chunkRows}` : "",
|
|
1017
1018
|
`
|
|
1018
1019
|
---
|
|
1019
|
-
\u{1F4A1} Get more ads from this advertiser: use \`facebook_page_intel
|
|
1020
|
+
\u{1F4A1} Get more ads from this advertiser: use \`facebook_page_intel\`. For public Facebook reel/post URLs, use \`facebook_video_transcribe\`.`
|
|
1020
1021
|
].filter(Boolean).join("\n");
|
|
1021
1022
|
return oneBlock(full);
|
|
1022
1023
|
}
|
|
1024
|
+
function formatFacebookVideoTranscribe(raw, input) {
|
|
1025
|
+
const parsed = parseData(raw);
|
|
1026
|
+
if ("error" in parsed) return { content: [{ type: "text", text: parsed.error }], isError: true };
|
|
1027
|
+
const d = parsed.data;
|
|
1028
|
+
const text = d.text ?? "";
|
|
1029
|
+
const chunks = d.chunks ?? [];
|
|
1030
|
+
const wordCount = text.trim() ? text.trim().split(/\s+/).length : 0;
|
|
1031
|
+
const durSec = d.durationMs ? (d.durationMs / 1e3).toFixed(0) : "\u2014";
|
|
1032
|
+
const videoDuration = typeof d.videoDurationSec === "number" ? `${Math.round(d.videoDurationSec)}s` : "\u2014";
|
|
1033
|
+
const label = d.videoId ? `Facebook Organic Video \`${d.videoId}\`` : "Facebook Organic Video";
|
|
1034
|
+
const chunkRows = chunks.slice(0, 50).map((c) => {
|
|
1035
|
+
const sec = Number.isFinite(c.timestamp[0]) ? Math.floor(c.timestamp[0]) : 0;
|
|
1036
|
+
const mm = String(Math.floor(sec / 60)).padStart(2, "0");
|
|
1037
|
+
const ss = String(sec % 60).padStart(2, "0");
|
|
1038
|
+
return `| ${mm}:${ss} | ${cell(truncate(c.text, 120))} |`;
|
|
1039
|
+
}).join("\n");
|
|
1040
|
+
const full = [
|
|
1041
|
+
`# ${label} Transcript`,
|
|
1042
|
+
d.ownerName ? `**Owner:** ${d.ownerName}` : "",
|
|
1043
|
+
`**Video duration:** ${videoDuration} \xB7 **Transcribed in:** ${durSec}s \xB7 **${wordCount} words**`,
|
|
1044
|
+
d.pageUrl ? `**Page URL:** ${d.pageUrl}` : `**Page URL:** ${input.url}`,
|
|
1045
|
+
d.videoUrl ? `**Extracted MP4:** \`${d.videoUrl}\`` : "",
|
|
1046
|
+
`
|
|
1047
|
+
## Full Transcript
|
|
1048
|
+
${text}`,
|
|
1049
|
+
chunks.length ? `
|
|
1050
|
+
## Timestamped Chunks
|
|
1051
|
+
| Time | Text |
|
|
1052
|
+
|------|------|
|
|
1053
|
+
${chunkRows}` : "",
|
|
1054
|
+
`
|
|
1055
|
+
---
|
|
1056
|
+
\u{1F4A1} Use \`videoUrl\` as the extracted MP4 for download or follow-up processing. Use \`facebook_ad_transcribe\` only for Ad Library videoUrl values.`
|
|
1057
|
+
].filter(Boolean).join("\n");
|
|
1058
|
+
return {
|
|
1059
|
+
...oneBlock(full),
|
|
1060
|
+
structuredContent: {
|
|
1061
|
+
sourceUrl: d.sourceUrl ?? input.url,
|
|
1062
|
+
pageUrl: d.pageUrl ?? input.url,
|
|
1063
|
+
videoId: d.videoId ?? null,
|
|
1064
|
+
ownerName: d.ownerName ?? null,
|
|
1065
|
+
selectedQuality: d.selectedQuality ?? input.quality ?? "best",
|
|
1066
|
+
bitrate: typeof d.bitrate === "number" ? d.bitrate : null,
|
|
1067
|
+
videoDurationSec: typeof d.videoDurationSec === "number" ? d.videoDurationSec : null,
|
|
1068
|
+
videoUrl: d.videoUrl ?? "",
|
|
1069
|
+
wordCount,
|
|
1070
|
+
chunkCount: chunks.length,
|
|
1071
|
+
transcriptText: text,
|
|
1072
|
+
chunks: chunks.map((c) => ({
|
|
1073
|
+
startSec: Number.isFinite(c.timestamp[0]) ? c.timestamp[0] : 0,
|
|
1074
|
+
endSec: Number.isFinite(c.timestamp[1]) ? c.timestamp[1] : 0,
|
|
1075
|
+
text: c.text
|
|
1076
|
+
}))
|
|
1077
|
+
}
|
|
1078
|
+
};
|
|
1079
|
+
}
|
|
1023
1080
|
|
|
1024
1081
|
// src/mcp/mcp-tool-schemas.ts
|
|
1025
1082
|
import { z } from "zod";
|
|
@@ -1073,7 +1130,11 @@ var FacebookAdSearchInputSchema = {
|
|
|
1073
1130
|
maxResults: z.number().int().min(1).max(20).default(10)
|
|
1074
1131
|
};
|
|
1075
1132
|
var FacebookAdTranscribeInputSchema = {
|
|
1076
|
-
videoUrl: z.string().url().describe("Facebook CDN video URL from a facebook_page_intel result")
|
|
1133
|
+
videoUrl: z.string().url().describe("Direct Facebook CDN video URL from a facebook_page_intel ad result. Do not pass a public Facebook reel/post/share URL here; use facebook_video_transcribe for organic Facebook URLs.")
|
|
1134
|
+
};
|
|
1135
|
+
var FacebookVideoTranscribeInputSchema = {
|
|
1136
|
+
url: z.string().url().describe("Organic Facebook reel, video, watch, post, or share URL from facebook.com, m.facebook.com, or fb.watch. The tool renders the page, extracts the best matching public Facebook CDN MP4 URL, then transcribes it. Use this when the user pastes a normal Facebook video page URL and asks for the transcript or downloadable MP4."),
|
|
1137
|
+
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.")
|
|
1077
1138
|
};
|
|
1078
1139
|
var MapsPlaceIntelInputSchema = {
|
|
1079
1140
|
businessName: z.string().min(1).describe('Business name only. If user says "Elite Roofing Denver CO", use businessName="Elite Roofing" and location="Denver, CO".'),
|
|
@@ -1440,6 +1501,24 @@ var FacebookPageIntelOutputSchema = {
|
|
|
1440
1501
|
variations: z.number().int().nullable()
|
|
1441
1502
|
}))
|
|
1442
1503
|
};
|
|
1504
|
+
var FacebookVideoTranscribeOutputSchema = {
|
|
1505
|
+
sourceUrl: z.string().url(),
|
|
1506
|
+
pageUrl: z.string().url(),
|
|
1507
|
+
videoId: NullableString,
|
|
1508
|
+
ownerName: NullableString,
|
|
1509
|
+
selectedQuality: z.string(),
|
|
1510
|
+
bitrate: z.number().int().nullable(),
|
|
1511
|
+
videoDurationSec: z.number().nullable(),
|
|
1512
|
+
videoUrl: z.string().url(),
|
|
1513
|
+
wordCount: z.number().int().min(0),
|
|
1514
|
+
chunkCount: z.number().int().min(0),
|
|
1515
|
+
transcriptText: z.string(),
|
|
1516
|
+
chunks: z.array(z.object({
|
|
1517
|
+
startSec: z.number(),
|
|
1518
|
+
endSec: z.number(),
|
|
1519
|
+
text: z.string()
|
|
1520
|
+
}))
|
|
1521
|
+
};
|
|
1443
1522
|
var CreditsInfoInputSchema = {
|
|
1444
1523
|
item: z.string().optional().describe('Optional tool, action, or feature to look up, e.g. "maps reviews", "extract_url", "YouTube transcription", or "concurrency"'),
|
|
1445
1524
|
includeLedger: z.boolean().default(false).describe("Whether to include recent credit ledger entries")
|
|
@@ -1921,7 +2000,7 @@ function registerPaaExtractorMcpTools(server, executor, options = {}) {
|
|
|
1921
2000
|
}, async (input) => formatYoutubeTranscribe(await executor.youtubeTranscribe(input), input));
|
|
1922
2001
|
server.registerTool("facebook_page_intel", {
|
|
1923
2002
|
title: "Facebook Advertiser Ad Intel",
|
|
1924
|
-
description: withReportNote("Harvest ads from a Facebook advertiser. Returns ad copy, headlines, CTAs, creative type, status, landing URLs, and video URLs ready for
|
|
2003
|
+
description: withReportNote("Harvest ads from a Facebook advertiser. Returns ad copy, headlines, CTAs, creative type, status, landing URLs, and direct ad video URLs ready for facebook_ad_transcribe. Accepts pageId, libraryId, or a brand/advertiser name as query. Use after facebook_ad_search when possible. For normal public Facebook reels/posts/watch/share URLs, use facebook_video_transcribe instead."),
|
|
1925
2004
|
inputSchema: FacebookPageIntelInputSchema,
|
|
1926
2005
|
outputSchema: FacebookPageIntelOutputSchema,
|
|
1927
2006
|
annotations: liveWebToolAnnotations("Facebook Advertiser Ad Intel")
|
|
@@ -1935,10 +2014,17 @@ function registerPaaExtractorMcpTools(server, executor, options = {}) {
|
|
|
1935
2014
|
}, async (input) => formatFacebookAdSearch(await executor.facebookAdSearch(input), input));
|
|
1936
2015
|
server.registerTool("facebook_ad_transcribe", {
|
|
1937
2016
|
title: "Facebook Ad Transcription",
|
|
1938
|
-
description: "Transcribe audio from a Facebook ad video. Returns full transcript and timestamped chunks. Use the videoUrl value from facebook_page_intel results.",
|
|
2017
|
+
description: "Transcribe audio from a Facebook ad video CDN URL. Returns full transcript and timestamped chunks. Use only with the direct videoUrl value from facebook_page_intel results, not public Facebook post/reel/share URLs.",
|
|
1939
2018
|
inputSchema: FacebookAdTranscribeInputSchema,
|
|
1940
2019
|
annotations: liveWebToolAnnotations("Facebook Ad Transcription")
|
|
1941
2020
|
}, async (input) => formatFacebookAdTranscribe(await executor.facebookAdTranscribe(input), input));
|
|
2021
|
+
server.registerTool("facebook_video_transcribe", {
|
|
2022
|
+
title: "Facebook Organic Video Transcription",
|
|
2023
|
+
description: withReportNote("Transcribe audio from an organic Facebook reel, video, watch, post, or share URL, including fb.watch links. Use this when the user pastes a normal Facebook video page URL and wants the transcript or downloadable MP4. Renders the Facebook page in a browser, selects the best matching public Facebook CDN MP4 URL from page state, then returns sourceUrl, resolved pageUrl, videoId, ownerName, selectedQuality, bitrate, videoDurationSec, extracted MP4 URL, full transcript, and timestamped chunks."),
|
|
2024
|
+
inputSchema: FacebookVideoTranscribeInputSchema,
|
|
2025
|
+
outputSchema: FacebookVideoTranscribeOutputSchema,
|
|
2026
|
+
annotations: liveWebToolAnnotations("Facebook Organic Video Transcription")
|
|
2027
|
+
}, async (input) => formatFacebookVideoTranscribe(await executor.facebookVideoTranscribe(input), input));
|
|
1942
2028
|
server.registerTool("maps_place_intel", {
|
|
1943
2029
|
title: "Google Maps Business Profile Details",
|
|
1944
2030
|
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 +2154,9 @@ var HttpMcpToolExecutor = class {
|
|
|
2068
2154
|
facebookAdTranscribe(input) {
|
|
2069
2155
|
return this.call("/facebook/transcribe", input);
|
|
2070
2156
|
}
|
|
2157
|
+
facebookVideoTranscribe(input) {
|
|
2158
|
+
return this.call("/facebook/video-transcribe", input, this.httpTimeoutOverrideMs ?? 24e4);
|
|
2159
|
+
}
|
|
2071
2160
|
mapsPlaceIntel(input) {
|
|
2072
2161
|
return this.call("/maps/place", input);
|
|
2073
2162
|
}
|
|
@@ -2102,4 +2191,4 @@ export {
|
|
|
2102
2191
|
registerPaaExtractorMcpTools,
|
|
2103
2192
|
HttpMcpToolExecutor
|
|
2104
2193
|
};
|
|
2105
|
-
//# sourceMappingURL=chunk-
|
|
2194
|
+
//# sourceMappingURL=chunk-FMC3V54I.js.map
|