@nitpicker/mcp-server 0.15.0 → 0.17.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/lib/mcp-server.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
2
2
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
3
  import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
4
- import { ArchiveManager, countPagesByJsonLdType, countPagesByTag, findDuplicateBodies, getDuplicatesFastPath, getHeaderChecksFastPath, getImagesFastPath, getIsolatedClusterFastPath, getMismatchesFastPath, getPageConsoleLogs, getPageDetail, getPageHtml, getPageJsonLd, getPageJsonLdOverview, getPageMainContents, getPageTags, getResourceReferrers, getSummaryFastPath, getTagInventory, getViolations, listConsoleLogs, listInboundLinks, listIsolatedClustersFastPath, listIsolatedPagesFastPath, listLinks, listNetworkOutages, listPages, listPagesByJsonLdType, listPagesByTag, listResources, listUnusedResources, } from '@nitpicker/query';
4
+ import { ArchiveManager, countPagesByJsonLdType, countPagesByTag, findDuplicateBodies, getDuplicatesFastPath, getHeaderChecksFastPath, getImagesFastPath, getIsolatedClusterFastPath, getMismatchesFastPath, getPageConsoleLogs, getPageDetail, getPageHtml, getPageJsonLd, getPageJsonLdOverview, getPageMainContents, getPageTags, getResourceReferrers, getSummaryFastPath, getTagInventory, getViolations, listConsoleLogs, listDedupeCapEvents, listDuplicateBodyClusters, listInboundLinks, listIsolatedClustersFastPath, listIsolatedPagesFastPath, listLinks, listNetworkOutages, listPages, listPagesByJsonLdType, listPagesByTag, listResources, listUnusedResources, } from '@nitpicker/query';
5
5
  import { toolDefinitions } from './tool-definitions.js';
