@nitpicker/mcp-server 0.13.0 → 0.14.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, getDuplicatesFastPath, getHeaderChecksFastPath, getImagesFastPath, getIsolatedClusterFastPath, getMismatchesFastPath, getPageDetail, getPageHtml, getPageJsonLd, getPageJsonLdOverview, getPageTags, getResourceReferrers, getSummaryFastPath, getTagInventory, getViolations, listIsolatedClustersFastPath, listIsolatedPagesFastPath, listLinks, listPages, listPagesByJsonLdType, listPagesByTag, listResources, listUnusedResources, } from '@nitpicker/query';
4
+ import { ArchiveManager, countPagesByJsonLdType, countPagesByTag, getDuplicatesFastPath, getHeaderChecksFastPath, getImagesFastPath, getIsolatedClusterFastPath, getMismatchesFastPath, getPageDetail, getPageHtml, getPageJsonLd, getPageJsonLdOverview, getPageMainContents, getPageTags, getResourceReferrers, getSummaryFastPath, getTagInventory, getViolations, listIsolatedClustersFastPath, listIsolatedPagesFastPath, listLinks, 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.
@@ -348,6 +348,10 @@ export function createServer() {
348
348
  const accessor = manager.get(requireString(args, 'archiveId'));
349
349
  return jsonResult(await getPageTags(accessor, requireString(args, 'url')));
350
350
  }
351
+ case 'get_page_main_contents': {
352
+ const accessor = manager.get(requireString(args, 'archiveId'));
353
+ return jsonResult(await getPageMainContents(accessor, requireString(args, 'url')));
354
+ }
351
355
  default: {
352
356
  return {
353
357
  content: [{ type: 'text', text: `Unknown tool: ${name}` }],
@@ -138,7 +138,7 @@ export const toolDefinitions = [
138
138
  },
139
139
  {
140
140
  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), outbound/inbound links, redirect sources, response headers, and within-archive timestamps (firstCrawledAt / lastCrawledAt). Raw JSON-LD entries and full tag rows are NOT included — fetch them via `get_page_jsonld` / `get_page_tags`. Use when drilling down into a specific page.',
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/inbound links, redirect sources, response headers, and within-archive timestamps (firstCrawledAt / lastCrawledAt). Raw JSON-LD entries, full tag rows, and the main-content child-entity arrays are NOT included — fetch them via `get_page_jsonld` / `get_page_tags` / `get_page_main_contents`. Use when drilling down into a specific page.',
142
142
  inputSchema: {
143
143
  type: 'object',
144
144
  properties: {
@@ -514,6 +514,21 @@ export const toolDefinitions = [
514
514
  required: ['archiveId', 'url'],
515
515
  },
516
516
  },
517
+ {
518
+ name: 'get_page_main_contents',
519
+ description: 'Returns the detected main-content region for a page: its identity (nodeName, id, classList, role, a diagnostic selector), aggregate counts already available via get_page_detail (wordCount, bodyWordCount, scrollHeight at desktop/mobile), and full drill-down for all 8 child-entity arrays in DOM order - headings (text + level), images (src + alt), tables (rows/cols/hasHeader/hasFooter/hasMergedCell), buttons (nodeName/role/type/text/disabled), iframes (src/title/width/height), videos (src/poster/width/height), audios (src), canvases (width/height). Returns null only when the page was never rendered (external page, failed scrape). When the page was rendered but beholder found no main-content element, returns a full object with `main: null`, empty child arrays, and `wordCount: 0` (bodyWordCount and scrollHeight still reflect the whole document, since those are measured independently of main-region detection). Use after get_page_detail when you need the actual entries, not just the counts.',
520
+ inputSchema: {
521
+ type: 'object',
522
+ properties: {
523
+ archiveId: {
524
+ type: 'string',
525
+ description: 'The archive ID returned by open_archive',
526
+ },
527
+ url: { type: 'string', description: 'The page URL' },
528
+ },
529
+ required: ['archiveId', 'url'],
530
+ },
531
+ },
517
532
  {
518
533
  name: 'check_headers',
519
534
  description: 'Check security HTTP headers (CSP, X-Frame-Options, X-Content-Type-Options, HSTS) for internal pages. Use missingOnly=true to find pages lacking security headers.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nitpicker/mcp-server",
3
- "version": "0.13.0",
3
+ "version": "0.14.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.13.0"
35
+ "@nitpicker/query": "0.14.0"
36
36
  },
37
- "gitHead": "2cd462ea6b183f4462b7caba27b4db04aaba7c70"
37
+ "gitHead": "d6e1894a29aa29ca94785d9db0acfc3acc74764b"
38
38
  }