@nitpicker/mcp-server 0.12.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/README.md +25 -27
- package/lib/mcp-server.d.ts +17 -1
- package/lib/mcp-server.js +77 -14
- package/lib/tool-definitions.js +74 -5
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,35 +1,12 @@
|
|
|
1
1
|
# @nitpicker/mcp-server
|
|
2
2
|
|
|
3
|
-
`.nitpicker`
|
|
3
|
+
`.nitpicker` アーカイブを Model Context Protocol (MCP) 経由で問い合わせるためのサーバーです。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[Model Context Protocol (MCP)](https://modelcontextprotocol.io/) を介して、`.nitpicker` アーカイブの内容を AI アシスタント(Claude Desktop 等)から直接クエリできるサーバーです。stdio トランスポートで動作し、14 のツールを提供します。
|
|
8
|
-
|
|
9
|
-
内部では `@nitpicker/query` パッケージのクエリ関数を呼び出しています。
|
|
10
|
-
|
|
11
|
-
### 提供ツール
|
|
12
|
-
|
|
13
|
-
| ツール | 説明 |
|
|
14
|
-
| ------------------------ | ---------------------------------------------------- |
|
|
15
|
-
| `open_archive` | `.nitpicker` ファイルを読み込み、archiveId を返す |
|
|
16
|
-
| `close_archive` | アーカイブを閉じてリソースを解放 |
|
|
17
|
-
| `get_summary` | サイト全体の概要統計 |
|
|
18
|
-
| `list_pages` | ページ一覧(フィルタ・ソート・ページネーション対応) |
|
|
19
|
-
| `get_page_detail` | 特定ページの詳細情報 |
|
|
20
|
-
| `get_page_html` | HTML スナップショットの取得 |
|
|
21
|
-
| `list_links` | リンク分析(壊れたリンク、外部リンク、孤立ページ) |
|
|
22
|
-
| `list_resources` | サブリソース一覧(CSS、JS、画像、フォント) |
|
|
23
|
-
| `list_images` | 画像品質チェック(alt 欠落、サイズ欠落、過大画像) |
|
|
24
|
-
| `get_violations` | 分析プラグインの違反結果 |
|
|
25
|
-
| `find_duplicates` | メタデータ重複検出 |
|
|
26
|
-
| `find_mismatches` | メタデータ不一致検出 |
|
|
27
|
-
| `get_resource_referrers` | リソース参照元ページの検出 |
|
|
28
|
-
| `check_headers` | セキュリティヘッダー確認 |
|
|
5
|
+
内部では [@nitpicker/query](../query/README.md) を使い、AIアシスタントなどからアーカイブ内容を参照できるようにします。
|
|
29
6
|
|
|
30
7
|
## セットアップ
|
|
31
8
|
|
|
32
|
-
Claude Desktop
|
|
9
|
+
Claude Desktop の設定ファイルに以下を追加します。
|
|
33
10
|
|
|
34
11
|
```json
|
|
35
12
|
{
|
|
@@ -42,7 +19,28 @@ Claude Desktop の設定ファイルに以下を追加してください。
|
|
|
42
19
|
}
|
|
43
20
|
```
|
|
44
21
|
|
|
45
|
-
|
|
22
|
+
stdio トランスポートで起動し、`.nitpicker` アーカイブを開いてページ、リンク、リソース、分析結果などを問い合わせます。
|
|
23
|
+
|
|
24
|
+
## 主なツール
|
|
25
|
+
|
|
26
|
+
| ツール | 説明 |
|
|
27
|
+
| ----------------- | -------------------------------------------- |
|
|
28
|
+
| `open_archive` | `.nitpicker` ファイルを開き、archiveIdを返す |
|
|
29
|
+
| `close_archive` | アーカイブを閉じる |
|
|
30
|
+
| `get_summary` | サイト全体の概要統計 |
|
|
31
|
+
| `list_pages` | ページ一覧 |
|
|
32
|
+
| `get_page_detail` | 指定ページの詳細 |
|
|
33
|
+
| `get_page_html` | HTMLスナップショット |
|
|
34
|
+
| `list_links` | リンク一覧 |
|
|
35
|
+
| `list_resources` | リソース一覧 |
|
|
36
|
+
| `list_images` | 画像一覧 |
|
|
37
|
+
| `get_violations` | 分析プラグインの違反結果 |
|
|
38
|
+
|
|
39
|
+
## 関連リンク
|
|
40
|
+
|
|
41
|
+
- [Nitpicker README](../../../README.md)
|
|
42
|
+
- [CLI query docs](../cli/docs/query.md)
|
|
43
|
+
- [ARCHITECTURE.md](../../../ARCHITECTURE.md)
|
|
46
44
|
|
|
47
45
|
## ライセンス
|
|
48
46
|
|
package/lib/mcp-server.d.ts
CHANGED
|
@@ -3,7 +3,15 @@ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
|
3
3
|
* Creates and configures the Nitpicker MCP server with all tools registered.
|
|
4
4
|
* Uses the low-level Server API to avoid deep type instantiation issues
|
|
5
5
|
* with McpServer + Zod schemas.
|
|
6
|
-
* @returns The configured Server instance.
|
|
6
|
+
* @returns The configured Server instance. Connect it to a transport to start serving.
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { createServer } from '@nitpicker/mcp-server';
|
|
10
|
+
* import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
11
|
+
*
|
|
12
|
+
* const server = createServer();
|
|
13
|
+
* await server.connect(new StdioServerTransport());
|
|
14
|
+
* ```
|
|
7
15
|
*/
|
|
8
16
|
export declare function createServer(): Server<{
|
|
9
17
|
method: string;
|
|
@@ -42,5 +50,13 @@ export declare function createServer(): Server<{
|
|
|
42
50
|
/**
|
|
43
51
|
* Starts the MCP server using stdio transport.
|
|
44
52
|
* This is the entry point for the `nitpicker-mcp` binary.
|
|
53
|
+
* @returns Resolves once the stdio transport is connected; the server then
|
|
54
|
+
* keeps serving requests until the process exits.
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* import { startServer } from '@nitpicker/mcp-server';
|
|
58
|
+
*
|
|
59
|
+
* await startServer();
|
|
60
|
+
* ```
|
|
45
61
|
*/
|
|
46
62
|
export declare function startServer(): Promise<void>;
|
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,
|
|
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.
|
|
@@ -61,6 +61,23 @@ function optionalBoolean(args, key) {
|
|
|
61
61
|
}
|
|
62
62
|
throw new TypeError(`Invalid boolean for argument: ${key}`);
|
|
63
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Extracts an optional string argument with validation.
|
|
66
|
+
* @param args - The arguments object.
|
|
67
|
+
* @param key - The argument key.
|
|
68
|
+
* @returns The string value, or `undefined` if not present.
|
|
69
|
+
* @throws {TypeError} If the value is present but not a string.
|
|
70
|
+
*/
|
|
71
|
+
function optionalString(args, key) {
|
|
72
|
+
const value = args[key];
|
|
73
|
+
if (value == null) {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
if (typeof value !== 'string') {
|
|
77
|
+
throw new TypeError(`Invalid string for argument: ${key}`);
|
|
78
|
+
}
|
|
79
|
+
return value;
|
|
80
|
+
}
|
|
64
81
|
/** Valid link analysis types. */
|
|
65
82
|
const VALID_LINK_TYPES = ['broken', 'external'];
|
|
66
83
|
/** Valid mismatch types. */
|
|
@@ -100,7 +117,15 @@ function omit(args, ...keys) {
|
|
|
100
117
|
* Creates and configures the Nitpicker MCP server with all tools registered.
|
|
101
118
|
* Uses the low-level Server API to avoid deep type instantiation issues
|
|
102
119
|
* with McpServer + Zod schemas.
|
|
103
|
-
* @returns The configured Server instance.
|
|
120
|
+
* @returns The configured Server instance. Connect it to a transport to start serving.
|
|
121
|
+
* @example
|
|
122
|
+
* ```ts
|
|
123
|
+
* import { createServer } from '@nitpicker/mcp-server';
|
|
124
|
+
* import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
125
|
+
*
|
|
126
|
+
* const server = createServer();
|
|
127
|
+
* await server.connect(new StdioServerTransport());
|
|
128
|
+
* ```
|
|
104
129
|
*/
|
|
105
130
|
export function createServer() {
|
|
106
131
|
// Route ArchiveManager warnings to stderr explicitly via process.stderr.write
|
|
@@ -114,7 +139,7 @@ export function createServer() {
|
|
|
114
139
|
process.stderr.write(`${message}\n`);
|
|
115
140
|
},
|
|
116
141
|
});
|
|
117
|
-
const server = new Server({ name: 'nitpicker', version: '0.
|
|
142
|
+
const server = new Server({ name: 'nitpicker', version: '0.13.0' }, { capabilities: { tools: {} } });
|
|
118
143
|
server.setRequestHandler(ListToolsRequestSchema, () => Promise.resolve({ tools: toolDefinitions }));
|
|
119
144
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
120
145
|
const { name } = request.params;
|
|
@@ -124,7 +149,7 @@ export function createServer() {
|
|
|
124
149
|
case 'open_archive': {
|
|
125
150
|
const filePath = requireString(args, 'filePath');
|
|
126
151
|
const { archiveId, accessor, mode, crawlerLockHolder } = await manager.open(filePath);
|
|
127
|
-
const summary = await
|
|
152
|
+
const summary = await getSummaryFastPath(accessor);
|
|
128
153
|
return jsonResult({
|
|
129
154
|
archiveId,
|
|
130
155
|
baseUrl: summary.baseUrl,
|
|
@@ -146,7 +171,7 @@ export function createServer() {
|
|
|
146
171
|
}
|
|
147
172
|
case 'get_summary': {
|
|
148
173
|
const accessor = manager.get(requireString(args, 'archiveId'));
|
|
149
|
-
return jsonResult(await
|
|
174
|
+
return jsonResult(await getSummaryFastPath(accessor));
|
|
150
175
|
}
|
|
151
176
|
case 'list_pages': {
|
|
152
177
|
const accessor = manager.get(requireString(args, 'archiveId'));
|
|
@@ -190,28 +215,54 @@ export function createServer() {
|
|
|
190
215
|
}
|
|
191
216
|
case 'list_images': {
|
|
192
217
|
const accessor = manager.get(requireString(args, 'archiveId'));
|
|
193
|
-
return jsonResult(await
|
|
218
|
+
return jsonResult(await getImagesFastPath(accessor, omit(args, 'archiveId')));
|
|
194
219
|
}
|
|
195
220
|
case 'get_violations': {
|
|
196
221
|
const accessor = manager.get(requireString(args, 'archiveId'));
|
|
197
|
-
return jsonResult(await getViolations(accessor,
|
|
222
|
+
return jsonResult(await getViolations(accessor, {
|
|
223
|
+
validator: optionalString(args, 'validator'),
|
|
224
|
+
severity: optionalString(args, 'severity'),
|
|
225
|
+
rule: optionalString(args, 'rule'),
|
|
226
|
+
urlPattern: optionalString(args, 'urlPattern'),
|
|
227
|
+
sortBy: optionalString(args, 'sortBy'),
|
|
228
|
+
sortOrder: optionalString(args, 'sortOrder'),
|
|
229
|
+
limit: optionalNumber(args, 'limit'),
|
|
230
|
+
offset: optionalNumber(args, 'offset'),
|
|
231
|
+
}));
|
|
198
232
|
}
|
|
199
233
|
case 'find_duplicates': {
|
|
200
234
|
const accessor = manager.get(requireString(args, 'archiveId'));
|
|
201
235
|
const field = args.field
|
|
202
236
|
? validateEnum(String(args.field), VALID_DUPLICATE_FIELDS, 'field')
|
|
203
237
|
: undefined;
|
|
204
|
-
return jsonResult(await
|
|
238
|
+
return jsonResult(await getDuplicatesFastPath(accessor, {
|
|
239
|
+
field,
|
|
240
|
+
limit: optionalNumber(args, 'limit'),
|
|
241
|
+
offset: optionalNumber(args, 'offset'),
|
|
242
|
+
pagesLimit: optionalNumber(args, 'pagesLimit'),
|
|
243
|
+
cursor: optionalString(args, 'cursor'),
|
|
244
|
+
}));
|
|
205
245
|
}
|
|
206
246
|
case 'find_mismatches': {
|
|
207
247
|
const accessor = manager.get(requireString(args, 'archiveId'));
|
|
208
248
|
const type = validateEnum(requireString(args, 'type'), VALID_MISMATCH_TYPES, 'mismatch type');
|
|
209
|
-
return jsonResult(await
|
|
249
|
+
return jsonResult(await getMismatchesFastPath(accessor, type, {
|
|
250
|
+
limit: optionalNumber(args, 'limit'),
|
|
251
|
+
offset: optionalNumber(args, 'offset'),
|
|
252
|
+
urlPattern: optionalString(args, 'urlPattern'),
|
|
253
|
+
sortBy: optionalString(args, 'sortBy'),
|
|
254
|
+
sortOrder: optionalString(args, 'sortOrder'),
|
|
255
|
+
cursor: optionalString(args, 'cursor'),
|
|
256
|
+
}));
|
|
210
257
|
}
|
|
211
258
|
case 'get_resource_referrers': {
|
|
212
259
|
const accessor = manager.get(requireString(args, 'archiveId'));
|
|
213
260
|
const resourceUrl = requireString(args, 'resourceUrl');
|
|
214
|
-
const result = await getResourceReferrers(accessor,
|
|
261
|
+
const result = await getResourceReferrers(accessor, {
|
|
262
|
+
resourceUrl,
|
|
263
|
+
limit: optionalNumber(args, 'limit'),
|
|
264
|
+
cursor: optionalString(args, 'cursor'),
|
|
265
|
+
});
|
|
215
266
|
if (!result) {
|
|
216
267
|
return textResult('Resource not found.');
|
|
217
268
|
}
|
|
@@ -219,25 +270,25 @@ export function createServer() {
|
|
|
219
270
|
}
|
|
220
271
|
case 'check_headers': {
|
|
221
272
|
const accessor = manager.get(requireString(args, 'archiveId'));
|
|
222
|
-
return jsonResult(await
|
|
273
|
+
return jsonResult(await getHeaderChecksFastPath(accessor, omit(args, 'archiveId')));
|
|
223
274
|
}
|
|
224
275
|
case 'list_isolated_pages': {
|
|
225
276
|
const accessor = manager.get(requireString(args, 'archiveId'));
|
|
226
|
-
return jsonResult(await
|
|
277
|
+
return jsonResult(await listIsolatedPagesFastPath(accessor, {
|
|
227
278
|
limit: optionalNumber(args, 'limit'),
|
|
228
279
|
offset: optionalNumber(args, 'offset'),
|
|
229
280
|
}));
|
|
230
281
|
}
|
|
231
282
|
case 'list_isolated_clusters': {
|
|
232
283
|
const accessor = manager.get(requireString(args, 'archiveId'));
|
|
233
|
-
return jsonResult(await
|
|
284
|
+
return jsonResult(await listIsolatedClustersFastPath(accessor, {
|
|
234
285
|
limit: optionalNumber(args, 'limit'),
|
|
235
286
|
offset: optionalNumber(args, 'offset'),
|
|
236
287
|
}));
|
|
237
288
|
}
|
|
238
289
|
case 'get_isolated_cluster': {
|
|
239
290
|
const accessor = manager.get(requireString(args, 'archiveId'));
|
|
240
|
-
const result = await
|
|
291
|
+
const result = await getIsolatedClusterFastPath(accessor, requireString(args, 'representativeUrl'));
|
|
241
292
|
if (result === null) {
|
|
242
293
|
return textResult('Isolated cluster not found.');
|
|
243
294
|
}
|
|
@@ -297,6 +348,10 @@ export function createServer() {
|
|
|
297
348
|
const accessor = manager.get(requireString(args, 'archiveId'));
|
|
298
349
|
return jsonResult(await getPageTags(accessor, requireString(args, 'url')));
|
|
299
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
|
+
}
|
|
300
355
|
default: {
|
|
301
356
|
return {
|
|
302
357
|
content: [{ type: 'text', text: `Unknown tool: ${name}` }],
|
|
@@ -314,6 +369,14 @@ export function createServer() {
|
|
|
314
369
|
/**
|
|
315
370
|
* Starts the MCP server using stdio transport.
|
|
316
371
|
* This is the entry point for the `nitpicker-mcp` binary.
|
|
372
|
+
* @returns Resolves once the stdio transport is connected; the server then
|
|
373
|
+
* keeps serving requests until the process exits.
|
|
374
|
+
* @example
|
|
375
|
+
* ```ts
|
|
376
|
+
* import { startServer } from '@nitpicker/mcp-server';
|
|
377
|
+
*
|
|
378
|
+
* await startServer();
|
|
379
|
+
* ```
|
|
317
380
|
*/
|
|
318
381
|
export async function startServer() {
|
|
319
382
|
const server = createServer();
|
package/lib/tool-definitions.js
CHANGED
|
@@ -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, URL patterns, directory paths. Supports sorting and pagination. Use for questions like "show me all 404 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.',
|
|
52
52
|
inputSchema: {
|
|
53
53
|
type: 'object',
|
|
54
54
|
properties: {
|
|
@@ -75,6 +75,22 @@ 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
|
+
hasCSP: {
|
|
79
|
+
type: 'boolean',
|
|
80
|
+
description: 'Filter by Content-Security-Policy header presence',
|
|
81
|
+
},
|
|
82
|
+
hasXFrameOptions: {
|
|
83
|
+
type: 'boolean',
|
|
84
|
+
description: 'Filter by X-Frame-Options header presence',
|
|
85
|
+
},
|
|
86
|
+
hasXContentTypeOptions: {
|
|
87
|
+
type: 'boolean',
|
|
88
|
+
description: 'Filter by X-Content-Type-Options header presence',
|
|
89
|
+
},
|
|
90
|
+
hasHSTS: {
|
|
91
|
+
type: 'boolean',
|
|
92
|
+
description: 'Filter by Strict-Transport-Security header presence',
|
|
93
|
+
},
|
|
78
94
|
contentTypeCategory: {
|
|
79
95
|
type: 'string',
|
|
80
96
|
enum: [
|
|
@@ -122,7 +138,7 @@ export const toolDefinitions = [
|
|
|
122
138
|
},
|
|
123
139
|
{
|
|
124
140
|
name: 'get_page_detail',
|
|
125
|
-
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
|
|
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.',
|
|
126
142
|
inputSchema: {
|
|
127
143
|
type: 'object',
|
|
128
144
|
properties: {
|
|
@@ -159,7 +175,7 @@ export const toolDefinitions = [
|
|
|
159
175
|
},
|
|
160
176
|
{
|
|
161
177
|
name: 'list_links',
|
|
162
|
-
description: 'Analyse links: find **broken** links (
|
|
178
|
+
description: 'Analyse links: find **broken** links (canonical destination is exactly HTTP 404 Not Found — 403 Forbidden, 5xx server errors, and destinations excluded from crawling are deliberately NOT counted as broken, since those are separate concerns) or **external** links. Anchor destinations are resolved through `pages.redirectDestId` to the canonical final destination before judgment, so a 301 intermediate that lands on a 404 reports as broken with the 404 URL — not as a stale 301. Pass `includeRedirectSources: true` to disable the resolution and see the literal anchor target (diagnostic view). For orphan analysis, use `list_isolated_pages` (singletons) or `list_isolated_clusters` (interconnected orphan groups) — the previous `orphaned` type was removed in favour of those two well-separated concepts.',
|
|
163
179
|
inputSchema: {
|
|
164
180
|
type: 'object',
|
|
165
181
|
properties: {
|
|
@@ -170,7 +186,7 @@ export const toolDefinitions = [
|
|
|
170
186
|
type: {
|
|
171
187
|
type: 'string',
|
|
172
188
|
enum: ['broken', 'external'],
|
|
173
|
-
description: 'Type of link analysis: broken (
|
|
189
|
+
description: 'Type of link analysis: broken (canonical destination is exactly HTTP 404) or external (anchor leaves the in-scope hostname). Judged against the redirect-resolved canonical destination by default.',
|
|
174
190
|
},
|
|
175
191
|
includeRedirectSources: {
|
|
176
192
|
type: 'boolean',
|
|
@@ -254,6 +270,20 @@ export const toolDefinitions = [
|
|
|
254
270
|
},
|
|
255
271
|
severity: { type: 'string', description: 'Filter by severity level' },
|
|
256
272
|
rule: { type: 'string', description: 'Filter by rule ID' },
|
|
273
|
+
urlPattern: {
|
|
274
|
+
type: 'string',
|
|
275
|
+
description: 'Filter URLs by SQL LIKE pattern',
|
|
276
|
+
},
|
|
277
|
+
sortBy: {
|
|
278
|
+
type: 'string',
|
|
279
|
+
enum: ['url', 'validator', 'severity', 'rule', 'message', 'code'],
|
|
280
|
+
description: 'Sort field',
|
|
281
|
+
},
|
|
282
|
+
sortOrder: {
|
|
283
|
+
type: 'string',
|
|
284
|
+
enum: ['asc', 'desc'],
|
|
285
|
+
description: 'Sort direction',
|
|
286
|
+
},
|
|
257
287
|
limit: { type: 'number', description: 'Max results (default: 100)' },
|
|
258
288
|
offset: { type: 'number', description: 'Results to skip (default: 0)' },
|
|
259
289
|
},
|
|
@@ -276,6 +306,11 @@ export const toolDefinitions = [
|
|
|
276
306
|
description: 'Metadata field to check for duplicates (default: "title")',
|
|
277
307
|
},
|
|
278
308
|
limit: { type: 'number', description: 'Max duplicate groups (default: 50)' },
|
|
309
|
+
offset: { type: 'number', description: 'Duplicate groups to skip (default: 0)' },
|
|
310
|
+
pagesLimit: {
|
|
311
|
+
type: 'number',
|
|
312
|
+
description: 'Max inline sample URLs per duplicate group (default: 20)',
|
|
313
|
+
},
|
|
279
314
|
},
|
|
280
315
|
required: ['archiveId'],
|
|
281
316
|
},
|
|
@@ -297,13 +332,27 @@ export const toolDefinitions = [
|
|
|
297
332
|
},
|
|
298
333
|
limit: { type: 'number', description: 'Max results (default: 100)' },
|
|
299
334
|
offset: { type: 'number', description: 'Results to skip (default: 0)' },
|
|
335
|
+
urlPattern: {
|
|
336
|
+
type: 'string',
|
|
337
|
+
description: 'SQL LIKE pattern to filter results by page URL',
|
|
338
|
+
},
|
|
339
|
+
sortBy: {
|
|
340
|
+
type: 'string',
|
|
341
|
+
enum: ['url', 'actual', 'expected'],
|
|
342
|
+
description: 'Field to sort results by (default: "url")',
|
|
343
|
+
},
|
|
344
|
+
sortOrder: {
|
|
345
|
+
type: 'string',
|
|
346
|
+
enum: ['asc', 'desc'],
|
|
347
|
+
description: 'Sort direction (default: "asc")',
|
|
348
|
+
},
|
|
300
349
|
},
|
|
301
350
|
required: ['archiveId', 'type'],
|
|
302
351
|
},
|
|
303
352
|
},
|
|
304
353
|
{
|
|
305
354
|
name: 'get_resource_referrers',
|
|
306
|
-
description: 'Find which pages reference a specific resource (CSS, JS, image). Useful for impact analysis when considering removal or updates of a resource.',
|
|
355
|
+
description: 'Find which pages reference a specific resource (CSS, JS, image). Useful for impact analysis when considering removal or updates of a resource. Results are bounded and cursor-paginated (default 100 per call) — pass the returned `nextCursor` back in to fetch the rest for a resource referenced by many pages.',
|
|
307
356
|
inputSchema: {
|
|
308
357
|
type: 'object',
|
|
309
358
|
properties: {
|
|
@@ -315,6 +364,11 @@ export const toolDefinitions = [
|
|
|
315
364
|
type: 'string',
|
|
316
365
|
description: 'The exact URL of the resource to look up',
|
|
317
366
|
},
|
|
367
|
+
limit: { type: 'number', description: 'Max referring pages (default: 100)' },
|
|
368
|
+
cursor: {
|
|
369
|
+
type: 'string',
|
|
370
|
+
description: 'Opaque cursor from a previous call, taken from its `nextCursor`',
|
|
371
|
+
},
|
|
318
372
|
},
|
|
319
373
|
required: ['archiveId', 'resourceUrl'],
|
|
320
374
|
},
|
|
@@ -460,6 +514,21 @@ export const toolDefinitions = [
|
|
|
460
514
|
required: ['archiveId', 'url'],
|
|
461
515
|
},
|
|
462
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
|
+
},
|
|
463
532
|
{
|
|
464
533
|
name: 'check_headers',
|
|
465
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.
|
|
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.
|
|
35
|
+
"@nitpicker/query": "0.14.0"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "d6e1894a29aa29ca94785d9db0acfc3acc74764b"
|
|
38
38
|
}
|