mcp-scraper 0.3.10 → 0.3.11
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 +2 -1
- package/dist/bin/api-server.cjs +30 -19
- 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 +9 -5
- 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 +9 -5
- 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 +1 -1
- package/dist/bin/mcp-scraper-install.cjs.map +1 -1
- package/dist/bin/mcp-scraper-install.js +1 -1
- package/dist/bin/mcp-stdio-server.cjs +1 -1
- package/dist/bin/mcp-stdio-server.cjs.map +1 -1
- package/dist/bin/mcp-stdio-server.js +2 -2
- package/dist/{chunk-QPFF3V2R.js → chunk-L27GJQV7.js} +10 -6
- package/dist/chunk-L27GJQV7.js.map +1 -0
- package/dist/chunk-RRE7WVHQ.js +7 -0
- package/dist/chunk-RRE7WVHQ.js.map +1 -0
- package/dist/{chunk-CED7X4WB.js → chunk-VMH7SRWY.js} +2 -2
- package/dist/{server-QTV2EUKA.js → server-3SA5Q4OF.js} +32 -21
- package/dist/{server-QTV2EUKA.js.map → server-3SA5Q4OF.js.map} +1 -1
- package/docs/mcp-tool-craft-lint.generated.md +1 -1
- package/docs/mcp-tool-manifest.generated.json +3 -3
- package/package.json +1 -1
- package/dist/chunk-NEGW2ZEJ.js +0 -7
- package/dist/chunk-NEGW2ZEJ.js.map +0 -1
- package/dist/chunk-QPFF3V2R.js.map +0 -1
- /package/dist/{chunk-CED7X4WB.js.map → chunk-VMH7SRWY.js.map} +0 -0
package/README.md
CHANGED
|
@@ -218,6 +218,7 @@ env = { MCP_SCRAPER_API_KEY = "sk_live_your_key" }
|
|
|
218
218
|
- `browser_replay_download` — download and save the replay MP4 under `MCP_SCRAPER_OUTPUT_DIR/browser-replays`.
|
|
219
219
|
- `browser_replay_mark` — while recording, locate a DOM target and return a replay-timed annotation object.
|
|
220
220
|
- `browser_replay_annotate` — download a replay MP4, render timed boxes, circles, underlines, arrows, and labels using annotation objects from `browser_replay_mark` or exact bounds from `browser_locate`, and save a new annotated MP4 under `MCP_SCRAPER_OUTPUT_DIR/browser-replays`.
|
|
221
|
+
- `browser_capture_fanout` — capture ChatGPT/Claude AI-search fan-out from an open logged-in hosted session. Use `export=true` for durable artifacts. It writes full `fanout.json`, query/source/citation/domain/snippet CSVs, TSV, and `report.html` under `MCP_SCRAPER_OUTPUT_DIR/fanout`, returning paths relative to `MCP_SCRAPER_OUTPUT_DIR` so users can share portable paths.
|
|
221
222
|
- `browser_close`
|
|
222
223
|
- `browser_list_sessions`
|
|
223
224
|
|
|
@@ -247,7 +248,7 @@ The `mcp-scraper` and `mcp-scraper-combined` NPX stdio servers also expose saved
|
|
|
247
248
|
- `BROWSER_AGENT_PROFILE_NAME` is optional and sets the default saved hosted browser profile for `browser-agent` and `mcp-scraper-combined` stdio sessions. Aliases: `BROWSER_SERVICE_PROFILE_NAME`, `KERNEL_BROWSER_PROFILE_NAME`, `KERNEL_PROFILE_NAME`.
|
|
248
249
|
- `BROWSER_AGENT_PROFILE_SAVE_CHANGES=true` is optional hosted setup behavior. It persists cookies and storage back to the named profile when `browser_close` deletes the hosted browser session. Aliases: `BROWSER_SERVICE_PROFILE_SAVE_CHANGES`, `KERNEL_BROWSER_PROFILE_SAVE_CHANGES`, `KERNEL_PROFILE_SAVE_CHANGES`.
|
|
249
250
|
|
|
250
|
-
Every web intelligence tool call made through `mcp-scraper` or `mcp-scraper-combined` saves a full Markdown report to disk by default and returns the file path in the MCP response. The hosted `/mcp` endpoint returns reports inline only and never writes files. Browser replay downloads are saved by `browser_replay_download` under `MCP_SCRAPER_OUTPUT_DIR/browser-replays`.
|
|
251
|
+
Every web intelligence tool call made through `mcp-scraper` or `mcp-scraper-combined` saves a full Markdown report to disk by default and returns the file path in the MCP response. The hosted `/mcp` endpoint returns reports inline only and never writes files. Browser replay downloads are saved by `browser_replay_download` under `MCP_SCRAPER_OUTPUT_DIR/browser-replays`. AI fan-out exports are saved by `browser_capture_fanout` with `export=true` under `MCP_SCRAPER_OUTPUT_DIR/fanout`, and return relative paths.
|
|
251
252
|
|
|
252
253
|
## Updating Existing Installs
|
|
253
254
|
|
package/dist/bin/api-server.cjs
CHANGED
|
@@ -21921,7 +21921,7 @@ var PACKAGE_VERSION;
|
|
|
21921
21921
|
var init_version = __esm({
|
|
21922
21922
|
"src/version.ts"() {
|
|
21923
21923
|
"use strict";
|
|
21924
|
-
PACKAGE_VERSION = "0.3.
|
|
21924
|
+
PACKAGE_VERSION = "0.3.11";
|
|
21925
21925
|
}
|
|
21926
21926
|
});
|
|
21927
21927
|
|
|
@@ -24432,7 +24432,9 @@ function writeTable(path6, rows, delimiter) {
|
|
|
24432
24432
|
}
|
|
24433
24433
|
function exportFanout(enriched) {
|
|
24434
24434
|
const stamp = safe(enriched.capturedAt.replace(/[:.]/g, "-"));
|
|
24435
|
-
const
|
|
24435
|
+
const outputDir = outputBaseDir3();
|
|
24436
|
+
const relativeDir = (0, import_node_path11.join)("fanout", `${stamp}-${safe(enriched.platform)}`);
|
|
24437
|
+
const dir = (0, import_node_path11.join)(outputDir, relativeDir);
|
|
24436
24438
|
(0, import_node_fs8.mkdirSync)(dir, { recursive: true });
|
|
24437
24439
|
const queryRows = enriched.queries.map((q, i) => ({ index: i + 1, query: q }));
|
|
24438
24440
|
const citationRows = enriched.aggregates.citationOrder.map((c) => {
|
|
@@ -24440,25 +24442,32 @@ function exportFanout(enriched) {
|
|
|
24440
24442
|
return { rank: c.rank, domain: c.domain, url: c.url, timesCited: c.timesCited, siteType: src?.siteType ?? "", title: src?.title ?? "" };
|
|
24441
24443
|
});
|
|
24442
24444
|
const sourceRows2 = enriched.browsedUrls.map((s) => ({ domain: s.domain, url: s.url, cited: s.cited, timesCited: s.timesCited, siteType: s.siteType, title: s.title, round: s.round ?? "" }));
|
|
24445
|
+
const browsedOnlyRows = enriched.browsedOnly.map((s) => ({ domain: s.domain, url: s.url, cited: s.cited, timesCited: s.timesCited, siteType: s.siteType, title: s.title, round: s.round ?? "" }));
|
|
24446
|
+
const snippetRows = enriched.snippets.map((s) => ({ domain: s.domain, url: s.url, title: s.title, text: s.text }));
|
|
24443
24447
|
const domainRows = enriched.aggregates.topSites.map((d) => ({ domain: d.domain, count: d.count, cited: d.cited, timesCited: d.timesCited, siteType: d.siteType }));
|
|
24444
|
-
const
|
|
24445
|
-
|
|
24446
|
-
|
|
24447
|
-
|
|
24448
|
-
|
|
24449
|
-
|
|
24450
|
-
|
|
24451
|
-
|
|
24452
|
-
|
|
24448
|
+
const relativePaths = {
|
|
24449
|
+
relativeTo: "MCP_SCRAPER_OUTPUT_DIR or ~/Downloads/mcp-scraper",
|
|
24450
|
+
dir: relativeDir,
|
|
24451
|
+
json: (0, import_node_path11.join)(relativeDir, "fanout.json"),
|
|
24452
|
+
queriesCsv: (0, import_node_path11.join)(relativeDir, "queries.csv"),
|
|
24453
|
+
queriesTsv: (0, import_node_path11.join)(relativeDir, "queries.tsv"),
|
|
24454
|
+
citationsCsv: (0, import_node_path11.join)(relativeDir, "citations.csv"),
|
|
24455
|
+
sourcesCsv: (0, import_node_path11.join)(relativeDir, "sources.csv"),
|
|
24456
|
+
browsedOnlyCsv: (0, import_node_path11.join)(relativeDir, "browsed-only.csv"),
|
|
24457
|
+
snippetsCsv: (0, import_node_path11.join)(relativeDir, "snippets.csv"),
|
|
24458
|
+
domainsCsv: (0, import_node_path11.join)(relativeDir, "domains.csv"),
|
|
24459
|
+
report: (0, import_node_path11.join)(relativeDir, "report.html")
|
|
24453
24460
|
};
|
|
24454
|
-
(0, import_node_fs8.writeFileSync)(
|
|
24455
|
-
writeTable(
|
|
24456
|
-
writeTable(
|
|
24457
|
-
writeTable(
|
|
24458
|
-
writeTable(
|
|
24459
|
-
writeTable(
|
|
24460
|
-
(0,
|
|
24461
|
-
|
|
24461
|
+
(0, import_node_fs8.writeFileSync)((0, import_node_path11.join)(outputDir, relativePaths.json), JSON.stringify(enriched, null, 2));
|
|
24462
|
+
writeTable((0, import_node_path11.join)(outputDir, relativePaths.queriesCsv), queryRows, ",");
|
|
24463
|
+
writeTable((0, import_node_path11.join)(outputDir, relativePaths.queriesTsv), queryRows, " ");
|
|
24464
|
+
writeTable((0, import_node_path11.join)(outputDir, relativePaths.citationsCsv), citationRows, ",");
|
|
24465
|
+
writeTable((0, import_node_path11.join)(outputDir, relativePaths.sourcesCsv), sourceRows2, ",");
|
|
24466
|
+
writeTable((0, import_node_path11.join)(outputDir, relativePaths.browsedOnlyCsv), browsedOnlyRows, ",");
|
|
24467
|
+
writeTable((0, import_node_path11.join)(outputDir, relativePaths.snippetsCsv), snippetRows, ",");
|
|
24468
|
+
writeTable((0, import_node_path11.join)(outputDir, relativePaths.domainsCsv), domainRows, ",");
|
|
24469
|
+
(0, import_node_fs8.writeFileSync)((0, import_node_path11.join)(outputDir, relativePaths.report), renderReportHtml(enriched));
|
|
24470
|
+
return relativePaths;
|
|
24462
24471
|
}
|
|
24463
24472
|
function esc(s) {
|
|
24464
24473
|
return String(s).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
@@ -24575,6 +24584,7 @@ async function runFanoutCapture(page, input) {
|
|
|
24575
24584
|
const cap = new FanoutCdpCapture();
|
|
24576
24585
|
await cap.attach(page);
|
|
24577
24586
|
try {
|
|
24587
|
+
if (input.reset) cap.reset();
|
|
24578
24588
|
const baseline = cap.answerStreamCount();
|
|
24579
24589
|
if (input.prompt) await sendPrompt(page, input.prompt).catch(() => false);
|
|
24580
24590
|
const waitMs = input.wait_ms ?? (input.prompt ? 9e4 : 8e3);
|
|
@@ -25256,6 +25266,7 @@ function buildBrowserAgentRoutes() {
|
|
|
25256
25266
|
prompt: typeof body.prompt === "string" ? body.prompt : void 0,
|
|
25257
25267
|
wait_ms: typeof body.wait_ms === "number" ? body.wait_ms : void 0,
|
|
25258
25268
|
first_party_domain: typeof body.first_party_domain === "string" ? body.first_party_domain : void 0,
|
|
25269
|
+
reset: body.reset === true,
|
|
25259
25270
|
export: body.export === true
|
|
25260
25271
|
};
|
|
25261
25272
|
const t0 = Date.now();
|