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.
Files changed (90) hide show
  1. package/README.md +9 -9
  2. package/dist/bin/api-server.cjs +25071 -19082
  3. package/dist/bin/api-server.cjs.map +1 -1
  4. package/dist/bin/api-server.js +3 -3
  5. package/dist/bin/mcp-scraper-cli.cjs +51 -7
  6. package/dist/bin/mcp-scraper-cli.cjs.map +1 -1
  7. package/dist/bin/mcp-scraper-cli.js +48 -5
  8. package/dist/bin/mcp-scraper-cli.js.map +1 -1
  9. package/dist/bin/mcp-scraper-install.cjs +2 -2
  10. package/dist/bin/mcp-scraper-install.cjs.map +1 -1
  11. package/dist/bin/mcp-scraper-install.js +2 -2
  12. package/dist/bin/mcp-stdio-server.cjs +995 -222
  13. package/dist/bin/mcp-stdio-server.cjs.map +1 -1
  14. package/dist/bin/mcp-stdio-server.js +8 -8
  15. package/dist/bin/paa-harvest.cjs +125 -70
  16. package/dist/bin/paa-harvest.cjs.map +1 -1
  17. package/dist/bin/paa-harvest.js +4 -4
  18. package/dist/chunk-345BQXZH.js +712 -0
  19. package/dist/chunk-345BQXZH.js.map +1 -0
  20. package/dist/chunk-3LWYPAU5.js +7 -0
  21. package/dist/chunk-3LWYPAU5.js.map +1 -0
  22. package/dist/{chunk-M2S27J6Z.js → chunk-44HZLHDV.js} +10 -1
  23. package/dist/chunk-44HZLHDV.js.map +1 -0
  24. package/dist/{chunk-62DQAWPF.js → chunk-CSCD2HNS.js} +498 -43
  25. package/dist/chunk-CSCD2HNS.js.map +1 -0
  26. package/dist/{chunk-ZID3WQID.js → chunk-FQI5PFE7.js} +9 -71
  27. package/dist/chunk-FQI5PFE7.js.map +1 -0
  28. package/dist/{chunk-3HBPKR5G.js → chunk-FSAXLDB3.js} +3 -3
  29. package/dist/chunk-G3P3ZDB4.js +69 -0
  30. package/dist/chunk-G3P3ZDB4.js.map +1 -0
  31. package/dist/{chunk-YRGSEY5L.js → chunk-G7KAVJ3F.js} +2 -2
  32. package/dist/{chunk-YRGSEY5L.js.map → chunk-G7KAVJ3F.js.map} +1 -1
  33. package/dist/{chunk-NPMW5HUS.js → chunk-JK2FRDAP.js} +930 -244
  34. package/dist/chunk-JK2FRDAP.js.map +1 -0
  35. package/dist/{chunk-XVVNKASZ.js → chunk-LOPKN3YL.js} +118 -73
  36. package/dist/chunk-LOPKN3YL.js.map +1 -0
  37. package/dist/{chunk-4ZB3X6BQ.js → chunk-MA5JBAUZ.js} +16 -2
  38. package/dist/{chunk-4ZB3X6BQ.js.map → chunk-MA5JBAUZ.js.map} +1 -1
  39. package/dist/chunk-PUJFYJXB.js +684 -0
  40. package/dist/chunk-PUJFYJXB.js.map +1 -0
  41. package/dist/{chunk-BWXLTWF7.js → chunk-PWPUKR5U.js} +9 -5
  42. package/dist/chunk-PWPUKR5U.js.map +1 -0
  43. package/dist/chunk-Q35WZJJK.js +499 -0
  44. package/dist/chunk-Q35WZJJK.js.map +1 -0
  45. package/dist/chunk-QZXKQB7Y.js +414 -0
  46. package/dist/chunk-QZXKQB7Y.js.map +1 -0
  47. package/dist/{db-YAI5AQOI.js → db-N3YECFWR.js} +12 -2
  48. package/dist/{extract-bundle-ONWZVV55.js → extract-bundle-346R6MXD.js} +284 -98
  49. package/dist/extract-bundle-346R6MXD.js.map +1 -0
  50. package/dist/index.cjs +129 -70
  51. package/dist/index.cjs.map +1 -1
  52. package/dist/index.d.cts +11 -0
  53. package/dist/index.d.ts +11 -0
  54. package/dist/index.js +4 -4
  55. package/dist/location-data-repository-O2VII3ON.js +35 -0
  56. package/dist/{server-GKUTC73B.js → server-QKDDEBVQ.js} +7325 -3762
  57. package/dist/server-QKDDEBVQ.js.map +1 -0
  58. package/dist/site-extract-repository-I3VM6WXN.js +62 -0
  59. package/dist/site-extract-repository-I3VM6WXN.js.map +1 -0
  60. package/dist/{worker-645BZPEK.js → worker-TTFXPPDK.js} +7 -7
  61. package/docs/hosted-location-data.md +108 -0
  62. package/docs/mcp-tool-craft-lint.generated.md +6 -3
  63. package/docs/mcp-tool-manifest.generated.json +1447 -240
  64. package/docs/mcp-tool-quality-spec.md +1 -1
  65. package/docs/specs/connected-services-control-plane-decoupling-spec.md +1044 -0
  66. package/docs/specs/kernel-stealth-captcha-test-matrix.md +278 -0
  67. package/docs/specs/multimodal-image-memory-architecture-spec.md +1022 -0
  68. package/docs/specs/unified-credit-and-scheduled-execution-billing-spec.md +36 -27
  69. package/package.json +7 -6
  70. package/dist/chunk-62DQAWPF.js.map +0 -1
  71. package/dist/chunk-BWXLTWF7.js.map +0 -1
  72. package/dist/chunk-M2S27J6Z.js.map +0 -1
  73. package/dist/chunk-NPMW5HUS.js.map +0 -1
  74. package/dist/chunk-R7EETU7Z.js +0 -419
  75. package/dist/chunk-R7EETU7Z.js.map +0 -1
  76. package/dist/chunk-U44TPRST.js +0 -130
  77. package/dist/chunk-U44TPRST.js.map +0 -1
  78. package/dist/chunk-XVVNKASZ.js.map +0 -1
  79. package/dist/chunk-YR4LJ6AQ.js +0 -7
  80. package/dist/chunk-YR4LJ6AQ.js.map +0 -1
  81. package/dist/chunk-YV2FUEBX.js +0 -851
  82. package/dist/chunk-YV2FUEBX.js.map +0 -1
  83. package/dist/chunk-ZID3WQID.js.map +0 -1
  84. package/dist/extract-bundle-ONWZVV55.js.map +0 -1
  85. package/dist/server-GKUTC73B.js.map +0 -1
  86. package/dist/site-extract-repository-L6BHWVDU.js +0 -30
  87. /package/dist/{chunk-3HBPKR5G.js.map → chunk-FSAXLDB3.js.map} +0 -0
  88. /package/dist/{db-YAI5AQOI.js.map → db-N3YECFWR.js.map} +0 -0
  89. /package/dist/{site-extract-repository-L6BHWVDU.js.map → location-data-repository-O2VII3ON.js.map} +0 -0
  90. /package/dist/{worker-645BZPEK.js.map → worker-TTFXPPDK.js.map} +0 -0