6
6
  /**
7
7
  * Validates that a required string argument is present and returns it.
@@ -274,6 +274,15 @@ export function createServer() {
274
274
  const accessor = manager.get(requireString(args, 'archiveId'));
275
275
  return jsonResult(await findDuplicateBodies(accessor, optionalNumber(args, 'limit'), optionalNumber(args, 'offset')));
276
276
  }
277
+ case 'find_duplicate_clusters': {
278
+ const accessor = manager.get(requireString(args, 'archiveId'));
279
+ return jsonResult(await listDuplicateBodyClusters(accessor, {
280
+ minCount: optionalNumber(args, 'minCount'),
281
+ limit: optionalNumber(args, 'limit'),
282
+ offset: optionalNumber(args, 'offset'),
283
+ samplePagesLimit: optionalNumber(args, 'samplePagesLimit'),
284
+ }));
285
+ }
277
286
  case 'find_mismatches': {
278
287
  const accessor = manager.get(requireString(args, 'archiveId'));
279
288
  const type = validateEnum(requireString(args, 'type'), VALID_MISMATCH_TYPES, 'mismatch type');
@@ -339,6 +348,13 @@ export function createServer() {
339
348
  offset: optionalNumber(args, 'offset'),
340
349
  }));
341
350
  }
351
+ case 'list_dedupe_cap_events': {
352
+ const accessor = manager.get(requireString(args, 'archiveId'));
353
+ return jsonResult(await listDedupeCapEvents(accessor, {
354
+ limit: optionalNumber(args, 'limit'),
355
+ offset: optionalNumber(args, 'offset'),
356
+ }));
357
+ }
342
358
  case 'list_pages_by_tag': {
343
359
  const accessor = manager.get(requireString(args, 'archiveId'));
344
360
  return jsonResult(await listPagesByTag(accessor, {
@@ -34,7 +34,7 @@ export const toolDefinitions = [
34
34
  },
35
35
  {
36
36
  name: 'get_summary',
37
- description: 'Get site-wide overview. Returns: internal/external HTML page counts (`internalPages` / `externalPages`), internal/external content-row counts across every MIME (`internalContents` / `externalContents` — HTML + PDF + Office docs + CSVs + archives + ...), HTTP status distribution, Content-Type distribution over 18 categories (html, pdf, csv, word, excel, powerpoint, image, css, javascript, json+yaml, xml, font, audio, video, archive, text, other, unknown), and metadata fulfillment rates (title, description, OG tags) for internal HTML pages only. `internalContents` is always >= `internalPages` (the latter applies the historical HTML-or-null filter, the former does not). Use this first to understand the archive contents.',
37
+ description: 'Get site-wide overview. Returns: internal/external HTML page counts (`internalPages` / `externalPages`), internal/external content-row counts across every MIME (`internalContents` / `externalContents` — HTML + PDF + Office docs + CSVs + archives + ...), HTTP status distribution, Content-Type distribution over 18 categories (html, pdf, csv, word, excel, powerpoint, image, css, javascript, json+yaml, xml, font, audio, video, archive, text, other, unknown), and metadata fulfillment rates (title, description, OG tags) for internal HTML pages only. Every page/content count and the Content-Type distribution exclude `status = 404` rows (no page exists behind a 404 URL); 404s appear only in the status distribution, split into a plain `404` row (fix-target broken pages) and a trailing `inventorySeed: true` row (`crawl --inventory` input mistakes). The metadata denominator excludes only the inventory-seed 404s. `internalContents` is always >= `internalPages` (the latter applies the historical HTML-or-null filter, the former does not). Use this first to understand the archive contents.',
38
38
  inputSchema: {
39
39
  type: 'object',
40
40
  properties: {
@@ -48,7 +48,7 @@ export const toolDefinitions = [
48
48
  },
49
49
  {
50
50
  name: 'list_pages',
51
- description: 'List pages with rich filtering: by status code (exact or range), missing metadata (title, description), noindex flag, security header presence (CSP / X-Frame-Options / X-Content-Type-Options / HSTS), URL patterns, directory paths. Supports sorting and pagination. Use for questions like "show me all 404 pages", "pages without descriptions", or "internal pages missing CSP". For large sites, set `limit` to keep the response bounded — to dump the whole list use the CLI (`nitpicker query pages`) and pipe through `jq` instead of pulling everything through MCP.',
51
+ description: 'List pages with rich filtering: by status code (exact or range), missing metadata (title, description), noindex flag, security header presence (CSP / X-Frame-Options / X-Content-Type-Options / HSTS), dedupe-cap trap membership, URL patterns, directory paths. Supports sorting and pagination. Use for questions like "show me all 404 pages", "pages without descriptions", "internal pages missing CSP", or "which pages got swept up in a --dedupe-cap trap". For large sites, set `limit` to keep the response bounded — to dump the whole list use the CLI (`nitpicker query pages`) and pipe through `jq` instead of pulling everything through MCP.',
52
52
  inputSchema: {
53
53
  type: 'object',
54
54
  properties: {
@@ -75,6 +75,10 @@ export const toolDefinitions = [
75
75
  description: 'Filter to pages missing description',
76
76
  },
77
77
  noindex: { type: 'boolean', description: 'Filter to pages with noindex set' },
78
+ isDedupeCapped: {
79
+ type: 'boolean',
80
+ description: 'Filter to pages whose URL shape --dedupe-cap captured as a same-cluster crawl trap during crawl (see dedupe_cap_events)',
81
+ },
78
82
  hasCSP: {
79
83
  type: 'boolean',
80
84
  description: 'Filter by Content-Security-Policy header presence',
@@ -138,7 +142,7 @@ export const toolDefinitions = [
138
142
  },
139
143
  {
140
144
  name: 'get_page_detail',
141
- description: "Get full details for a specific page URL: ~47 flat meta fields (title, description, OG, Twitter, robots, link, charset, manifest, themeColor, fb_app_id, verification_google, format_detection, og:image:alt/width/height, og:locale, og:article timestamps, twitter:site/creator, etc.), `metaExtras` JSON (referrer, viewport parsed, httpEquiv, apple, msapplication, verification.{bing|yandex|...}, geo, citation, hreflang alternates, others.*, originTrial), JSON-LD/SpeculationRules **summary** (count + unique @types + parseErrorCount), Wappalyzer tag **summary** (count + provider→ids map), main-content **aggregate counts only** (mainContentSelector, mainContentWordCount/BodyWordCount, mainContentHeadingCount/ImageCount/TableCount/ButtonCount/IframeCount/VideoCount/AudioCount/CanvasCount, scrollHeightDesktop/Mobile — null when the page was never rendered), outbound links, redirect sources, response headers, and within-archive timestamps (firstCrawledAt / lastCrawledAt). Inbound links are NOT included here — a page's referrer count can reach the hundreds of thousands on a large site; use `list_inbound_links` instead. Raw JSON-LD entries, full tag rows, and the main-content child-entity arrays are also NOT included — fetch them via `get_page_jsonld` / `get_page_tags` / `get_page_main_contents`. Use when drilling down into a specific page.",
145
+ description: "Get full details for a specific page URL: ~47 flat meta fields (title, description, OG, Twitter, robots, link, charset, manifest, themeColor, fb_app_id, verification_google, format_detection, og:image:alt/width/height, og:locale, og:article timestamps, twitter:site/creator, etc.), `metaExtras` JSON (referrer, viewport parsed, httpEquiv, apple, msapplication, verification.{bing|yandex|...}, geo, citation, hreflang alternates, others.*, originTrial), JSON-LD/SpeculationRules **summary** (count + unique @types + parseErrorCount), Wappalyzer tag **summary** (count + provider→ids map), main-content **aggregate counts only** (mainContentSelector, mainContentWordCount/BodyWordCount, mainContentHeadingCount/ImageCount/TableCount/ButtonCount/IframeCount/VideoCount/AudioCount/CanvasCount, scrollHeightDesktop/Mobile — null when the page was never rendered), outbound links, redirect sources, response headers, `isDedupeCapped`/`dedupeCapShapeKey` (whether --dedupe-cap captured this page's URL shape as a same-cluster crawl trap, and which shape), and within-archive timestamps (firstCrawledAt / lastCrawledAt). Inbound links are NOT included here — a page's referrer count can reach the hundreds of thousands on a large site; use `list_inbound_links` instead. Raw JSON-LD entries, full tag rows, and the main-content child-entity arrays are also NOT included — fetch them via `get_page_jsonld` / `get_page_tags` / `get_page_main_contents`. Use when drilling down into a specific page.",
142
146
  inputSchema: {
143
147
  type: 'object',
144
148
  properties: {
@@ -718,4 +722,44 @@ export const toolDefinitions = [
718
722
  required: ['archiveId'],
719
723
  },
720
724
  },
725
+ {
726
+ name: 'find_duplicate_clusters',
727
+ description: 'Find same-`body_hash` clusters filtered and ranked for "is this a self-generating crawl trap" (a pager/query-parameter loop the crawler kept following, e.g. `/news/date/{n}/`) — the curated counterpart of find_duplicate_bodies. Filters to clusters at or above minCount with a uniform title across every member page, and ranks by ogUrlMismatchRatio (share of members whose og:url points elsewhere, typically the parent listing) then cluster size. Each result includes a bounded samplePages list and a commonDirectories frequency distribution computed from the full member set.',
728
+ inputSchema: {
729
+ type: 'object',
730
+ properties: {
731
+ archiveId: {
732
+ type: 'string',
733
+ description: 'The archive ID returned by open_archive',
734
+ },
735
+ minCount: {
736
+ type: 'number',
737
+ description: 'Minimum cluster size to include (default: 10)',
738
+ },
739
+ limit: { type: 'number', description: 'Max clusters (default: 50)' },
740
+ offset: { type: 'number', description: 'Clusters to skip (default: 0)' },
741
+ samplePagesLimit: {
742
+ type: 'number',
743
+ description: 'Max inline sample URLs per cluster (default: 20)',
744
+ },
745
+ },
746
+ required: ['archiveId'],
747
+ },
748
+ },
749
+ {
750
+ name: 'list_dedupe_cap_events',
751
+ description: 'List recorded same-cluster-cap audit rows: URL shapes (e.g. `example.com/news/date/{n}/`) that the opt-in `--dedupe-cap` crawl flag confirmed as self-generating traps and stopped enqueueing further anchors for. Each row has the shape key, a sample URL, the effective threshold that triggered the cap (after halving for confidence signals), the observed count, when it was detected, and rejected_count (anchors rejected afterward — null if the crawl never reached crawlEnd).',
752
+ inputSchema: {
753
+ type: 'object',
754
+ properties: {
755
+ archiveId: {
756
+ type: 'string',
757
+ description: 'The archive ID returned by open_archive',
758
+ },
759
+ limit: { type: 'number', description: 'Max results (default: 100)' },
760
+ offset: { type: 'number', description: 'Results to skip (default: 0)' },
761
+ },
762
+ required: ['archiveId'],
763
+ },
764
+ },
721
765
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nitpicker/mcp-server",
3
- "version": "0.15.0",
3
+ "version": "0.17.0",
4
4
  "description": "MCP server for querying .nitpicker archive files via AI assistants",
5
5
  "author": "D-ZERO",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@modelcontextprotocol/sdk": "1.29.0",
35
- "@nitpicker/query": "0.15.0"
35
+ "@nitpicker/query": "0.17.0"
36
36
  },
37
- "gitHead": "d1485df6e43375c6a44edfe07a0293fd39d7810d"
37
+ "gitHead": "2cdef7cbb4da489270e0f1c9ec2e8166b3d84e91"
38
38
  }