@nitpicker/mcp-server 0.15.0 → 0.16.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 +17 -1
- package/lib/tool-definitions.js +41 -1
- package/package.json +3 -3
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, {
|
package/lib/tool-definitions.js
CHANGED
|
@@ -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: {
|
|
@@ -718,4 +718,44 @@ export const toolDefinitions = [
|
|
|
718
718
|
required: ['archiveId'],
|
|
719
719
|
},
|
|
720
720
|
},
|
|
721
|
+
{
|
|
722
|
+
name: 'find_duplicate_clusters',
|
|
723
|
+
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.',
|
|
724
|
+
inputSchema: {
|
|
725
|
+
type: 'object',
|
|
726
|
+
properties: {
|
|
727
|
+
archiveId: {
|
|
728
|
+
type: 'string',
|
|
729
|
+
description: 'The archive ID returned by open_archive',
|
|
730
|
+
},
|
|
731
|
+
minCount: {
|
|
732
|
+
type: 'number',
|
|
733
|
+
description: 'Minimum cluster size to include (default: 10)',
|
|
734
|
+
},
|
|
735
|
+
limit: { type: 'number', description: 'Max clusters (default: 50)' },
|
|
736
|
+
offset: { type: 'number', description: 'Clusters to skip (default: 0)' },
|
|
737
|
+
samplePagesLimit: {
|
|
738
|
+
type: 'number',
|
|
739
|
+
description: 'Max inline sample URLs per cluster (default: 20)',
|
|
740
|
+
},
|
|
741
|
+
},
|
|
742
|
+
required: ['archiveId'],
|
|
743
|
+
},
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
name: 'list_dedupe_cap_events',
|
|
747
|
+
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).',
|
|
748
|
+
inputSchema: {
|
|
749
|
+
type: 'object',
|
|
750
|
+
properties: {
|
|
751
|
+
archiveId: {
|
|
752
|
+
type: 'string',
|
|
753
|
+
description: 'The archive ID returned by open_archive',
|
|
754
|
+
},
|
|
755
|
+
limit: { type: 'number', description: 'Max results (default: 100)' },
|
|
756
|
+
offset: { type: 'number', description: 'Results to skip (default: 0)' },
|
|
757
|
+
},
|
|
758
|
+
required: ['archiveId'],
|
|
759
|
+
},
|
|
760
|
+
},
|
|
721
761
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nitpicker/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.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.
|
|
35
|
+
"@nitpicker/query": "0.16.0"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "bef8b6d48e3ca5167fee643d6aba8644a065df4a"
|
|
38
38
|
}
|