@@ -0,0 +1,62 @@
1
+ import {
2
+ abandonExtractSettlement,
3
+ claimFailedExtractJobForRefinalize,
4
+ completeExtractJob,
5
+ countSuccessfulPages,
6
+ createExtractJob,
7
+ createOrGetExtractJob,
8
+ extractJobLimitInfo,
9
+ failExtractJob,
10
+ failStaleRunningExtractJob,
11
+ failUnfundedExtractJob,
12
+ finishExtractJob,
13
+ getExtractJob,
14
+ getExtractJobByIdempotencyKey,
15
+ getExtractedImageLinks,
16
+ getExtractedPages,
17
+ getExtractedUrls,
18
+ listExtractJobs,
19
+ listFundedPendingExtractJobs,
20
+ listStaleRunningExtractJobs,
21
+ listUnsettledExtractJobs,
22
+ markExtractJobDispatchAttempt,
23
+ recordExtractJobDispatchFailure,
24
+ recordExtractSettlementFailure,
25
+ saveExtractPages,
26
+ setExtractJobTotal,
27
+ settleExtractJob,
28
+ terminalExtractJobStatus
29
+ } from "./chunk-Q35WZJJK.js";
30
+ import "./chunk-PWPUKR5U.js";
31
+ import "./chunk-44HZLHDV.js";
32
+ import "./chunk-CSCD2HNS.js";
33
+ export {
34
+ abandonExtractSettlement,
35
+ claimFailedExtractJobForRefinalize,
36
+ completeExtractJob,
37
+ countSuccessfulPages,
38
+ createExtractJob,
39
+ createOrGetExtractJob,
40
+ extractJobLimitInfo,
41
+ failExtractJob,
42
+ failStaleRunningExtractJob,
43
+ failUnfundedExtractJob,
44
+ finishExtractJob,
45
+ getExtractJob,
46
+ getExtractJobByIdempotencyKey,
47
+ getExtractedImageLinks,
48
+ getExtractedPages,
49
+ getExtractedUrls,
50
+ listExtractJobs,
51
+ listFundedPendingExtractJobs,
52
+ listStaleRunningExtractJobs,
53
+ listUnsettledExtractJobs,
54
+ markExtractJobDispatchAttempt,
55
+ recordExtractJobDispatchFailure,
56
+ recordExtractSettlementFailure,
57
+ saveExtractPages,
58
+ setExtractJobTotal,
59
+ settleExtractJob,
60
+ terminalExtractJobStatus
61
+ };
62
+ //# sourceMappingURL=site-extract-repository-I3VM6WXN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -3,21 +3,21 @@ import {
3
3
  createHarvestAttemptRecorder,
