mcp-scraper 0.35.1 → 0.37.0
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 +9 -9
- package/dist/bin/api-server.cjs +25071 -19082
- package/dist/bin/api-server.cjs.map +1 -1
- package/dist/bin/api-server.js +3 -3
- package/dist/bin/mcp-scraper-cli.cjs +51 -7
- package/dist/bin/mcp-scraper-cli.cjs.map +1 -1
- package/dist/bin/mcp-scraper-cli.js +48 -5
- package/dist/bin/mcp-scraper-cli.js.map +1 -1
- package/dist/bin/mcp-scraper-install.cjs +2 -2
- package/dist/bin/mcp-scraper-install.cjs.map +1 -1
- package/dist/bin/mcp-scraper-install.js +2 -2
- package/dist/bin/mcp-stdio-server.cjs +995 -222
- package/dist/bin/mcp-stdio-server.cjs.map +1 -1
- package/dist/bin/mcp-stdio-server.js +8 -8
- package/dist/bin/paa-harvest.cjs +125 -70
- package/dist/bin/paa-harvest.cjs.map +1 -1
- package/dist/bin/paa-harvest.js +4 -4
- package/dist/chunk-345BQXZH.js +712 -0
- package/dist/chunk-345BQXZH.js.map +1 -0
- package/dist/chunk-3LWYPAU5.js +7 -0
- package/dist/chunk-3LWYPAU5.js.map +1 -0
- package/dist/{chunk-M2S27J6Z.js → chunk-44HZLHDV.js} +10 -1
- package/dist/chunk-44HZLHDV.js.map +1 -0
- package/dist/{chunk-62DQAWPF.js → chunk-CSCD2HNS.js} +498 -43
- package/dist/chunk-CSCD2HNS.js.map +1 -0
- package/dist/{chunk-ZID3WQID.js → chunk-FQI5PFE7.js} +9 -71
- package/dist/chunk-FQI5PFE7.js.map +1 -0
- package/dist/{chunk-3HBPKR5G.js → chunk-FSAXLDB3.js} +3 -3
- package/dist/chunk-G3P3ZDB4.js +69 -0
- package/dist/chunk-G3P3ZDB4.js.map +1 -0
- package/dist/{chunk-YRGSEY5L.js → chunk-G7KAVJ3F.js} +2 -2
- package/dist/{chunk-YRGSEY5L.js.map → chunk-G7KAVJ3F.js.map} +1 -1
- package/dist/{chunk-NPMW5HUS.js → chunk-JK2FRDAP.js} +930 -244
- package/dist/chunk-JK2FRDAP.js.map +1 -0
- package/dist/{chunk-XVVNKASZ.js → chunk-LOPKN3YL.js} +118 -73
- package/dist/chunk-LOPKN3YL.js.map +1 -0
- package/dist/{chunk-4ZB3X6BQ.js → chunk-MA5JBAUZ.js} +16 -2
- package/dist/{chunk-4ZB3X6BQ.js.map → chunk-MA5JBAUZ.js.map} +1 -1
- package/dist/chunk-PUJFYJXB.js +684 -0
- package/dist/chunk-PUJFYJXB.js.map +1 -0
- package/dist/{chunk-BWXLTWF7.js → chunk-PWPUKR5U.js} +9 -5
- package/dist/chunk-PWPUKR5U.js.map +1 -0
- package/dist/chunk-Q35WZJJK.js +499 -0
- package/dist/chunk-Q35WZJJK.js.map +1 -0
- package/dist/chunk-QZXKQB7Y.js +414 -0
- package/dist/chunk-QZXKQB7Y.js.map +1 -0
- package/dist/{db-YAI5AQOI.js → db-N3YECFWR.js} +12 -2
- package/dist/{extract-bundle-ONWZVV55.js → extract-bundle-346R6MXD.js} +284 -98
- package/dist/extract-bundle-346R6MXD.js.map +1 -0
- package/dist/index.cjs +129 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +4 -4
- package/dist/location-data-repository-O2VII3ON.js +35 -0
- package/dist/{server-GKUTC73B.js → server-QKDDEBVQ.js} +7325 -3762
- package/dist/server-QKDDEBVQ.js.map +1 -0
- package/dist/site-extract-repository-I3VM6WXN.js +62 -0
- package/dist/site-extract-repository-I3VM6WXN.js.map +1 -0
- package/dist/{worker-645BZPEK.js → worker-TTFXPPDK.js} +7 -7
- package/docs/hosted-location-data.md +108 -0
- package/docs/mcp-tool-craft-lint.generated.md +6 -3
- package/docs/mcp-tool-manifest.generated.json +1447 -240
- package/docs/mcp-tool-quality-spec.md +1 -1
- package/docs/specs/connected-services-control-plane-decoupling-spec.md +1044 -0
- package/docs/specs/kernel-stealth-captcha-test-matrix.md +278 -0
- package/docs/specs/multimodal-image-memory-architecture-spec.md +1022 -0
- package/docs/specs/unified-credit-and-scheduled-execution-billing-spec.md +36 -27
- package/package.json +7 -6
- package/dist/chunk-62DQAWPF.js.map +0 -1
- package/dist/chunk-BWXLTWF7.js.map +0 -1
- package/dist/chunk-M2S27J6Z.js.map +0 -1
- package/dist/chunk-NPMW5HUS.js.map +0 -1
- package/dist/chunk-R7EETU7Z.js +0 -419
- package/dist/chunk-R7EETU7Z.js.map +0 -1
- package/dist/chunk-U44TPRST.js +0 -130
- package/dist/chunk-U44TPRST.js.map +0 -1
- package/dist/chunk-XVVNKASZ.js.map +0 -1
- package/dist/chunk-YR4LJ6AQ.js +0 -7
- package/dist/chunk-YR4LJ6AQ.js.map +0 -1
- package/dist/chunk-YV2FUEBX.js +0 -851
- package/dist/chunk-YV2FUEBX.js.map +0 -1
- package/dist/chunk-ZID3WQID.js.map +0 -1
- package/dist/extract-bundle-ONWZVV55.js.map +0 -1
- package/dist/server-GKUTC73B.js.map +0 -1
- package/dist/site-extract-repository-L6BHWVDU.js +0 -30
- /package/dist/{chunk-3HBPKR5G.js.map → chunk-FSAXLDB3.js.map} +0 -0
- /package/dist/{db-YAI5AQOI.js.map → db-N3YECFWR.js.map} +0 -0
- /package/dist/{site-extract-repository-L6BHWVDU.js.map → location-data-repository-O2VII3ON.js.map} +0 -0
- /package/dist/{worker-645BZPEK.js.map → worker-TTFXPPDK.js.map} +0 -0
package/dist/bin/api-server.js
CHANGED
|
@@ -17,9 +17,9 @@ loadDotEnv();
|
|
|
17
17
|
async function main() {
|
|
18
18
|
const [{ serve }, { app }, { startWorker }, { migrate }] = await Promise.all([
|
|
19
19
|
import("@hono/node-server"),
|
|
20
|
-
import("../server-
|
|
21
|
-
import("../worker-
|
|
22
|
-
import("../db-
|
|
20
|
+
import("../server-QKDDEBVQ.js"),
|
|
21
|
+
import("../worker-TTFXPPDK.js"),
|
|
22
|
+
import("../db-N3YECFWR.js")
|
|
23
23
|
]);
|
|
24
24
|
const PORT = parseInt(process.env.PORT ?? "3001");
|
|
25
25
|
try {
|
|
@@ -8,7 +8,7 @@ var import_promises4 = require("fs/promises");
|
|
|
8
8
|
var import_node_path3 = require("path");
|
|
9
9
|
|
|
10
10
|
// src/version.ts
|
|
11
|
-
var PACKAGE_VERSION = "0.
|
|
11
|
+
var PACKAGE_VERSION = "0.37.0";
|
|
12
12
|
|
|
13
13
|
// src/cli/agent-config.ts
|
|
14
14
|
function apiKeyValue(options) {
|
|
@@ -18,7 +18,7 @@ function packageSpec(options) {
|
|
|
18
18
|
return options.packageSpec?.trim() || "mcp-scraper@latest";
|
|
19
19
|
}
|
|
20
20
|
function combinedNpxArgs(options = {}) {
|
|
21
|
-
return ["-y", "
|
|
21
|
+
return ["-y", "--package", packageSpec(options), "mcp-scraper"];
|
|
22
22
|
}
|
|
23
23
|
function envConfig(options) {
|
|
24
24
|
const env = { MCP_SCRAPER_API_KEY: apiKeyValue(options) };
|
|
@@ -50,6 +50,36 @@ function renderClaudeCommand(options = {}) {
|
|
|
50
50
|
function claudeMcpRemoveArgs() {
|
|
51
51
|
return ["mcp", "remove", "mcp-scraper", "-s", "user"];
|
|
52
52
|
}
|
|
53
|
+
function claudeMcpGetArgs() {
|
|
54
|
+
return ["mcp", "get", "mcp-scraper"];
|
|
55
|
+
}
|
|
56
|
+
function parseClaudeMcpGet(stdout) {
|
|
57
|
+
const command = stdout.match(/^\s*Command:\s*(.+?)\s*$/m)?.[1];
|
|
58
|
+
if (!command) return null;
|
|
59
|
+
const argLine = stdout.match(/^\s*Args:\s*(.*?)\s*$/m)?.[1] ?? "";
|
|
60
|
+
const args = argLine.length ? argLine.split(/\s+/) : [];
|
|
61
|
+
const env = {};
|
|
62
|
+
const envBlock = stdout.split(/^\s*Environment:\s*$/m)[1];
|
|
63
|
+
if (envBlock) {
|
|
64
|
+
for (const line of envBlock.split("\n")) {
|
|
65
|
+
const pair = line.match(/^\s{2,}([A-Za-z_][A-Za-z0-9_]*)=(.*)$/);
|
|
66
|
+
if (!pair) {
|
|
67
|
+
if (line.trim().length && !/^\s{2,}/.test(line)) break;
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
env[pair[1]] = pair[2];
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return { command, args, env };
|
|
74
|
+
}
|
|
75
|
+
function claudeMcpRestoreArgs(snapshot) {
|
|
76
|
+
const args = ["mcp", "add", "mcp-scraper", "--scope", "user"];
|
|
77
|
+
for (const [key, value] of Object.entries(snapshot.env)) {
|
|
78
|
+
args.push("--env", `${key}=${value}`);
|
|
79
|
+
}
|
|
80
|
+
args.push("--", snapshot.command, ...snapshot.args);
|
|
81
|
+
return args;
|
|
82
|
+
}
|
|
53
83
|
function claudeMcpAddArgs(options = {}) {
|
|
54
84
|
const args = ["mcp", "add", "mcp-scraper", "--scope", "user"];
|
|
55
85
|
for (const [key, value] of Object.entries(envConfig(options))) {
|
|
@@ -1011,7 +1041,7 @@ var directoryWorkflowDefinition = {
|
|
|
1011
1041
|
inputSchema: DirectoryWorkflowCliInputSchema,
|
|
1012
1042
|
async run(input, ctx) {
|
|
1013
1043
|
await ctx.artifacts.writeManifest("running", {}, [], []);
|
|
1014
|
-
const result = await ctx.client.post("/directory/run", input, 9e5);
|
|
1044
|
+
const result = await ctx.client.post("/directory/run", { ...input, background: false }, 9e5);
|
|
1015
1045
|
await ctx.artifacts.writeJson("Directory evidence", "evidence.json", result);
|
|
1016
1046
|
const rows = directoryRows(result);
|
|
1017
1047
|
await ctx.artifacts.writeCsv("Directory CSV", "exports/directory.csv", DIRECTORY_CSV_HEADERS, rows);
|
|
@@ -1358,7 +1388,8 @@ var localCompetitiveAuditWorkflowDefinition = {
|
|
|
1358
1388
|
maxResultsPerCity: input.maxResultsPerCity,
|
|
1359
1389
|
concurrency: input.concurrency,
|
|
1360
1390
|
proxyMode: input.proxyMode,
|
|
1361
|
-
saveCsv: true
|
|
1391
|
+
saveCsv: true,
|
|
1392
|
+
background: false
|
|
1362
1393
|
}, 9e5);
|
|
1363
1394
|
await ctx.artifacts.writeJson("Directory raw JSON", "raw/directory-workflow.json", directory);
|
|
1364
1395
|
const baseRows = directoryRows(directory);
|
|
@@ -1850,7 +1881,8 @@ var mapComparisonWorkflowDefinition = {
|
|
|
1850
1881
|
maxResultsPerCity: input.maxResultsPerCity,
|
|
1851
1882
|
concurrency: input.concurrency,
|
|
1852
1883
|
proxyMode: input.proxyMode,
|
|
1853
|
-
saveCsv: true
|
|
1884
|
+
saveCsv: true,
|
|
1885
|
+
background: false
|
|
1854
1886
|
}, 9e5);
|
|
1855
1887
|
rows = directoryRows(directory);
|
|
1856
1888
|
await ctx.artifacts.writeJson("Directory raw JSON", "raw/directory-workflow.json", directory);
|
|
@@ -2471,13 +2503,25 @@ function buildHumanCli() {
|
|
|
2471
2503
|
browserProfileName: opts.browserProfile,
|
|
2472
2504
|
browserProfileSaveChanges: opts.saveBrowserProfileChanges
|
|
2473
2505
|
};
|
|
2506
|
+
const existing = await runLocalCommand("claude", claudeMcpGetArgs());
|
|
2507
|
+
const snapshot = existing.code === 0 ? parseClaudeMcpGet(existing.stdout) : null;
|
|
2474
2508
|
const remove = await runLocalCommand("claude", claudeMcpRemoveArgs());
|
|
2475
2509
|
const add = await runLocalCommand("claude", claudeMcpAddArgs(configOptions));
|
|
2476
2510
|
if (add.code !== 0) {
|
|
2477
2511
|
const reason = maskSecrets([add.stderr, add.stdout].filter(Boolean).join("\n").trim());
|
|
2512
|
+
let rollback;
|
|
2513
|
+
if (remove.code !== 0) {
|
|
2514
|
+
rollback = "No existing entry was removed, so your configuration is unchanged.";
|
|
2515
|
+
} else if (!snapshot) {
|
|
2516
|
+
rollback = "WARNING: the previous mcp-scraper entry was removed and could not be captured for rollback. Re-add it manually.";
|
|
2517
|
+
} else {
|
|
2518
|
+
const restore = await runLocalCommand("claude", claudeMcpRestoreArgs(snapshot));
|
|
2519
|
+
rollback = restore.code === 0 ? "Your previous mcp-scraper entry was restored; nothing was lost." : "WARNING: the previous mcp-scraper entry was removed and could NOT be restored. Re-add it with:\n claude " + claudeMcpRestoreArgs(snapshot).join(" ");
|
|
2520
|
+
}
|
|
2478
2521
|
throw new Error([
|
|
2479
2522
|
"Claude Code MCP registration failed.",
|
|
2480
2523
|
reason || "No error output returned.",
|
|
2524
|
+
rollback,
|
|
2481
2525
|
"Make sure Claude Code is installed and the `claude` command is on PATH."
|
|
2482
2526
|
].join("\n"));
|
|
2483
2527
|
}
|
|
@@ -2487,7 +2531,7 @@ function buildHumanCli() {
|
|
|
2487
2531
|
applied: true,
|
|
2488
2532
|
replacedExisting: remove.code === 0,
|
|
2489
2533
|
command: "npx",
|
|
2490
|
-
args:
|
|
2534
|
+
args: combinedNpxArgs(configOptions),
|
|
2491
2535
|
nextStep: "Fully exit Claude Code, start a new Claude terminal, then run: claude mcp list",
|
|
2492
2536
|
list: maskSecrets([list.stdout, list.stderr].filter(Boolean).join("\n").trim())
|
|
2493
2537
|
};
|
|
@@ -2498,7 +2542,7 @@ function buildHumanCli() {
|
|
|
2498
2542
|
writeOutput([
|
|
2499
2543
|
"Applied Claude Code MCP config: mcp-scraper",
|
|
2500
2544
|
remove.code === 0 ? "Replaced existing mcp-scraper entry." : "No existing mcp-scraper entry found; added a new one.",
|
|
2501
|
-
"Command: npx
|
|
2545
|
+
"Command: npx " + combinedNpxArgs(configOptions).join(" "),
|
|
2502
2546
|
opts.browserProfile ? `Browser profile: ${opts.browserProfile}` : "",
|
|
2503
2547
|
"",
|
|
2504
2548
|
"Next step: fully exit Claude Code, start a new Claude terminal, then run:",
|