@nekzus/mcp-server 1.18.3 → 1.19.0-alpha.10
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 +162 -283
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.ts +60 -40
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +488 -785
- package/dist/index.js.map +1 -1
- package/dist/src/cache.d.ts +22 -0
- package/dist/src/cache.d.ts.map +1 -0
- package/dist/src/cache.js +68 -0
- package/dist/src/cache.js.map +1 -0
- package/dist/src/config.d.ts +11 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +45 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/handlers/index.d.ts +2 -0
- package/dist/src/handlers/index.d.ts.map +1 -0
- package/dist/src/handlers/index.js +2 -0
- package/dist/src/handlers/index.js.map +1 -0
- package/dist/src/icons.d.ts +21 -0
- package/dist/src/icons.d.ts.map +1 -0
- package/dist/src/icons.js +29 -0
- package/dist/src/icons.js.map +1 -0
- package/dist/src/prompts/index.d.ts +3 -0
- package/dist/src/prompts/index.d.ts.map +1 -0
- package/dist/src/prompts/index.js +22 -0
- package/dist/src/prompts/index.js.map +1 -0
- package/dist/src/resources/index.d.ts +3 -0
- package/dist/src/resources/index.d.ts.map +1 -0
- package/dist/src/resources/index.js +62 -0
- package/dist/src/resources/index.js.map +1 -0
- package/dist/src/schemas.d.ts +143 -0
- package/dist/src/schemas.d.ts.map +1 -0
- package/dist/src/schemas.js +189 -0
- package/dist/src/schemas.js.map +1 -0
- package/dist/src/server.d.ts +7 -0
- package/dist/src/server.d.ts.map +1 -0
- package/dist/src/server.js +21 -0
- package/dist/src/server.js.map +1 -0
- package/dist/src/tools/index.d.ts +3 -0
- package/dist/src/tools/index.d.ts.map +1 -0
- package/dist/src/tools/index.js +411 -0
- package/dist/src/tools/index.js.map +1 -0
- package/dist/src/utils/fetch-retry.d.ts +5 -0
- package/dist/src/utils/fetch-retry.d.ts.map +1 -0
- package/dist/src/utils/fetch-retry.js +69 -0
- package/dist/src/utils/fetch-retry.js.map +1 -0
- package/llms-full.txt +312 -422
- package/package.json +16 -17
- package/smithery.yaml +10 -2
package/llms-full.txt
CHANGED
|
@@ -1,588 +1,478 @@
|
|
|
1
|
-
# NPM Sentinel MCP Server - Full Documentation
|
|
1
|
+
# NPM Sentinel MCP Server - Full Protocol & Technical Documentation
|
|
2
2
|
|
|
3
3
|
## Protocol Specification
|
|
4
|
-
Version:
|
|
5
|
-
Transport: stdio
|
|
6
|
-
|
|
4
|
+
Version: MCP v2 (@modelcontextprotocol/server & @modelcontextprotocol/core)
|
|
5
|
+
Transport: stdio / Streamable HTTP (SSE)
|
|
6
|
+
Capabilities: resources, prompts, tools, logging, structuredOutput
|
|
7
7
|
|
|
8
|
-
## Architecture
|
|
8
|
+
## Modular Architecture (`src/`)
|
|
9
9
|
```mermaid
|
|
10
10
|
flowchart TD
|
|
11
|
-
Client[MCP Client] <-->|MCP
|
|
12
|
-
|
|
13
|
-
Server -->|Analysis| Security[Security DB]
|
|
14
|
-
Server -->|Metrics| Stats[Download Stats]
|
|
11
|
+
Client[MCP v2 Client] <-->|MCP JSON-RPC| Transport[Stdio / HTTP Transport]
|
|
12
|
+
Transport <--> Server[src/server.ts createServer]
|
|
15
13
|
|
|
16
|
-
subgraph
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
subgraph Modular Server Core
|
|
15
|
+
Server --> ToolsReg[src/tools/index.ts]
|
|
16
|
+
Server --> ResReg[src/resources/index.ts]
|
|
17
|
+
Server --> PromptReg[src/prompts/index.ts]
|
|
18
|
+
Server --> Config[src/config.ts]
|
|
19
|
+
Server --> Cache[src/cache.ts FIFO Cache]
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
subgraph
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
subgraph Handlers Layer
|
|
23
|
+
ToolsReg --> Handlers[src/handlers/index.ts]
|
|
24
|
+
Handlers --> Registry[NPM Registry API]
|
|
25
|
+
Handlers --> DepsDev[Google deps.dev / OSV.dev]
|
|
26
|
+
Handlers --> NPMS[npms.io API]
|
|
27
|
+
Handlers --> GitHub[GitHub API / Scorecard]
|
|
27
28
|
end
|
|
28
29
|
```
|
|
29
30
|
|
|
30
|
-
##
|
|
31
|
+
## Features & Capabilities
|
|
31
32
|
|
|
32
|
-
###
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
Rate Limits: Follows npm registry limits
|
|
37
|
-
Description: Package metadata and version information interface
|
|
33
|
+
### 1. Dual Output Protocol (`structuredContent` + `content`)
|
|
34
|
+
Every tool handler call processes inputs through Zod validation (`inputSchema` and `outputSchema`) and wraps responses using `withStructuredOutput`. The client receives both:
|
|
35
|
+
- `content`: Human-readable stringified JSON formatted text item.
|
|
36
|
+
- `structuredContent`: Deserialized native JSON object matching the tool's `outputSchema`.
|
|
38
37
|
|
|
39
|
-
###
|
|
40
|
-
|
|
41
|
-
Methods: GET
|
|
42
|
-
Update Frequency: Daily
|
|
43
|
-
Severity Levels: Low, Medium, High, Critical
|
|
44
|
-
Description: Vulnerability and security analysis interface
|
|
38
|
+
### 2. Embedded Vector SVG Data URI Icons
|
|
39
|
+
All registered tools, resources, and prompts expose pre-rendered SVG Data URIs (`data:image/svg+xml`) in their `icons` array for rich presentation in modern MCP UI clients.
|
|
45
40
|
|
|
46
|
-
###
|
|
47
|
-
|
|
48
|
-
Methods: GET, SUBSCRIBE
|
|
49
|
-
Update Frequency: Real-time
|
|
50
|
-
Metrics Types: Downloads, Stars, Issues, Updates
|
|
51
|
-
Description: Package analytics and statistics interface
|
|
41
|
+
### 3. Context Diagnostics Logging
|
|
42
|
+
Handlers issue real-time diagnostic logs (`info`) using `ctx.mcpReq.log` during execution.
|
|
52
43
|
|
|
53
|
-
|
|
44
|
+
---
|
|
54
45
|
|
|
55
|
-
|
|
56
|
-
// (or a textual summary if the response is simpler), is JSON stringified and placed within the `text` field
|
|
57
|
-
// of the standard MCP content object: {"type": "text", "text": "...", "isError": boolean}.
|
|
46
|
+
## Resources Specification
|
|
58
47
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
48
|
+
### `doc://server/readme`
|
|
49
|
+
- **Content-Type**: `text/markdown`
|
|
50
|
+
- **Description**: Main NPM Sentinel MCP server README documentation.
|
|
51
|
+
- **Icon**: SVG Document Data URI.
|
|
64
52
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
53
|
+
### `doc://mcp/specification`
|
|
54
|
+
- **Content-Type**: `text/plain`
|
|
55
|
+
- **Description**: Complete Model Context Protocol technical specification (`llms-full.txt`).
|
|
56
|
+
- **Icon**: SVG Document Data URI.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Prompts Specification
|
|
71
61
|
|
|
72
|
-
|
|
73
|
-
|
|
62
|
+
### `analyze-package`
|
|
63
|
+
- **Description**: Generates an interactive prompt payload for deep AI analysis of an NPM package including security, performance, dependencies, and health metrics.
|
|
64
|
+
- **Arguments**:
|
|
65
|
+
- `package` (string, required): Name of the NPM package to analyze.
|
|
66
|
+
- **Icon**: SVG Security Data URI.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Tool Specifications (19 Tools)
|
|
71
|
+
|
|
72
|
+
All tools accept an optional `ignoreCache: true` parameter and return standardized responses.
|
|
73
|
+
|
|
74
|
+
### Standard Error Format (e.g. Empty Array `packages: []` or Invalid Input)
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"queryPackages": [],
|
|
78
|
+
"results": [],
|
|
79
|
+
"status": "error",
|
|
80
|
+
"error": "No package names provided in request",
|
|
81
|
+
"message": "The packages parameter must contain at least one package name."
|
|
74
82
|
}
|
|
75
83
|
```
|
|
76
84
|
|
|
77
|
-
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
#### 1. `npmLatest`
|
|
78
88
|
```typescript
|
|
79
89
|
interface NpmLatestInput {
|
|
80
90
|
packages: string[];
|
|
91
|
+
ignoreCache?: boolean;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface LatestVersionResult {
|
|
95
|
+
packageInput: string;
|
|
96
|
+
packageName: string;
|
|
97
|
+
versionQueried: string;
|
|
98
|
+
status: 'success' | 'error';
|
|
99
|
+
data?: {
|
|
100
|
+
version: string;
|
|
101
|
+
description: string;
|
|
102
|
+
license: string;
|
|
103
|
+
homepage: string;
|
|
104
|
+
repository: any;
|
|
105
|
+
dependencies: Record<string, string>;
|
|
106
|
+
integrity: string;
|
|
107
|
+
tarball: string;
|
|
108
|
+
distTags: Record<string, string>;
|
|
109
|
+
};
|
|
81
110
|
}
|
|
111
|
+
```
|
|
82
112
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
113
|
+
#### 2. `npmVersions`
|
|
114
|
+
```typescript
|
|
115
|
+
interface NpmVersionsInput {
|
|
116
|
+
packages: string[];
|
|
117
|
+
ignoreCache?: boolean;
|
|
87
118
|
}
|
|
88
119
|
|
|
89
|
-
interface
|
|
90
|
-
|
|
120
|
+
interface VersionsResult {
|
|
121
|
+
packageInput: string;
|
|
122
|
+
packageName: string;
|
|
123
|
+
status: 'success' | 'error';
|
|
124
|
+
data?: {
|
|
125
|
+
allVersions: string[];
|
|
126
|
+
tags: Record<string, string>;
|
|
127
|
+
latestVersionTag: string;
|
|
128
|
+
};
|
|
91
129
|
}
|
|
92
130
|
```
|
|
93
131
|
|
|
94
|
-
#### npmDeps
|
|
132
|
+
#### 3. `npmDeps`
|
|
95
133
|
```typescript
|
|
96
134
|
interface NpmDepsInput {
|
|
97
135
|
packages: string[];
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
136
|
+
ignoreCache?: boolean;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
interface NpmDepsResult {
|
|
140
|
+
packageInput: string;
|
|
141
|
+
packageName: string;
|
|
142
|
+
status: 'success' | 'error';
|
|
143
|
+
data?: {
|
|
144
|
+
directDependencies: Record<string, string>;
|
|
145
|
+
devDependencies: Record<string, string>;
|
|
146
|
+
peerDependencies: Record<string, string>;
|
|
147
|
+
transitiveCount: number;
|
|
148
|
+
transitiveDependenciesList: string[];
|
|
110
149
|
};
|
|
111
150
|
}
|
|
112
151
|
```
|
|
113
152
|
|
|
114
|
-
#### npmTypes
|
|
153
|
+
#### 4. `npmTypes`
|
|
115
154
|
```typescript
|
|
116
155
|
interface NpmTypesInput {
|
|
117
156
|
packages: string[];
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
157
|
+
ignoreCache?: boolean;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
interface NpmTypesResult {
|
|
161
|
+
packageInput: string;
|
|
162
|
+
packageName: string;
|
|
163
|
+
status: 'success' | 'error';
|
|
164
|
+
data?: {
|
|
165
|
+
hasNativeTypes: boolean;
|
|
166
|
+
definitelyTypedPackage: string | null;
|
|
167
|
+
hasDefinitelyTyped: boolean;
|
|
168
|
+
tsStatus: 'native' | 'definitely-typed' | 'none';
|
|
169
|
+
};
|
|
129
170
|
}
|
|
130
171
|
```
|
|
131
172
|
|
|
132
|
-
#### npmSize
|
|
173
|
+
#### 5. `npmSize`
|
|
133
174
|
```typescript
|
|
134
175
|
interface NpmSizeInput {
|
|
135
176
|
packages: string[];
|
|
177
|
+
ignoreCache?: boolean;
|
|
136
178
|
}
|
|
137
179
|
|
|
138
|
-
interface
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
[packageName: string]: SizeMetrics;
|
|
180
|
+
interface NpmSizeResult {
|
|
181
|
+
packageInput: string;
|
|
182
|
+
packageName: string;
|
|
183
|
+
status: 'success' | 'error';
|
|
184
|
+
data?: {
|
|
185
|
+
unpackedSize: number;
|
|
186
|
+
fileCount: number;
|
|
187
|
+
sizeFormatted: string;
|
|
188
|
+
};
|
|
148
189
|
}
|
|
149
190
|
```
|
|
150
191
|
|
|
151
|
-
#### npmVulnerabilities
|
|
192
|
+
#### 6. `npmVulnerabilities`
|
|
152
193
|
```typescript
|
|
153
194
|
interface NpmVulnerabilitiesInput {
|
|
154
195
|
packages: string[];
|
|
196
|
+
ignoreCache?: boolean;
|
|
155
197
|
}
|
|
156
198
|
|
|
157
|
-
interface
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
cvssScore?: number;
|
|
164
|
-
url?: string;
|
|
199
|
+
interface VulnerabilityAdvisory {
|
|
200
|
+
id: string;
|
|
201
|
+
summary: string;
|
|
202
|
+
details: string;
|
|
203
|
+
severity: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
|
|
204
|
+
aliases: string[];
|
|
165
205
|
}
|
|
166
206
|
|
|
167
|
-
interface
|
|
168
|
-
|
|
207
|
+
interface NpmVulnerabilitiesResult {
|
|
208
|
+
packageInput: string;
|
|
209
|
+
packageName: string;
|
|
210
|
+
status: 'success' | 'error';
|
|
211
|
+
data?: {
|
|
212
|
+
vulnerabilityCount: number;
|
|
213
|
+
scannedPackagesCount: number;
|
|
214
|
+
advisories: VulnerabilityAdvisory[];
|
|
215
|
+
};
|
|
169
216
|
}
|
|
170
217
|
```
|
|
171
218
|
|
|
172
|
-
#### npmTrends
|
|
219
|
+
#### 7. `npmTrends`
|
|
173
220
|
```typescript
|
|
174
221
|
interface NpmTrendsInput {
|
|
175
222
|
packages: string[];
|
|
176
|
-
period
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
interface NpmTrendsResponse {
|
|
192
|
-
[packageName: string]: TrendMetrics;
|
|
223
|
+
period?: 'last-week' | 'last-month' | 'last-year';
|
|
224
|
+
ignoreCache?: boolean;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
interface NpmTrendsResult {
|
|
228
|
+
packageInput: string;
|
|
229
|
+
packageName: string;
|
|
230
|
+
status: 'success' | 'error';
|
|
231
|
+
data?: {
|
|
232
|
+
period: string;
|
|
233
|
+
totalDownloads: number;
|
|
234
|
+
downloads: Array<{ day: string; downloads: number }>;
|
|
235
|
+
};
|
|
193
236
|
}
|
|
194
237
|
```
|
|
195
238
|
|
|
196
|
-
#### npmCompare
|
|
239
|
+
#### 8. `npmCompare`
|
|
197
240
|
```typescript
|
|
198
241
|
interface NpmCompareInput {
|
|
199
242
|
packages: string[];
|
|
243
|
+
ignoreCache?: boolean;
|
|
200
244
|
}
|
|
201
245
|
|
|
202
|
-
interface
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
comparisonSummary?: string;
|
|
246
|
+
interface NpmCompareResult {
|
|
247
|
+
packagesCompared: string[];
|
|
248
|
+
metrics: Array<{
|
|
249
|
+
name: string;
|
|
250
|
+
version: string;
|
|
251
|
+
monthlyDownloads: number;
|
|
252
|
+
score: number;
|
|
253
|
+
license: string;
|
|
254
|
+
hasTypes: boolean;
|
|
255
|
+
}>;
|
|
213
256
|
}
|
|
214
257
|
```
|
|
215
258
|
|
|
216
|
-
#### npmMaintainers
|
|
259
|
+
#### 9. `npmMaintainers`
|
|
217
260
|
```typescript
|
|
218
261
|
interface NpmMaintainersInput {
|
|
219
262
|
packages: string[];
|
|
263
|
+
ignoreCache?: boolean;
|
|
220
264
|
}
|
|
221
265
|
|
|
222
|
-
interface
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
[packageName: string]: Maintainer[];
|
|
266
|
+
interface NpmMaintainersResult {
|
|
267
|
+
packageInput: string;
|
|
268
|
+
packageName: string;
|
|
269
|
+
status: 'success' | 'error';
|
|
270
|
+
data?: {
|
|
271
|
+
maintainers: Array<{ name: string; email?: string; url?: string }>;
|
|
272
|
+
};
|
|
230
273
|
}
|
|
231
274
|
```
|
|
232
275
|
|
|
233
|
-
#### npmScore
|
|
276
|
+
#### 10. `npmScore`
|
|
234
277
|
```typescript
|
|
235
278
|
interface NpmScoreInput {
|
|
236
279
|
packages: string[];
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
280
|
+
ignoreCache?: boolean;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
interface NpmScoreResult {
|
|
284
|
+
packageInput: string;
|
|
285
|
+
packageName: string;
|
|
286
|
+
status: 'success' | 'error';
|
|
287
|
+
data?: {
|
|
288
|
+
finalScore: number;
|
|
289
|
+
quality: number;
|
|
290
|
+
popularity: number;
|
|
291
|
+
maintenance: number;
|
|
292
|
+
scorecard?: any;
|
|
293
|
+
};
|
|
248
294
|
}
|
|
249
295
|
```
|
|
250
296
|
|
|
251
|
-
#### npmPackageReadme
|
|
297
|
+
#### 11. `npmPackageReadme`
|
|
252
298
|
```typescript
|
|
253
299
|
interface NpmPackageReadmeInput {
|
|
254
300
|
packages: string[];
|
|
301
|
+
ignoreCache?: boolean;
|
|
255
302
|
}
|
|
256
303
|
|
|
257
|
-
interface
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
304
|
+
interface NpmPackageReadmeResult {
|
|
305
|
+
packageInput: string;
|
|
306
|
+
packageName: string;
|
|
307
|
+
status: 'success' | 'error';
|
|
308
|
+
data?: {
|
|
309
|
+
readme: string;
|
|
262
310
|
};
|
|
263
311
|
}
|
|
264
312
|
```
|
|
265
313
|
|
|
266
|
-
#### npmSearch
|
|
314
|
+
#### 12. `npmSearch`
|
|
267
315
|
```typescript
|
|
268
316
|
interface NpmSearchInput {
|
|
269
317
|
query: string;
|
|
270
318
|
limit?: number;
|
|
271
319
|
}
|
|
272
320
|
|
|
273
|
-
interface
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
query: string;
|
|
283
|
-
results: SearchResultPackage[];
|
|
284
|
-
totalResults?: number;
|
|
321
|
+
interface NpmSearchResult {
|
|
322
|
+
total: number;
|
|
323
|
+
results: Array<{
|
|
324
|
+
name: string;
|
|
325
|
+
version: string;
|
|
326
|
+
description: string;
|
|
327
|
+
score: number;
|
|
328
|
+
keywords: string[];
|
|
329
|
+
}>;
|
|
285
330
|
}
|
|
286
331
|
```
|
|
287
332
|
|
|
288
|
-
#### npmLicenseCompatibility
|
|
333
|
+
#### 13. `npmLicenseCompatibility`
|
|
289
334
|
```typescript
|
|
290
335
|
interface NpmLicenseCompatibilityInput {
|
|
291
336
|
packages: string[];
|
|
292
|
-
|
|
337
|
+
ignoreCache?: boolean;
|
|
293
338
|
}
|
|
294
339
|
|
|
295
|
-
interface
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
issues?: string[];
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
interface NpmLicenseCompatibilityResponse {
|
|
303
|
-
[packageName: string]: LicenseInfo;
|
|
304
|
-
compatibilitySummary?: string;
|
|
340
|
+
interface NpmLicenseCompatibilityResult {
|
|
341
|
+
packagesAnalysed: Array<{ name: string; license: string }>;
|
|
342
|
+
isCompatible: boolean;
|
|
343
|
+
compatibilityDetails: string;
|
|
305
344
|
}
|
|
306
345
|
```
|
|
307
346
|
|
|
308
|
-
#### npmRepoStats
|
|
347
|
+
#### 14. `npmRepoStats`
|
|
309
348
|
```typescript
|
|
310
349
|
interface NpmRepoStatsInput {
|
|
311
350
|
packages: string[];
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
351
|
+
ignoreCache?: boolean;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
interface NpmRepoStatsResult {
|
|
355
|
+
packageInput: string;
|
|
356
|
+
packageName: string;
|
|
357
|
+
status: 'success' | 'error';
|
|
358
|
+
data?: {
|
|
359
|
+
stars: number;
|
|
360
|
+
forks: number;
|
|
361
|
+
openIssues: number;
|
|
362
|
+
scorecard?: {
|
|
363
|
+
overallScore: number;
|
|
364
|
+
checks: Array<{ name: string; score: number }>;
|
|
365
|
+
};
|
|
366
|
+
};
|
|
325
367
|
}
|
|
326
368
|
```
|
|
327
369
|
|
|
328
|
-
#### npmDeprecated
|
|
370
|
+
#### 15. `npmDeprecated`
|
|
329
371
|
```typescript
|
|
330
372
|
interface NpmDeprecatedInput {
|
|
331
373
|
packages: string[];
|
|
374
|
+
ignoreCache?: boolean;
|
|
332
375
|
}
|
|
333
376
|
|
|
334
|
-
interface
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
377
|
+
interface NpmDeprecatedResult {
|
|
378
|
+
packageInput: string;
|
|
379
|
+
packageName: string;
|
|
380
|
+
status: 'success' | 'error';
|
|
381
|
+
data?: {
|
|
382
|
+
isDeprecated: boolean;
|
|
383
|
+
deprecationReason: string | null;
|
|
384
|
+
};
|
|
342
385
|
}
|
|
343
386
|
```
|
|
344
387
|
|
|
345
|
-
#### npmChangelogAnalysis
|
|
388
|
+
#### 16. `npmChangelogAnalysis`
|
|
346
389
|
```typescript
|
|
347
390
|
interface NpmChangelogAnalysisInput {
|
|
348
391
|
packages: string[];
|
|
349
|
-
|
|
350
|
-
sinceVersion?: string;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
interface ChangelogEntry {
|
|
354
|
-
version: string;
|
|
355
|
-
date?: string;
|
|
356
|
-
summary?: string;
|
|
357
|
-
changes?: { type: 'added' | 'fixed' | 'changed' | 'removed'; description: string }[];
|
|
392
|
+
ignoreCache?: boolean;
|
|
358
393
|
}
|
|
359
394
|
|
|
360
|
-
interface
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
395
|
+
interface NpmChangelogAnalysisResult {
|
|
396
|
+
packageInput: string;
|
|
397
|
+
packageName: string;
|
|
398
|
+
status: 'success' | 'error';
|
|
399
|
+
data?: {
|
|
400
|
+
hasChangelog: boolean;
|
|
401
|
+
releases: Array<{ tag_name: string; name: string; published_at: string; source: string }>;
|
|
365
402
|
};
|
|
366
403
|
}
|
|
367
404
|
```
|
|
368
405
|
|
|
369
|
-
#### npmAlternatives
|
|
406
|
+
#### 17. `npmAlternatives`
|
|
370
407
|
```typescript
|
|
371
408
|
interface NpmAlternativesInput {
|
|
372
409
|
packages: string[];
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
410
|
+
ignoreCache?: boolean;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Filter Algorithm:
|
|
415
|
+
* 1. Extracts functional domain keywords (excluding brand keywords).
|
|
416
|
+
* 2. Queries registry by domain keywords.
|
|
417
|
+
* 3. Applies strict candidate filter (excludes same package, @types/, ecosystem plugins prefixed with name).
|
|
418
|
+
* 4. Returns top 5 distinct alternative packages.
|
|
419
|
+
*/
|
|
420
|
+
interface NpmAlternativesResult {
|
|
421
|
+
packageInput: string;
|
|
422
|
+
packageName: string;
|
|
423
|
+
status: 'success' | 'no_alternatives_found' | 'error';
|
|
424
|
+
data?: {
|
|
425
|
+
originalPackageStats: { name: string; monthlyDownloads: number; keywords: string[] };
|
|
426
|
+
alternatives: Array<{
|
|
427
|
+
name: string;
|
|
428
|
+
description: string | null;
|
|
429
|
+
version: string;
|
|
430
|
+
monthlyDownloads: number;
|
|
431
|
+
score: number;
|
|
432
|
+
repositoryUrl: string | null;
|
|
433
|
+
keywords: string[];
|
|
434
|
+
}>;
|
|
384
435
|
};
|
|
385
436
|
}
|
|
386
437
|
```
|
|
387
438
|
|
|
388
|
-
#### npmQuality
|
|
439
|
+
#### 18. `npmQuality`
|
|
389
440
|
```typescript
|
|
390
441
|
interface NpmQualityInput {
|
|
391
442
|
packages: string[];
|
|
443
|
+
ignoreCache?: boolean;
|
|
392
444
|
}
|
|
393
445
|
|
|
394
|
-
interface
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
npmsMaintenanceScore?: number;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
interface NpmQualityResponse {
|
|
405
|
-
[packageName: string]: QualityMetrics;
|
|
446
|
+
interface NpmQualityResult {
|
|
447
|
+
packageInput: string;
|
|
448
|
+
packageName: string;
|
|
449
|
+
status: 'success' | 'error';
|
|
450
|
+
data?: {
|
|
451
|
+
qualityScore: number;
|
|
452
|
+
};
|
|
406
453
|
}
|
|
407
454
|
```
|
|
408
455
|
|
|
409
|
-
#### npmMaintenance
|
|
456
|
+
#### 19. `npmMaintenance`
|
|
410
457
|
```typescript
|
|
411
458
|
interface NpmMaintenanceInput {
|
|
412
459
|
packages: string[];
|
|
460
|
+
ignoreCache?: boolean;
|
|
413
461
|
}
|
|
414
462
|
|
|
415
|
-
interface
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
interface NpmMaintenanceResponse {
|
|
424
|
-
[packageName: string]: MaintenanceMetrics;
|
|
425
|
-
}
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
## Error Handling
|
|
429
|
-
|
|
430
|
-
### Standard Error Format
|
|
431
|
-
// When an error occurs, the standard MCP response 'content' object will have 'isError: true'.
|
|
432
|
-
// The 'text' field of that content object will contain a JSON stringified MCPError object, as defined below.
|
|
433
|
-
```typescript
|
|
434
|
-
interface MCPError {
|
|
435
|
-
error: {
|
|
436
|
-
code: number;
|
|
437
|
-
message: string;
|
|
438
|
-
data?: {
|
|
439
|
-
details: string;
|
|
440
|
-
packageName?: string;
|
|
441
|
-
context?: any;
|
|
442
|
-
};
|
|
463
|
+
interface NpmMaintenanceResult {
|
|
464
|
+
packageInput: string;
|
|
465
|
+
packageName: string;
|
|
466
|
+
status: 'success' | 'error';
|
|
467
|
+
data?: {
|
|
468
|
+
maintenanceScore: number;
|
|
443
469
|
};
|
|
444
470
|
}
|
|
445
471
|
```
|
|
446
472
|
|
|
447
|
-
|
|
448
|
-
1000: Invalid package name (Rejected by security validation filter due to restricted characters or format)
|
|
449
|
-
1001: Package not found
|
|
450
|
-
1002: Version not found
|
|
451
|
-
1003: Rate limit exceeded
|
|
452
|
-
1004: Network error
|
|
453
|
-
1005: Analysis failed
|
|
454
|
-
2000: Internal server error
|
|
455
|
-
|
|
456
|
-
## Security Considerations
|
|
457
|
-
|
|
458
|
-
### Data Protection
|
|
459
|
-
- All data is processed locally
|
|
460
|
-
- No sensitive information is stored
|
|
461
|
-
- Secure communication channels
|
|
462
|
-
|
|
463
|
-
### Input Validation
|
|
464
|
-
- Strict Regex-based allowlist for package names
|
|
465
|
-
- Prevents Path Traversal (`../`)
|
|
466
|
-
- Prevents Command Injection (`&`, `;`, `|`)
|
|
467
|
-
- Prevents SSRF attacks
|
|
468
|
-
|
|
469
|
-
### Rate Limiting
|
|
470
|
-
- Implements fair usage policies
|
|
471
|
-
- Respects NPM registry limits
|
|
472
|
-
- Prevents abuse
|
|
473
|
-
|
|
474
|
-
### Authentication
|
|
475
|
-
- Supports npm token authentication
|
|
476
|
-
- Validates package access
|
|
477
|
-
- Manages credentials securely
|
|
478
|
-
|
|
479
|
-
## Integration Guide
|
|
480
|
-
|
|
481
|
-
### Docker Configuration
|
|
482
|
-
The server can be run in a Docker container with directory mounting to `/projects`. This allows for secure access to files while maintaining isolation.
|
|
483
|
-
|
|
484
|
-
#### Build
|
|
485
|
-
```bash
|
|
486
|
-
# Build the Docker image
|
|
487
|
-
docker build -t nekzus/npm-sentinel-mcp .
|
|
488
|
-
```
|
|
473
|
+
---
|
|
489
474
|
|
|
490
|
-
|
|
491
|
-
```json
|
|
492
|
-
{
|
|
493
|
-
"mcpServers": {
|
|
494
|
-
"npm-sentinel-mcp": {
|
|
495
|
-
"command": "docker",
|
|
496
|
-
"args": [
|
|
497
|
-
"run",
|
|
498
|
-
"-i",
|
|
499
|
-
"--rm",
|
|
500
|
-
"-w", "/projects",
|
|
501
|
-
"--mount", "type=bind,src=${PWD},dst=/projects",
|
|
502
|
-
"nekzus/npm-sentinel-mcp",
|
|
503
|
-
"node",
|
|
504
|
-
"dist/index.js"
|
|
505
|
-
]
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
```
|
|
510
|
-
|
|
511
|
-
#### Multi-Directory Configuration
|
|
512
|
-
```json
|
|
513
|
-
{
|
|
514
|
-
"mcpServers": {
|
|
515
|
-
"npm-sentinel-mcp": {
|
|
516
|
-
"command": "docker",
|
|
517
|
-
"args": [
|
|
518
|
-
"run",
|
|
519
|
-
"-i",
|
|
520
|
-
"--rm",
|
|
521
|
-
"-w", "/projects",
|
|
522
|
-
"--mount", "type=bind,src=/path/to/workspace,dst=/projects/workspace",
|
|
523
|
-
"--mount", "type=bind,src=/path/to/other/dir,dst=/projects/other/dir,ro",
|
|
524
|
-
"nekzus/npm-sentinel-mcp",
|
|
525
|
-
"node",
|
|
526
|
-
"dist/index.js"
|
|
527
|
-
]
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
```
|
|
532
|
-
|
|
533
|
-
#### Mount Guidelines
|
|
534
|
-
- Mount all directories under `/projects`
|
|
535
|
-
- Use absolute paths for source directories
|
|
536
|
-
- Add `,ro` flag for read-only access
|
|
537
|
-
- Working directory is set to `/projects`
|
|
538
|
-
- Container runs in interactive mode with auto-removal
|
|
539
|
-
|
|
540
|
-
### Standard Configuration
|
|
541
|
-
```json
|
|
542
|
-
{
|
|
543
|
-
"mcpServers": {
|
|
544
|
-
"npm-sentinel-mcp": {
|
|
545
|
-
"transport": "stdio",
|
|
546
|
-
"command": "npx",
|
|
547
|
-
"args": ["-y", "@nekzus/mcp-server"]
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
```
|
|
552
|
-
|
|
553
|
-
### Basic Usage
|
|
554
|
-
```typescript
|
|
555
|
-
// Initialize client
|
|
556
|
-
const client = await MCPClient.connect("npm-sentinel-mcp");
|
|
557
|
-
|
|
558
|
-
// Analyze package
|
|
559
|
-
const result = await client.invoke("npmVersions", {
|
|
560
|
-
packages: ["react"]
|
|
561
|
-
});
|
|
562
|
-
|
|
563
|
-
// Subscribe to updates
|
|
564
|
-
const unsubscribe = await client.subscribe("npm://registry", {
|
|
565
|
-
package: "react",
|
|
566
|
-
onUpdate: (data) => console.log(data)
|
|
567
|
-
});
|
|
568
|
-
```
|
|
475
|
+
## Technical Support & License
|
|
569
476
|
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
### Resource Usage
|
|
573
|
-
1. Subscribe to resources for real-time updates
|
|
574
|
-
2. Implement caching for frequently accessed data
|
|
575
|
-
3. Use batch operations when possible
|
|
576
|
-
4. Handle rate limits gracefully
|
|
577
|
-
|
|
578
|
-
### Error Handling
|
|
579
|
-
1. Implement proper error recovery
|
|
580
|
-
2. Provide meaningful error messages
|
|
581
|
-
3. Log errors for debugging
|
|
582
|
-
4. Handle timeout scenarios
|
|
583
|
-
|
|
584
|
-
### Performance
|
|
585
|
-
1. Use connection pooling
|
|
586
|
-
2. Implement request queuing
|
|
587
|
-
3. Cache responses
|
|
588
|
-
4. Handle concurrent requests
|
|
477
|
+
- **License**: MIT
|
|
478
|
+
- **Repository**: https://github.com/Nekzus/npm-sentinel-mcp
|