4
4
  harvestProblemResponse,
5
5
  serializeHarvestProblem
6
- } from "./chunk-3HBPKR5G.js";
6
+ } from "./chunk-FSAXLDB3.js";
7
7
  import {
8
8
  harvest
9
- } from "./chunk-XVVNKASZ.js";
9
+ } from "./chunk-LOPKN3YL.js";
10
10
  import {
11
11
  browserServiceApiKey,
12
12
  runWithCostContext
13
- } from "./chunk-4ZB3X6BQ.js";
13
+ } from "./chunk-MA5JBAUZ.js";
14
14
  import "./chunk-K443GQY5.js";
15
15
  import "./chunk-CB5C3BPB.js";
16
16
  import {
17
17
  MC_COSTS,
18
18
  serpActualCostMc
19
- } from "./chunk-BWXLTWF7.js";
20
- import "./chunk-M2S27J6Z.js";
19
+ } from "./chunk-PWPUKR5U.js";
20
+ import "./chunk-44HZLHDV.js";
21
21
  import {
22
22
  claimPendingJob,
23
23
  completeJob,
@@ -25,7 +25,7 @@ import {
25
25
  debitMc,
26
26
  failJob,
27
27
  listHarvestAttempts
28
- } from "./chunk-62DQAWPF.js";
28
+ } from "./chunk-CSCD2HNS.js";
29
29
 
30
30
  // src/api/webhook.ts
