mcp-scraper 0.2.5 → 0.2.6

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.
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  HttpMcpToolExecutor,
4
4
  buildPaaExtractorMcpServer
5
- } from "../chunk-ENI4DM3S.js";
5
+ } from "../chunk-7WB2W6FO.js";
6
6
  import "../chunk-M2S27J6Z.js";
7
- import "../chunk-JDX57SEC.js";
7
+ import "../chunk-T6SIPPOQ.js";
8
8
 
9
9
  // bin/mcp-stdio-server.ts
10
10
  import { readFileSync } from "fs";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-M2S27J6Z.js";
4
4
  import {
5
5
  PACKAGE_VERSION
6
- } from "./chunk-JDX57SEC.js";
6
+ } from "./chunk-T6SIPPOQ.js";
7
7
 
8
8
  // src/harvest-timeout.ts
9
9
  var VERCEL_FUNCTION_MAX_MS = 3e5;
@@ -1048,6 +1048,24 @@ var DirectoryWorkflowInputSchema = {
1048
1048
  proxyZip: z.string().regex(/^\d{5}$/).optional().describe("Optional ZIP override for proxy targeting. Normally omit it so each city can use its Lead Magician ZIP group or city/state location."),
1049
1049
  debug: z.boolean().default(false).describe("Include sanitized browser/proxy diagnostics in each Maps browser session when supported.")
1050
1050
  };
1051
+ var RankTrackerModeSchema = z.enum(["maps", "organic", "ai_overview", "paa"]);
1052
+ var RankTrackerBlueprintInputSchema = {
1053
+ projectName: z.string().min(1).optional().describe("Optional name for the rank tracker project, client, or campaign."),
1054
+ targetDomain: z.string().min(1).optional().describe("Primary domain to track in organic results, AI Overview citations, and PAA sources, e.g. example.com."),
1055
+ targetBusinessName: z.string().min(1).optional().describe("Primary Google Business Profile or brand/business name to match in Maps results. Required for reliable Maps rank tracking."),
1056
+ trackingModes: z.array(RankTrackerModeSchema).min(1).max(4).default(["maps", "organic", "ai_overview", "paa"]).describe("Rank tracker surfaces to build. maps uses directory_workflow/maps_search. organic uses search_serp. ai_overview uses search_serp/harvest_paa. paa uses harvest_paa source presence."),
1057
+ keywords: z.array(z.string().min(1)).max(200).default([]).describe("Seed keywords or service queries to track. Leave empty when the downstream AI should create the keyword table from user input."),
1058
+ locations: z.array(z.string().min(1)).max(100).default([]).describe("Markets, cities, ZIPs, or service areas to track. Use city/state strings like Denver, CO for localized SERP and Maps checks."),
1059
+ competitors: z.array(z.string().min(1)).max(100).default([]).describe("Optional competitor domains or business names to persist as comparison targets."),
1060
+ database: z.enum(["postgres", "neon", "supabase", "sqlite", "mysql"]).default("postgres").describe("Database family the downstream AI should target when generating migrations."),
1061
+ scheduleCadence: z.enum(["daily", "weekly", "monthly", "custom"]).default("weekly").describe("Default recurring rank check cadence for the generated cron/heartbeat plan."),
1062
+ customCron: z.string().min(1).optional().describe("Cron expression to use when scheduleCadence is custom."),
1063
+ timezone: z.string().min(1).default("UTC").describe("IANA timezone for scheduled rank checks, e.g. America/Denver."),
1064
+ includeCron: z.boolean().default(true).describe("Include a cron or heartbeat worker plan. Keep true for production rank trackers."),
1065
+ includeDashboard: z.boolean().default(true).describe("Include dashboard/reporting requirements in the generated prompt."),
1066
+ includeAlerts: z.boolean().default(true).describe("Include alert rules for rank movement and SERP feature gains/losses."),
1067
+ notes: z.string().max(4e3).optional().describe("Extra product, client, stack, or hosting requirements to include in the implementation prompt.")
1068
+ };
1051
1069
  var NullableString = z.string().nullable();
1052
1070
  var MapsSearchOutputSchema = {
1053
1071
  query: z.string(),
@@ -1123,6 +1141,39 @@ var DirectoryWorkflowOutputSchema = {
1123
1141
  })),
1124
1142
  durationMs: z.number().int().min(0)
1125
1143
  };
1144
+ var RankTrackerToolPlanOutput = z.object({
1145
+ tool: z.string(),
1146
+ purpose: z.string()
1147
+ });
1148
+ var RankTrackerTableOutput = z.object({
1149
+ name: z.string(),
1150
+ purpose: z.string(),
1151
+ keyColumns: z.array(z.string())
1152
+ });
1153
+ var RankTrackerCronJobOutput = z.object({
1154
+ name: z.string(),
1155
+ purpose: z.string(),
1156
+ modes: z.array(RankTrackerModeSchema),
1157
+ recommendedTools: z.array(z.string())
1158
+ });
1159
+ var RankTrackerBlueprintOutputSchema = {
1160
+ projectName: z.string(),
1161
+ targetDomain: NullableString,
1162
+ targetBusinessName: NullableString,
1163
+ trackingModes: z.array(RankTrackerModeSchema),
1164
+ database: z.string(),
1165
+ recommendedTools: z.array(RankTrackerToolPlanOutput),
1166
+ tables: z.array(RankTrackerTableOutput),
1167
+ cron: z.object({
1168
+ enabled: z.boolean(),
1169
+ cadence: z.string(),
1170
+ expression: z.string(),
1171
+ timezone: z.string(),
1172
+ jobs: z.array(RankTrackerCronJobOutput)
1173
+ }),
1174
+ metrics: z.array(z.string()),
1175
+ implementationPrompt: z.string()
1176
+ };
1126
1177
  var OrganicResultOutput = z.object({
1127
1178
  position: z.number().int(),
1128
1179
  title: z.string(),
@@ -1337,6 +1388,329 @@ var CaptureSerpPageSnapshotsInputSchema = {
1337
1388
  debug: z.boolean().default(false).describe("Include sanitized browser/proxy diagnostics for page snapshot debugging. Use true for capture, network, or proxy troubleshooting.")
1338
1389
  };
1339
1390
 
1391
+ // src/mcp/rank-tracker-blueprint.ts
1392
+ var DEFAULT_MODES = ["maps", "organic", "ai_overview", "paa"];
1393
+ function normalizeDomain(value) {
1394
+ const trimmed = value?.trim();
1395
+ if (!trimmed) return null;
1396
+ try {
1397
+ const url = new URL(trimmed.includes("://") ? trimmed : `https://${trimmed}`);
1398
+ return url.hostname.replace(/^www\./, "").toLowerCase();
1399
+ } catch {
1400
+ return trimmed.replace(/^https?:\/\//, "").replace(/^www\./, "").split("/")[0]?.toLowerCase() || trimmed;
1401
+ }
1402
+ }
1403
+ function uniqueModes(input) {
1404
+ const modes = input?.length ? input : DEFAULT_MODES;
1405
+ return [...new Set(modes)];
1406
+ }
1407
+ function cronExpression(cadence, customCron) {
1408
+ if (cadence === "daily") return "15 6 * * *";
1409
+ if (cadence === "monthly") return "15 6 1 * *";
1410
+ if (cadence === "custom") return customCron?.trim() || "CUSTOM_CRON_EXPRESSION_REQUIRED";
1411
+ return "15 6 * * 1";
1412
+ }
1413
+ function includes(modes, mode) {
1414
+ return modes.includes(mode);
1415
+ }
1416
+ function buildToolPlan(modes) {
1417
+ const plans = [];
1418
+ const push = (tool, purpose) => {
1419
+ if (!plans.some((plan) => plan.tool === tool)) plans.push({ tool, purpose });
1420
+ };
1421
+ push("credits_info", "Check account balance and rates before scheduling recurring rank checks.");
1422
+ if (includes(modes, "maps")) {
1423
+ push("directory_workflow", "Seed or refresh city-by-city Maps datasets when building local market coverage.");
1424
+ push("maps_search", "Run recurring Google Maps category checks for each keyword and location.");
1425
+ push("maps_place_intel", "Hydrate selected target or competitor GBP details when profile-level evidence is needed.");
1426
+ }
1427
+ if (includes(modes, "organic")) {
1428
+ push("search_serp", "Capture localized organic rankings, local pack data, and AI Overview status without PAA expansion.");
1429
+ }
1430
+ if (includes(modes, "ai_overview")) {
1431
+ push("search_serp", "Capture quick AI Overview detection and organic context for each tracked query.");
1432
+ push("harvest_paa", "Use when AI Overview text, PAA context, or source-level evidence needs deeper capture.");
1433
+ }
1434
+ if (includes(modes, "paa")) {
1435
+ push("harvest_paa", "Capture People Also Ask questions, answers, and source sites for PAA presence tracking.");
1436
+ }
1437
+ return plans;
1438
+ }
1439
+ function buildTables(modes, includeDashboard, includeAlerts, hasCompetitors) {
1440
+ const tables = [
1441
+ {
1442
+ name: "rank_tracker_projects",
1443
+ purpose: "One row per client, campaign, or tracked property.",
1444
+ keyColumns: ["id", "name", "target_domain", "target_business_name", "database_mode", "timezone", "created_at"]
1445
+ },
1446
+ {
1447
+ name: "rank_tracker_targets",
1448
+ purpose: "Normalized target identities and match rules for domains, URLs, business names, CIDs, and competitors.",
1449
+ keyColumns: ["id", "project_id", "kind", "value", "display_name", "match_rules_json", "active"]
1450
+ },
1451
+ {
1452
+ name: "rank_tracker_keywords",
1453
+ purpose: "Tracked keywords or service queries, separated from location so calls can localize correctly.",
1454
+ keyColumns: ["id", "project_id", "keyword", "intent", "tags_json", "active"]
1455
+ },
1456
+ {
1457
+ name: "rank_tracker_locations",
1458
+ purpose: "Markets, cities, ZIPs, country/language settings, and proxy targeting hints.",
1459
+ keyColumns: ["id", "project_id", "label", "gl", "hl", "proxy_zip", "device", "active"]
1460
+ },
1461
+ {
1462
+ name: "rank_tracker_runs",
1463
+ purpose: "Heartbeat table for every scheduled or manual rank check batch.",
1464
+ keyColumns: ["id", "project_id", "scheduled_for", "started_at", "completed_at", "status", "idempotency_key", "error_message"]
1465
+ }
1466
+ ];
1467
+ if (includes(modes, "organic")) {
1468
+ tables.push({
1469
+ name: "rank_tracker_organic_results",
1470
+ purpose: "SERP organic result rows from search_serp, including target-domain matches and competitor rows.",
1471
+ keyColumns: ["id", "run_id", "keyword_id", "location_id", "device", "position", "title", "url", "domain", "is_target"]
1472
+ });
1473
+ }
1474
+ if (includes(modes, "maps")) {
1475
+ tables.push({
1476
+ name: "rank_tracker_maps_results",
1477
+ purpose: "Google Maps result rows from maps_search and directory_workflow, including GBP identity fields.",
1478
+ keyColumns: ["id", "run_id", "keyword_id", "location_id", "position", "business_name", "place_url", "cid", "website_url", "rating", "review_count", "is_target"]
1479
+ });
1480
+ tables.push({
1481
+ name: "rank_tracker_market_seeds",
1482
+ purpose: "Directory workflow city, population, ZIP-group, and market seed records used to build local tracking coverage.",
1483
+ keyColumns: ["id", "project_id", "query", "city", "state", "population", "zip_group_json", "last_seeded_run_id"]
1484
+ });
1485
+ }
1486
+ if (includes(modes, "ai_overview")) {
1487
+ tables.push({
1488
+ name: "rank_tracker_ai_overviews",
1489
+ purpose: "AI Overview detection, text snapshot, citation domains, and target citation status per query/location.",
1490
+ keyColumns: ["id", "run_id", "keyword_id", "location_id", "detected", "target_cited", "cited_domains_json", "overview_text"]
1491
+ });
1492
+ }
1493
+ if (includes(modes, "paa")) {
1494
+ tables.push({
1495
+ name: "rank_tracker_paa_sources",
1496
+ purpose: "People Also Ask questions, answers, and source sites, with target source presence flags.",
1497
+ keyColumns: ["id", "run_id", "keyword_id", "location_id", "question", "answer", "source_title", "source_site", "target_present"]
1498
+ });
1499
+ }
1500
+ if (hasCompetitors) {
1501
+ tables.push({
1502
+ name: "rank_tracker_competitor_snapshots",
1503
+ purpose: "Per-run competitor visibility summaries across organic, Maps, AI Overview, and PAA surfaces.",
1504
+ keyColumns: ["id", "run_id", "target_id", "surface", "best_position", "presence_count", "share_of_surface"]
1505
+ });
1506
+ }
1507
+ if (includeDashboard) {
1508
+ tables.push({
1509
+ name: "rank_tracker_daily_metrics",
1510
+ purpose: "Rollup table for dashboard charts, trend lines, and share-of-visibility summaries.",
1511
+ keyColumns: ["id", "project_id", "metric_date", "keyword_id", "location_id", "surface", "metric_name", "metric_value"]
1512
+ });
1513
+ }
1514
+ if (includeAlerts) {
1515
+ tables.push({
1516
+ name: "rank_tracker_alert_events",
1517
+ purpose: "Deduplicated gain/loss events for rank movement, Maps top 3, AI Overview citations, and PAA source presence.",
1518
+ keyColumns: ["id", "project_id", "run_id", "surface", "severity", "event_key", "message", "created_at", "acknowledged_at"]
1519
+ });
1520
+ }
1521
+ return tables;
1522
+ }
1523
+ function buildCronJobs(modes, includeDashboard, includeAlerts) {
1524
+ const jobs = [
1525
+ {
1526
+ name: "rank-tracker-dispatch",
1527
+ purpose: "Find due keyword/location/mode combinations, create a rank_tracker_runs row, and enqueue idempotent work items.",
1528
+ modes,
1529
+ recommendedTools: ["credits_info"]
1530
+ }
1531
+ ];
1532
+ if (includes(modes, "maps")) {
1533
+ jobs.push({
1534
+ name: "maps-rank-check",
1535
+ purpose: "Run maps_search per keyword/location and optionally directory_workflow for market seed refreshes.",
1536
+ modes: ["maps"],
1537
+ recommendedTools: ["maps_search", "directory_workflow", "maps_place_intel"]
1538
+ });
1539
+ }
1540
+ if (includes(modes, "organic") || includes(modes, "ai_overview")) {
1541
+ jobs.push({
1542
+ name: "serp-rank-check",
1543
+ purpose: "Run search_serp per keyword/location/device and persist organic ranks, local pack, and AI Overview status.",
1544
+ modes: modes.filter((mode) => mode === "organic" || mode === "ai_overview"),
1545
+ recommendedTools: ["search_serp"]
1546
+ });
1547
+ }
1548
+ if (includes(modes, "paa") || includes(modes, "ai_overview")) {
1549
+ jobs.push({
1550
+ name: "paa-ai-evidence-check",
1551
+ purpose: "Run harvest_paa for PAA source presence and deeper AI Overview/PAA evidence where needed.",
1552
+ modes: modes.filter((mode) => mode === "paa" || mode === "ai_overview"),
1553
+ recommendedTools: ["harvest_paa"]
1554
+ });
1555
+ }
1556
+ if (includeDashboard) {
1557
+ jobs.push({
1558
+ name: "rank-tracker-rollups",
1559
+ purpose: "Aggregate raw rows into daily metrics for charts, comparison tables, and trend lines.",
1560
+ modes,
1561
+ recommendedTools: []
1562
+ });
1563
+ }
1564
+ if (includeAlerts) {
1565
+ jobs.push({
1566
+ name: "rank-tracker-alerts",
1567
+ purpose: "Compare latest run against prior snapshots and emit deduplicated visibility gain/loss events.",
1568
+ modes,
1569
+ recommendedTools: []
1570
+ });
1571
+ }
1572
+ return jobs;
1573
+ }
1574
+ function buildMetrics(modes, includeDashboard, includeAlerts) {
1575
+ const metrics = ["run_success_rate", "last_successful_run_at", "stale_keyword_location_count"];
1576
+ if (includes(modes, "maps")) {
1577
+ metrics.push("maps_best_position", "maps_top_3_presence", "maps_target_found", "maps_competitor_count_above_target");
1578
+ }
1579
+ if (includes(modes, "organic")) {
1580
+ metrics.push("organic_best_position", "organic_top_3_presence", "organic_top_10_presence", "organic_best_url");
1581
+ }
1582
+ if (includes(modes, "ai_overview")) {
1583
+ metrics.push("ai_overview_detected", "target_ai_overview_cited", "ai_overview_citation_domain_count");
1584
+ }
1585
+ if (includes(modes, "paa")) {
1586
+ metrics.push("paa_question_count", "target_paa_source_count", "paa_presence_rate", "paa_source_domains");
1587
+ }
1588
+ if (includeDashboard) metrics.push("share_of_visibility", "position_delta_7d", "position_delta_30d");
1589
+ if (includeAlerts) metrics.push("visibility_gain_events", "visibility_loss_events");
1590
+ return metrics;
1591
+ }
1592
+ function listOrPlaceholder(values, fallback) {
1593
+ const clean = values?.map((value) => value.trim()).filter(Boolean) ?? [];
1594
+ if (!clean.length) return fallback;
1595
+ return clean.map((value) => `- ${value}`).join("\n");
1596
+ }
1597
+ function buildPrompt(input, modes, tools, tables, jobs, metrics, expression, targetDomain, targetBusinessName) {
1598
+ const keywords = listOrPlaceholder(input.keywords, "- TODO: add tracked keywords");
1599
+ const locations = listOrPlaceholder(input.locations, "- TODO: add tracked markets/locations");
1600
+ const competitors = listOrPlaceholder(input.competitors, "- Optional: add competitor domains or GBP names");
1601
+ const notes = input.notes?.trim() || "No extra implementation notes.";
1602
+ return [
1603
+ "You are building a production rank tracker powered by MCP Scraper. Create the database migrations, scheduled worker, ingestion functions, and dashboard/query layer described below.",
1604
+ "",
1605
+ `Project: ${input.projectName || "MCP Scraper Rank Tracker"}`,
1606
+ `Target domain: ${targetDomain || "TODO_TARGET_DOMAIN"}`,
1607
+ `Target business/GBP name: ${targetBusinessName || "TODO_TARGET_BUSINESS_NAME"}`,
1608
+ `Database target: ${input.database || "postgres"}`,
1609
+ `Tracking modes: ${modes.join(", ")}`,
1610
+ "",
1611
+ "Seed keywords:",
1612
+ keywords,
1613
+ "",
1614
+ "Seed locations:",
1615
+ locations,
1616
+ "",
1617
+ "Competitors:",
1618
+ competitors,
1619
+ "",
1620
+ "MCP Scraper calls to use:",
1621
+ tools.map((tool) => `- ${tool.tool}: ${tool.purpose}`).join("\n"),
1622
+ "",
1623
+ "Database tables to create:",
1624
+ tables.map((table) => `- ${table.name}: ${table.keyColumns.join(", ")}`).join("\n"),
1625
+ "",
1626
+ "Scheduler and heartbeat requirements:",
1627
+ `- Use cron expression "${expression}" in timezone "${input.timezone || "UTC"}" unless the user changes cadence.`,
1628
+ "- Every scheduled batch must insert or update rank_tracker_runs before calling MCP tools.",
1629
+ "- Use idempotency_key = project_id + keyword_id + location_id + mode + device + scheduled_date.",
1630
+ "- Mark runs as running, succeeded, failed, or skipped; persist error_message on failures.",
1631
+ "- Run MCP calls sequentially by default because accounts have one concurrency slot unless the user bought more.",
1632
+ "- Retry retryable upstream failures with backoff, but do not duplicate rows for the same idempotency key.",
1633
+ "",
1634
+ "Mode-specific ingestion rules:",
1635
+ "- maps: Use directory_workflow to seed/refresh market coverage and maps_search for recurring keyword/location rank checks. Match the target by targetBusinessName, website domain, CID, and place URL when available.",
1636
+ "- organic: Use search_serp and persist every organic result row. Compute the best targetDomain position and best ranking URL per keyword/location/device.",
1637
+ "- ai_overview: Use search_serp for quick detection and harvest_paa when deeper text/source evidence is needed. Track detected, overview_text, cited domains, and whether targetDomain is cited.",
1638
+ "- paa: Use harvest_paa and persist each question/source pair. Track whether sourceSite or answer/source evidence matches targetDomain, then compute PAA presence rate.",
1639
+ "",
1640
+ "Metrics to expose:",
1641
+ metrics.map((metric) => `- ${metric}`).join("\n"),
1642
+ "",
1643
+ "Alert requirements:",
1644
+ input.includeAlerts ? "- Emit deduplicated alert_events when target gains/loses Maps top 3, organic top 10, AI Overview citation, or PAA source presence." : "- Alerts are out of scope for this build unless the user asks for them.",
1645
+ "",
1646
+ "Dashboard requirements:",
1647
+ input.includeDashboard ? "- Build views for latest position by keyword/location, trend deltas, competitors above target, AI Overview citations, and PAA source wins/losses." : "- Dashboard is out of scope for this build unless the user asks for it.",
1648
+ "",
1649
+ "Extra notes:",
1650
+ notes
1651
+ ].join("\n");
1652
+ }
1653
+ function buildRankTrackerBlueprint(input) {
1654
+ const trackingModes = uniqueModes(input.trackingModes);
1655
+ const targetDomain = normalizeDomain(input.targetDomain);
1656
+ const targetBusinessName = input.targetBusinessName?.trim() || null;
1657
+ const projectName = input.projectName?.trim() || "MCP Scraper Rank Tracker";
1658
+ const database = input.database || "postgres";
1659
+ const expression = cronExpression(input.scheduleCadence || "weekly", input.customCron);
1660
+ const tools = buildToolPlan(trackingModes);
1661
+ const tables = buildTables(trackingModes, input.includeDashboard !== false, input.includeAlerts !== false, Boolean(input.competitors?.length));
1662
+ const jobs = input.includeCron === false ? [] : buildCronJobs(trackingModes, input.includeDashboard !== false, input.includeAlerts !== false);
1663
+ const metrics = buildMetrics(trackingModes, input.includeDashboard !== false, input.includeAlerts !== false);
1664
+ const implementationPrompt = buildPrompt(input, trackingModes, tools, tables, jobs, metrics, expression, targetDomain, targetBusinessName);
1665
+ const blueprint = {
1666
+ projectName,
1667
+ targetDomain,
1668
+ targetBusinessName,
1669
+ trackingModes,
1670
+ database,
1671
+ recommendedTools: tools,
1672
+ tables,
1673
+ cron: {
1674
+ enabled: input.includeCron !== false,
1675
+ cadence: input.scheduleCadence || "weekly",
1676
+ expression: input.includeCron === false ? "disabled" : expression,
1677
+ timezone: input.timezone || "UTC",
1678
+ jobs
1679
+ },
1680
+ metrics,
1681
+ implementationPrompt
1682
+ };
1683
+ const text = [
1684
+ `# ${projectName}`,
1685
+ "",
1686
+ "Rank tracker build blueprint generated from MCP Scraper tool capabilities.",
1687
+ "",
1688
+ "## Modes",
1689
+ trackingModes.map((mode) => `- ${mode}`).join("\n"),
1690
+ "",
1691
+ "## Recommended MCP Tools",
1692
+ tools.map((tool) => `- \`${tool.tool}\` - ${tool.purpose}`).join("\n"),
1693
+ "",
1694
+ "## Database Tables",
1695
+ tables.map((table) => `- \`${table.name}\` - ${table.purpose}`).join("\n"),
1696
+ "",
1697
+ "## Cron / Heartbeat",
1698
+ blueprint.cron.enabled ? `- Cadence: ${blueprint.cron.cadence}
1699
+ - Cron: \`${blueprint.cron.expression}\`
1700
+ - Timezone: ${blueprint.cron.timezone}
1701
+ - Jobs: ${jobs.map((job) => job.name).join(", ")}` : "- Disabled by input. Still create rank_tracker_runs for manual runs.",
1702
+ "",
1703
+ "## Implementation Prompt",
1704
+ "```text",
1705
+ implementationPrompt,
1706
+ "```"
1707
+ ].join("\n");
1708
+ return {
1709
+ content: [{ type: "text", text }],
1710
+ structuredContent: blueprint
1711
+ };
1712
+ }
1713
+
1340
1714
  // src/mcp/paa-mcp-server.ts
1341
1715
  function liveWebToolAnnotations(title) {
1342
1716
  return {
@@ -1347,6 +1721,15 @@ function liveWebToolAnnotations(title) {
1347
1721
  openWorldHint: true
1348
1722
  };
1349
1723
  }
1724
+ function localPlanningToolAnnotations(title) {
1725
+ return {
1726
+ title,
1727
+ readOnlyHint: true,
1728
+ destructiveHint: false,
1729
+ idempotentHint: true,
1730
+ openWorldHint: false
1731
+ };
1732
+ }
1350
1733
  function listSavedReports() {
1351
1734
  try {
1352
1735
  const dir = outputBaseDir();
@@ -1480,6 +1863,13 @@ function registerPaaExtractorMcpTools(server, executor, options = {}) {
1480
1863
  outputSchema: DirectoryWorkflowOutputSchema,
1481
1864
  annotations: liveWebToolAnnotations("Directory Workflow: Markets + Maps")
1482
1865
  }, async (input) => formatDirectoryWorkflow(await executor.directoryWorkflow(input), input));
1866
+ server.registerTool("rank_tracker_blueprint", {
1867
+ title: "Rank Tracker Blueprint Builder",
1868
+ description: "Generate a build-ready database, cron/heartbeat, ingestion, metrics, and AI implementation prompt for a rank tracker powered by MCP Scraper. Supports Maps rankings through directory_workflow/maps_search, organic rankings through search_serp, AI Overview citation tracking, and People Also Ask source presence tracking. This tool is local planning only; it does not call the web or spend credits.",
1869
+ inputSchema: RankTrackerBlueprintInputSchema,
1870
+ outputSchema: RankTrackerBlueprintOutputSchema,
1871
+ annotations: localPlanningToolAnnotations("Rank Tracker Blueprint Builder")
1872
+ }, async (input) => buildRankTrackerBlueprint(input));
1483
1873
  server.registerTool("credits_info", {
1484
1874
  title: "MCP Scraper Credits & Costs",
1485
1875
  description: "Answer questions about MCP Scraper credits: current credit balance, what a specific tool/action costs, the full cost table, and optionally recent credit ledger entries. Does not expose payment methods or credit card information.",
@@ -1615,4 +2005,4 @@ export {
1615
2005
  registerPaaExtractorMcpTools,
1616
2006
  HttpMcpToolExecutor
1617
2007
  };
1618
- //# sourceMappingURL=chunk-ENI4DM3S.js.map
2008
+ //# sourceMappingURL=chunk-7WB2W6FO.js.map