31
31
  async function deliverWebhook(url, payload, retries = 3) {
@@ -139,4 +139,4 @@ export {
139
139
  startWorker,
140
140
  tickOnce
141
141
  };
142
- //# sourceMappingURL=worker-645BZPEK.js.map
142
+ //# sourceMappingURL=worker-TTFXPPDK.js.map
@@ -0,0 +1,108 @@
1
+ # Hosted location data
2
+
3
+ Production directory workflows and `location_markets` read versioned location snapshots from Turso. They do not read a server-local CSV and do not call Census during a customer request.
4
+
5
+ Two datasets are active independently:
6
+
7
+ - `us_census_places:<STATE>` stores every Census place and its 2020–2025 population estimates for one state.
8
+ - `us_zip_groups` stores normalized city ZIP and county groups for all imported states.
9
+
10
+ Each import receives an immutable dataset ID. An active pointer is switched only after every normalized row is durable, so readers see either the old complete version or the new complete version. Responses include both active dataset IDs, source URLs, and refresh timestamps.
11
+
12
+ ## Required environment
13
+
14
+ ```dotenv
15
+ TURSO_DATABASE_URL=...
16
+ TURSO_AUTH_TOKEN=...
17
+ MCP_SCRAPER_LOCATION_ADMIN_KEY=...
18
+ ```
19
+
20
+ `MCP_SCRAPER_USZIPS_CSV_URL` may hold the default public HTTPS ZIP source. The import endpoint also accepts a source URL explicitly. `MCP_SCRAPER_USZIPS_CSV_PATH` remains available only for local tests and local CLI runs.
21
+
22
+ ZIP imports are fail-closed: a request URL must exactly match `MCP_SCRAPER_USZIPS_CSV_URL` or one entry in `MCP_SCRAPER_LOCATION_IMPORT_SOURCE_ALLOWLIST`. Redirects are rejected, private-network targets are rejected, and response bytes are streamed through a 64 MiB in-flight limit. Census sync does not accept a URL; it constructs the trusted `www2.census.gov` state URL server-side.
23
+
24
+ ## Publish the nationwide GeoNames source
25
+
26
+ The production ZIP/county snapshot is derived from the official GeoNames US postal-code archive at `https://download.geonames.org/export/zip/US.zip`. GeoNames postal-code data is licensed under [Creative Commons Attribution 4.0](https://creativecommons.org/licenses/by/4.0/); retain attribution to [GeoNames](https://www.geonames.org/) anywhere this derived dataset is redistributed.
27
+
28
+ Publish a normalized, immutable public CSV to Vercel Blob:
29
+
30
+ ```bash
31
+ export LOCATION_DATA_READ_WRITE_TOKEN='...'
32
+ npm run locations:publish-geonames
33
+ ```
34
+
35
+ `BLOB_READ_WRITE_TOKEN` is also accepted for projects that use their default
36
+ public Blob store. Production uses a dedicated public store connected with the
37
+ `LOCATION_DATA_` environment-variable prefix so this dataset cannot collide
38
+ with private connected-data artifacts.
39
+
40
+ The publisher downloads the direct HTTPS ZIP without following redirects, applies status, timeout, compressed-size, and extracted-size limits, extracts only `US.txt`, and converts the documented tab-separated fields to `state_abbr,zipcode,county,city`. It then runs the same production CSV parser and nationwide gate used by the import route: all 50 states plus DC and at least 25,000 distinct five-digit ZIPs must be present.
41
+
42
+ The Blob pathname includes the normalized CSV's SHA-256 digest. Random suffixes and overwrites are disabled, so a published URL is an immutable snapshot. The command prints only non-secret counts, hashes, paths, and public URLs; copy its `url` value into `MCP_SCRAPER_USZIPS_CSV_URL`. A repeat publication of byte-identical data intentionally fails instead of replacing the existing content-addressed object.
43
+
44
+ ## Seed and refresh
45
+
46
+ Bootstrap the nationwide ZIP snapshot plus all 50 states and DC in one command:
47
+
48
+ ```bash
49
+ export MCP_SCRAPER_LOCATION_ADMIN_KEY='...'
50
+ export MCP_SCRAPER_USZIPS_CSV_URL='https://...blob.vercel-storage.com/location-data/geonames/us/geonames-us-<sha256>.csv'
51
+ npm run locations:sync
52
+ ```
53
+
54
+ The bootstrap uses three concurrent state requests by default, retries retryable HTTP/network failures up to three times, prints a per-state result and final failed-state list, and exits nonzero if any dataset failed. It never prints the admin key or ZIP source URL. Useful bounded refreshes include:
55
+
56
+ ```bash
57
+ # Refresh only selected Census snapshots and leave the active ZIP version unchanged.
58
+ npm run locations:sync -- --skip-zips --states=TN,CO,CA
59
+
60
+ # Point the operator at a preview API and lower concurrency.
61
+ npm run locations:sync -- --base-url=https://preview.example.com --concurrency=2
62
+ ```
63
+
64
+ The individual admin calls below remain available for targeted recovery.
65
+
66
+ Sync one state's trusted Census snapshot:
67
+
68
+ ```bash
69
+ curl -sS https://mcpscraper.dev/locations/admin/sync-census \
70
+ -H "x-location-admin-key: $MCP_SCRAPER_LOCATION_ADMIN_KEY" \
71
+ -H 'content-type: application/json' \
72
+ --data '{"state":"TN"}'
73
+ ```
74
+
75
+ Import the nationwide ZIP/county CSV from a public HTTPS object:
76
+
77
+ ```bash
78
+ curl -sS https://mcpscraper.dev/locations/admin/import \
79
+ -H "x-location-admin-key: $MCP_SCRAPER_LOCATION_ADMIN_KEY" \
80
+ -H 'content-type: application/json' \
81
+ --data '{"sourceUrl":"https://data.example.com/uszips.csv"}'
82
+ ```
83
+
84
+ The ZIP import accepts the common header aliases `state_abbr|state|state_id`, `zipcode|zip|zip_code`, `city|primary_city`, and `county|county_name`. A replacement must cover all 50 states plus DC and contain at least 25,000 distinct five-digit ZIPs. Unsupported state codes and malformed rows are counted as rejected rows in the dataset record. A partial or undersized snapshot is rejected without changing the active pointer. Re-importing byte-identical active data is idempotent.
85
+
86
+ Census imports verify that every place row's `STATE` FIPS matches the requested state before activation. `/locations/status` reports missing population states, required state count, ZIP coverage, rejected rows, and readiness; `available` becomes true only when all 51 population snapshots and a nationwide ZIP snapshot are active.
87
+
88
+ ## Read and verify
89
+
90
+ Dataset readiness requires an API key:
91
+
92
+ ```bash
93
+ curl -sS https://mcpscraper.dev/locations/status \
94
+ -H "x-api-key: $MCP_SCRAPER_API_KEY"
95
+ ```
96
+
97
+ Query hosted markets directly:
98
+
99
+ ```bash
100
+ curl -sS 'https://mcpscraper.dev/locations/markets?state=TN&populationYear=2025&minPopulation=100000&maxResults=25&includeZipGroups=true' \
101
+ -H "x-api-key: $MCP_SCRAPER_API_KEY"
102
+ ```
103
+
104
+ The same read is exposed to agents as `location_markets`. Filters are applied against the hosted population and ZIP rows before the population-sorted result limit. If a required state snapshot or ZIP snapshot has not been activated, the API returns a typed `503` instead of silently falling back to a local path or a live Census fetch.
105
+
106
+ ## Operational follow-up
107
+
108
+ The active-pointer design prevents partial data from becoming visible and preserves old dataset rows for rollback. A future maintenance pass should add an explicit cross-process import lease, an admin rollback/history endpoint, and retention cleanup for superseded snapshot rows. These do not weaken current read isolation or coverage gates, but they will make concurrent operator refreshes and long-term storage management more ergonomic.
@@ -1,9 +1,9 @@
1
1
  # MCP Tool Craft Lint
2
2
 
3
- Generated: 2026-07-26T13:48:25.492Z
4
- Manifest: `/Users/vilovieta/.codex/worktrees/mcp-scraper-query-fanout-transport-fix/docs/mcp-tool-manifest.generated.json`
3
+ Generated: 2026-07-28T15:41:51.205Z
4
+ Manifest: `/private/tmp/mcp-scraper-zoom-transcript/docs/mcp-tool-manifest.generated.json`
5
5
 
6
- Tools: 167
6
+ Tools: 170
7
7
  Checks per tool: 7
8
8
  Failing tools: 0
9
9
 
@@ -68,6 +68,7 @@ Failing tools: 0
68
68
  | `describe_service_connection_tool` | 7/7 | none |
69
69
  | `diff_page` | 7/7 | none |
70
70
  | `directory_workflow` | 7/7 | none |
71
+ | `directory_workflow_status` | 7/7 | none |
71
72
  | `export_connected_service_data` | 7/7 | none |
72
73
  | `export_search_console_table_data` | 7/7 | none |
73
74
  | `extract_site` | 7/7 | none |
@@ -103,7 +104,9 @@ Failing tools: 0
103
104
  | `list-shared-with-me` | 7/7 | none |
104
105
  | `list-vaults` | 7/7 | none |
105
106
  | `list-webhooks` | 7/7 | none |
107
+ | `location_markets` | 7/7 | none |
106
108
  | `map_site_urls` | 7/7 | none |
109
+ | `map_wayback_snapshots` | 7/7 | none |
107
110
  | `maps_place_intel` | 7/7 | none |
108
111
  | `maps_search` | 7/7 | none |
109
112
  | `memory-backlinks` | 7/7 | none |