@cyanheads/nist-nvd-mcp-server 0.1.19 → 0.3.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/AGENTS.md +34 -14
- package/CLAUDE.md +34 -14
- package/Dockerfile +9 -4
- package/README.md +2 -1
- package/changelog/0.2.x/0.2.0.md +26 -0
- package/changelog/0.3.x/0.3.0.md +48 -0
- package/changelog/template.md +55 -16
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/nvd-audit-cpe.tool.d.ts +15 -16
- package/dist/mcp-server/tools/definitions/nvd-audit-cpe.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/nvd-audit-cpe.tool.js +4 -4
- package/dist/mcp-server/tools/definitions/nvd-audit-cpe.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/nvd-get-cve-history.tool.d.ts +2 -2
- package/dist/mcp-server/tools/definitions/nvd-get-cve.tool.d.ts +11 -12
- package/dist/mcp-server/tools/definitions/nvd-get-cve.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/nvd-get-cve.tool.js +10 -5
- package/dist/mcp-server/tools/definitions/nvd-get-cve.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/nvd-search-cves.tool.d.ts +2 -2
- package/dist/mcp-server/tools/formatting/cpe-match.d.ts +26 -16
- package/dist/mcp-server/tools/formatting/cpe-match.d.ts.map +1 -1
- package/dist/mcp-server/tools/formatting/cpe-match.js +26 -13
- package/dist/mcp-server/tools/formatting/cpe-match.js.map +1 -1
- package/dist/mcp-server/tools/schemas/brief-cve.d.ts +2 -2
- package/dist/mcp-server/tools/schemas/full-cve.d.ts +13 -14
- package/dist/mcp-server/tools/schemas/full-cve.d.ts.map +1 -1
- package/dist/mcp-server/tools/schemas/full-cve.js +24 -22
- package/dist/mcp-server/tools/schemas/full-cve.js.map +1 -1
- package/dist/services/nvd-cpe/nvd-cpe-service.d.ts.map +1 -1
- package/dist/services/nvd-cve/nvd-cve-service.d.ts +13 -0
- package/dist/services/nvd-cve/nvd-cve-service.d.ts.map +1 -1
- package/dist/services/nvd-cve/nvd-cve-service.js +51 -20
- package/dist/services/nvd-cve/nvd-cve-service.js.map +1 -1
- package/dist/services/nvd-cve/types.d.ts +21 -14
- package/dist/services/nvd-cve/types.d.ts.map +1 -1
- package/dist/services/nvd-http/nvd-http-client.d.ts +13 -1
- package/dist/services/nvd-http/nvd-http-client.d.ts.map +1 -1
- package/dist/services/nvd-http/nvd-http-client.js +7 -6
- package/dist/services/nvd-http/nvd-http-client.js.map +1 -1
- package/dist/services/nvd-source/nvd-source-service.d.ts +41 -0
- package/dist/services/nvd-source/nvd-source-service.d.ts.map +1 -0
- package/dist/services/nvd-source/nvd-source-service.js +131 -0
- package/dist/services/nvd-source/nvd-source-service.js.map +1 -0
- package/dist/services/nvd-source/types.d.ts +19 -0
- package/dist/services/nvd-source/types.d.ts.map +1 -0
- package/dist/services/nvd-source/types.js +6 -0
- package/dist/services/nvd-source/types.js.map +1 -0
- package/manifest.json +1 -1
- package/package.json +8 -8
- package/server.json +3 -3
package/AGENTS.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** nist-nvd-mcp-server
|
|
4
|
-
**Version:** 0.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.
|
|
4
|
+
**Version:** 0.3.0
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.12.3`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
|
-
**MCP SDK:** `@modelcontextprotocol/
|
|
7
|
+
**MCP SDK:** `@modelcontextprotocol/server` ^2.0.0
|
|
8
8
|
**Zod:** ^4.4.3
|
|
9
9
|
|
|
10
10
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
|
@@ -35,7 +35,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
|
|
|
35
35
|
- **Logic throws, framework catches.** Tool/resource handlers are pure — throw on failure, no `try/catch`. Plain `Error` is fine; the framework catches, classifies, and formats. Use error factories (`notFound()`, `validationError()`, etc.) when the error code matters.
|
|
36
36
|
- **Use `ctx.log`** for request-scoped logging. No `console` calls.
|
|
37
37
|
- **Use `ctx.state`** for tenant-scoped storage. Never access persistence directly.
|
|
38
|
-
- **
|
|
38
|
+
- **Need input the caller didn't supply?** `return ctx.requestInput(...)` and read `ctx.inputs` when the handler is re-entered. Never `await` for user input mid-handler.
|
|
39
39
|
- **Secrets in env vars only** — never hardcoded.
|
|
40
40
|
- **Close the loop on issues.** When implementing work tracked by a GitHub issue, comment on the issue with what landed and close it. Do both — a comment without a close leaves stale issues open; a close without a comment leaves no record of what shipped. The comment is for future readers — state the concrete changes, not the conversation that produced them.
|
|
41
41
|
|
|
@@ -158,6 +158,23 @@ export function getServerConfig() {
|
|
|
158
158
|
|
|
159
159
|
`parseEnvConfig` maps Zod schema paths → env var names so errors name the variable (`MY_API_KEY`) not the path (`apiKey`). Throws `ConfigurationError`, which the framework prints as a clean startup banner.
|
|
160
160
|
|
|
161
|
+
For env booleans use `z.stringbool()`, never `z.coerce.boolean()` — `Boolean("false")` is `true`, so a coerced flag can't be disabled through the environment. `z.stringbool()` parses `true/false/1/0/yes/no/on/off` and rejects anything else, so `=false` actually disables.
|
|
162
|
+
|
|
163
|
+
### Server identity and instructions
|
|
164
|
+
|
|
165
|
+
`createApp()` accepts optional identity fields forwarded to the SDK's `initialize` response and the server manifest (`/.well-known/mcp.json`):
|
|
166
|
+
|
|
167
|
+
```ts
|
|
168
|
+
await createApp({
|
|
169
|
+
name: 'nist-nvd-mcp-server',
|
|
170
|
+
title: 'nist-nvd-mcp-server', // human-readable display name
|
|
171
|
+
websiteUrl: 'https://github.com/cyanheads/nist-nvd-mcp-server',
|
|
172
|
+
instructions: 'Use nvd_search_cpes to resolve a product to its CPE name before auditing it.',
|
|
173
|
+
});
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
`instructions` is optional server-level orientation, sent on every `initialize` as session-level context. Use it for deployment guidance (connection aliases, regional notes, scope hints) instead of repeating the same context across tool descriptions. Client adoption is uneven, but there's no downside when set.
|
|
177
|
+
|
|
161
178
|
---
|
|
162
179
|
|
|
163
180
|
## Context
|
|
@@ -166,13 +183,13 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
166
183
|
|
|
167
184
|
| Property | Description |
|
|
168
185
|
|:---------|:------------|
|
|
169
|
-
| `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. |
|
|
186
|
+
| `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. Dual-sink: Pino **and** `notifications/message` to the client, so treat it as client-visible. |
|
|
170
187
|
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
|
|
171
|
-
| `ctx.
|
|
188
|
+
| `ctx.requestInput` | Suspend and ask the caller for more input — `return ctx.requestInput({ inputRequests: { key: inputRequired.elicit({ message, requestedSchema }) } })`. Never returns; the handler is re-entered with the answers. Always present. |
|
|
189
|
+
| `ctx.inputs` | Reader over a retried request's responses — `.accepted(key, schema)`, `.view(key)`, `.state()`, `.dropped`. Empty on the first round. |
|
|
172
190
|
| `ctx.enrich` | Success-path agent context (empty-result notices, query echo, pagination totals) — `ctx.enrich(...)` or `.notice()` / `.total()` / `.echo()` / `.truncated()`. Reaches `structuredContent` and `content[]`; lands only when the definition declares an `enrichment` block (no-op otherwise). |
|
|
173
191
|
| `ctx.content` | Non-text content blocks — `.image(data, mimeType)`, `.audio(data, mimeType)`, or `ctx.content(block)` for a raw block. Prepended to `content[]` after `format()`; never enters `structuredContent`. |
|
|
174
192
|
| `ctx.signal` | `AbortSignal` for cancellation. Forwarded to NVD HTTP requests. |
|
|
175
|
-
| `ctx.progress` | Task progress (present when `task: true`) — `.setTotal(n)`, `.increment()`, `.update(message)`. |
|
|
176
193
|
| `ctx.requestId` | Unique request ID. |
|
|
177
194
|
| `ctx.tenantId` | Tenant ID from JWT; `'default'` for stdio or HTTP with auth off. |
|
|
178
195
|
|
|
@@ -182,7 +199,7 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
182
199
|
|
|
183
200
|
Handlers throw — the framework catches, classifies, and formats.
|
|
184
201
|
|
|
185
|
-
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required
|
|
202
|
+
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required (≥ 5 words, lint-validated) — the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire (`data.recovery.hint`, mirrored into `content[]` text); override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring.
|
|
186
203
|
|
|
187
204
|
```ts
|
|
188
205
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
@@ -194,7 +211,7 @@ errors: [
|
|
|
194
211
|
],
|
|
195
212
|
async handler(input, ctx) {
|
|
196
213
|
const item = await db.find(input.id);
|
|
197
|
-
if (!item) throw ctx.fail('no_match', `No item ${input.id}
|
|
214
|
+
if (!item) throw ctx.fail('no_match', `No item ${input.id}`, ctx.recoveryFor('no_match'));
|
|
198
215
|
return item;
|
|
199
216
|
}
|
|
200
217
|
```
|
|
@@ -238,6 +255,9 @@ src/
|
|
|
238
255
|
nvd-cpe/
|
|
239
256
|
nvd-cpe-service.ts # CPE dictionary search and normalization
|
|
240
257
|
types.ts # Raw CPE response + normalized CpeRecord
|
|
258
|
+
nvd-source/
|
|
259
|
+
nvd-source-service.ts # Contributor dictionary — resolves source identifiers to names
|
|
260
|
+
types.ts # Raw source dictionary response types
|
|
241
261
|
mcp-server/
|
|
242
262
|
tools/definitions/
|
|
243
263
|
nvd-search-cves.tool.ts # nvd_search_cves
|
|
@@ -269,7 +289,7 @@ src/
|
|
|
269
289
|
|
|
270
290
|
## Skills
|
|
271
291
|
|
|
272
|
-
Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool.
|
|
292
|
+
Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool. `bun run list-skills` prints the full registry.
|
|
273
293
|
|
|
274
294
|
**Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). Skills then load as context without referencing `skills/` paths. After framework updates, run the `maintenance` skill — Phase B re-syncs the agent directory.
|
|
275
295
|
|
|
@@ -300,7 +320,7 @@ Available skills:
|
|
|
300
320
|
| `api-auth` | Auth modes, scopes, JWT/OAuth |
|
|
301
321
|
| `api-canvas` | DataCanvas: register tabular data, run SQL, export, plus the `spillover()` helper for big result sets — Tier 3 opt-in |
|
|
302
322
|
| `api-config` | AppConfig, parseConfig, env vars |
|
|
303
|
-
| `api-context` | Context interface, logger, state,
|
|
323
|
+
| `api-context` | Context interface, RequestContext, logger, state, multi-round-trip input |
|
|
304
324
|
| `api-errors` | McpError, JsonRpcErrorCode, error patterns |
|
|
305
325
|
| `api-linter` | Definition linter rule catalog — invoked by `bun run lint:mcp` and `devcheck` |
|
|
306
326
|
| `api-mirror` | MirrorService: persistent self-refreshing local mirror (embedded SQLite + FTS5) of a bulk upstream dataset — Tier 3 opt-in |
|
|
@@ -343,7 +363,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
343
363
|
|
|
344
364
|
## Bundling
|
|
345
365
|
|
|
346
|
-
`npm run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
|
|
366
|
+
`npm run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips two classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`skills/`, `.claude/`, `.agents/`, `SKILL.md`) and platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
|
|
347
367
|
|
|
348
368
|
**Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match.
|
|
349
369
|
|
|
@@ -361,14 +381,14 @@ Each per-version file opens with YAML frontmatter:
|
|
|
361
381
|
---
|
|
362
382
|
summary: "One-line headline, ≤350 chars" # required — powers the rollup index
|
|
363
383
|
breaking: false # optional — true flags breaking changes
|
|
364
|
-
security: false # optional — true
|
|
384
|
+
security: false # optional — true ONLY for a source-code security fix, never a dependency CVE bump
|
|
365
385
|
---
|
|
366
386
|
|
|
367
387
|
# 0.1.0 — YYYY-MM-DD
|
|
368
388
|
...
|
|
369
389
|
```
|
|
370
390
|
|
|
371
|
-
`breaking: true` renders a `· ⚠️ Breaking` badge — use it when consumers must update code on upgrade (signature changes, removed APIs, config renames). `security: true` renders a `· 🛡️ Security` badge and pairs with a `## Security` body section. When both are set, badges render `· ⚠️ Breaking · 🛡️ Security`.
|
|
391
|
+
`breaking: true` renders a `· ⚠️ Breaking` badge — use it when consumers must update code on upgrade (signature changes, removed APIs, config renames). `security: true` renders a `· 🛡️ Security` badge and pairs with a `## Security` body section — set it only for a security fix in this server's *own source code*, never for a routine dependency or transitive CVE bump (record those under `## Dependencies`). When both are set, badges render `· ⚠️ Breaking · 🛡️ Security`.
|
|
372
392
|
|
|
373
393
|
`agent-notes` is an optional free-form field for maintenance agents processing the release downstream. Content here won't appear in the rendered CHANGELOG — it's consumed by agents running the `maintenance` skill. Use it for adoption instructions that don't fit the human-facing sections: new files to create, fields to populate, one-time migration steps. Omit entirely when there's nothing to say.
|
|
374
394
|
|
package/CLAUDE.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** nist-nvd-mcp-server
|
|
4
|
-
**Version:** 0.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.
|
|
4
|
+
**Version:** 0.3.0
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.12.3`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
|
-
**MCP SDK:** `@modelcontextprotocol/
|
|
7
|
+
**MCP SDK:** `@modelcontextprotocol/server` ^2.0.0
|
|
8
8
|
**Zod:** ^4.4.3
|
|
9
9
|
|
|
10
10
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
|
@@ -35,7 +35,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
|
|
|
35
35
|
- **Logic throws, framework catches.** Tool/resource handlers are pure — throw on failure, no `try/catch`. Plain `Error` is fine; the framework catches, classifies, and formats. Use error factories (`notFound()`, `validationError()`, etc.) when the error code matters.
|
|
36
36
|
- **Use `ctx.log`** for request-scoped logging. No `console` calls.
|
|
37
37
|
- **Use `ctx.state`** for tenant-scoped storage. Never access persistence directly.
|
|
38
|
-
- **
|
|
38
|
+
- **Need input the caller didn't supply?** `return ctx.requestInput(...)` and read `ctx.inputs` when the handler is re-entered. Never `await` for user input mid-handler.
|
|
39
39
|
- **Secrets in env vars only** — never hardcoded.
|
|
40
40
|
- **Close the loop on issues.** When implementing work tracked by a GitHub issue, comment on the issue with what landed and close it. Do both — a comment without a close leaves stale issues open; a close without a comment leaves no record of what shipped. The comment is for future readers — state the concrete changes, not the conversation that produced them.
|
|
41
41
|
|
|
@@ -158,6 +158,23 @@ export function getServerConfig() {
|
|
|
158
158
|
|
|
159
159
|
`parseEnvConfig` maps Zod schema paths → env var names so errors name the variable (`MY_API_KEY`) not the path (`apiKey`). Throws `ConfigurationError`, which the framework prints as a clean startup banner.
|
|
160
160
|
|
|
161
|
+
For env booleans use `z.stringbool()`, never `z.coerce.boolean()` — `Boolean("false")` is `true`, so a coerced flag can't be disabled through the environment. `z.stringbool()` parses `true/false/1/0/yes/no/on/off` and rejects anything else, so `=false` actually disables.
|
|
162
|
+
|
|
163
|
+
### Server identity and instructions
|
|
164
|
+
|
|
165
|
+
`createApp()` accepts optional identity fields forwarded to the SDK's `initialize` response and the server manifest (`/.well-known/mcp.json`):
|
|
166
|
+
|
|
167
|
+
```ts
|
|
168
|
+
await createApp({
|
|
169
|
+
name: 'nist-nvd-mcp-server',
|
|
170
|
+
title: 'nist-nvd-mcp-server', // human-readable display name
|
|
171
|
+
websiteUrl: 'https://github.com/cyanheads/nist-nvd-mcp-server',
|
|
172
|
+
instructions: 'Use nvd_search_cpes to resolve a product to its CPE name before auditing it.',
|
|
173
|
+
});
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
`instructions` is optional server-level orientation, sent on every `initialize` as session-level context. Use it for deployment guidance (connection aliases, regional notes, scope hints) instead of repeating the same context across tool descriptions. Client adoption is uneven, but there's no downside when set.
|
|
177
|
+
|
|
161
178
|
---
|
|
162
179
|
|
|
163
180
|
## Context
|
|
@@ -166,13 +183,13 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
166
183
|
|
|
167
184
|
| Property | Description |
|
|
168
185
|
|:---------|:------------|
|
|
169
|
-
| `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. |
|
|
186
|
+
| `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. Dual-sink: Pino **and** `notifications/message` to the client, so treat it as client-visible. |
|
|
170
187
|
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
|
|
171
|
-
| `ctx.
|
|
188
|
+
| `ctx.requestInput` | Suspend and ask the caller for more input — `return ctx.requestInput({ inputRequests: { key: inputRequired.elicit({ message, requestedSchema }) } })`. Never returns; the handler is re-entered with the answers. Always present. |
|
|
189
|
+
| `ctx.inputs` | Reader over a retried request's responses — `.accepted(key, schema)`, `.view(key)`, `.state()`, `.dropped`. Empty on the first round. |
|
|
172
190
|
| `ctx.enrich` | Success-path agent context (empty-result notices, query echo, pagination totals) — `ctx.enrich(...)` or `.notice()` / `.total()` / `.echo()` / `.truncated()`. Reaches `structuredContent` and `content[]`; lands only when the definition declares an `enrichment` block (no-op otherwise). |
|
|
173
191
|
| `ctx.content` | Non-text content blocks — `.image(data, mimeType)`, `.audio(data, mimeType)`, or `ctx.content(block)` for a raw block. Prepended to `content[]` after `format()`; never enters `structuredContent`. |
|
|
174
192
|
| `ctx.signal` | `AbortSignal` for cancellation. Forwarded to NVD HTTP requests. |
|
|
175
|
-
| `ctx.progress` | Task progress (present when `task: true`) — `.setTotal(n)`, `.increment()`, `.update(message)`. |
|
|
176
193
|
| `ctx.requestId` | Unique request ID. |
|
|
177
194
|
| `ctx.tenantId` | Tenant ID from JWT; `'default'` for stdio or HTTP with auth off. |
|
|
178
195
|
|
|
@@ -182,7 +199,7 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
182
199
|
|
|
183
200
|
Handlers throw — the framework catches, classifies, and formats.
|
|
184
201
|
|
|
185
|
-
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required
|
|
202
|
+
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required (≥ 5 words, lint-validated) — the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire (`data.recovery.hint`, mirrored into `content[]` text); override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring.
|
|
186
203
|
|
|
187
204
|
```ts
|
|
188
205
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
@@ -194,7 +211,7 @@ errors: [
|
|
|
194
211
|
],
|
|
195
212
|
async handler(input, ctx) {
|
|
196
213
|
const item = await db.find(input.id);
|
|
197
|
-
if (!item) throw ctx.fail('no_match', `No item ${input.id}
|
|
214
|
+
if (!item) throw ctx.fail('no_match', `No item ${input.id}`, ctx.recoveryFor('no_match'));
|
|
198
215
|
return item;
|
|
199
216
|
}
|
|
200
217
|
```
|
|
@@ -238,6 +255,9 @@ src/
|
|
|
238
255
|
nvd-cpe/
|
|
239
256
|
nvd-cpe-service.ts # CPE dictionary search and normalization
|
|
240
257
|
types.ts # Raw CPE response + normalized CpeRecord
|
|
258
|
+
nvd-source/
|
|
259
|
+
nvd-source-service.ts # Contributor dictionary — resolves source identifiers to names
|
|
260
|
+
types.ts # Raw source dictionary response types
|
|
241
261
|
mcp-server/
|
|
242
262
|
tools/definitions/
|
|
243
263
|
nvd-search-cves.tool.ts # nvd_search_cves
|
|
@@ -269,7 +289,7 @@ src/
|
|
|
269
289
|
|
|
270
290
|
## Skills
|
|
271
291
|
|
|
272
|
-
Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool.
|
|
292
|
+
Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool. `bun run list-skills` prints the full registry.
|
|
273
293
|
|
|
274
294
|
**Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). Skills then load as context without referencing `skills/` paths. After framework updates, run the `maintenance` skill — Phase B re-syncs the agent directory.
|
|
275
295
|
|
|
@@ -300,7 +320,7 @@ Available skills:
|
|
|
300
320
|
| `api-auth` | Auth modes, scopes, JWT/OAuth |
|
|
301
321
|
| `api-canvas` | DataCanvas: register tabular data, run SQL, export, plus the `spillover()` helper for big result sets — Tier 3 opt-in |
|
|
302
322
|
| `api-config` | AppConfig, parseConfig, env vars |
|
|
303
|
-
| `api-context` | Context interface, logger, state,
|
|
323
|
+
| `api-context` | Context interface, RequestContext, logger, state, multi-round-trip input |
|
|
304
324
|
| `api-errors` | McpError, JsonRpcErrorCode, error patterns |
|
|
305
325
|
| `api-linter` | Definition linter rule catalog — invoked by `bun run lint:mcp` and `devcheck` |
|
|
306
326
|
| `api-mirror` | MirrorService: persistent self-refreshing local mirror (embedded SQLite + FTS5) of a bulk upstream dataset — Tier 3 opt-in |
|
|
@@ -343,7 +363,7 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
343
363
|
|
|
344
364
|
## Bundling
|
|
345
365
|
|
|
346
|
-
`npm run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
|
|
366
|
+
`npm run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips two classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`skills/`, `.claude/`, `.agents/`, `SKILL.md`) and platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
|
|
347
367
|
|
|
348
368
|
**Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match.
|
|
349
369
|
|
|
@@ -361,14 +381,14 @@ Each per-version file opens with YAML frontmatter:
|
|
|
361
381
|
---
|
|
362
382
|
summary: "One-line headline, ≤350 chars" # required — powers the rollup index
|
|
363
383
|
breaking: false # optional — true flags breaking changes
|
|
364
|
-
security: false # optional — true
|
|
384
|
+
security: false # optional — true ONLY for a source-code security fix, never a dependency CVE bump
|
|
365
385
|
---
|
|
366
386
|
|
|
367
387
|
# 0.1.0 — YYYY-MM-DD
|
|
368
388
|
...
|
|
369
389
|
```
|
|
370
390
|
|
|
371
|
-
`breaking: true` renders a `· ⚠️ Breaking` badge — use it when consumers must update code on upgrade (signature changes, removed APIs, config renames). `security: true` renders a `· 🛡️ Security` badge and pairs with a `## Security` body section. When both are set, badges render `· ⚠️ Breaking · 🛡️ Security`.
|
|
391
|
+
`breaking: true` renders a `· ⚠️ Breaking` badge — use it when consumers must update code on upgrade (signature changes, removed APIs, config renames). `security: true` renders a `· 🛡️ Security` badge and pairs with a `## Security` body section — set it only for a security fix in this server's *own source code*, never for a routine dependency or transitive CVE bump (record those under `## Dependencies`). When both are set, badges render `· ⚠️ Breaking · 🛡️ Security`.
|
|
372
392
|
|
|
373
393
|
`agent-notes` is an optional free-form field for maintenance agents processing the release downstream. Content here won't appear in the rendered CHANGELOG — it's consumed by agents running the `maintenance` skill. Use it for adoption instructions that don't fit the human-facing sections: new files to create, fields to populate, one-time migration steps. Omit entirely when there's nothing to say.
|
|
374
394
|
|
package/Dockerfile
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# This stage installs all dependencies (including dev), builds the TypeScript
|
|
5
5
|
# source code into JavaScript, and prepares the production assets.
|
|
6
6
|
# ==============================================================================
|
|
7
|
-
FROM oven/bun:1.
|
|
7
|
+
FROM oven/bun:1.4.0 AS build
|
|
8
8
|
|
|
9
9
|
WORKDIR /usr/src/app
|
|
10
10
|
|
|
@@ -30,7 +30,7 @@ RUN bun run build
|
|
|
30
30
|
# application. It uses a slim base image and only includes production
|
|
31
31
|
# dependencies and build artifacts.
|
|
32
32
|
# ==============================================================================
|
|
33
|
-
FROM oven/bun:1.
|
|
33
|
+
FROM oven/bun:1.4.0-slim AS production
|
|
34
34
|
|
|
35
35
|
WORKDIR /usr/src/app
|
|
36
36
|
|
|
@@ -51,8 +51,13 @@ COPY package.json bun.lock ./
|
|
|
51
51
|
|
|
52
52
|
# Install only production dependencies, ignoring any lifecycle scripts (like 'prepare')
|
|
53
53
|
# that are not needed in the final production image.
|
|
54
|
+
# `--omit=peer` drops the framework's optional peer tiers (test runner, service
|
|
55
|
+
# SDKs, parsers) that Bun would otherwise auto-install. Anything this server
|
|
56
|
+
# actually imports belongs in its own `dependencies`, so nothing needed at
|
|
57
|
+
# runtime is lost. The OTEL step below carries the same flag — without it, that
|
|
58
|
+
# install re-resolves the graph and pulls every optional peer back in.
|
|
54
59
|
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
55
|
-
bun install --production --frozen-lockfile --ignore-scripts
|
|
60
|
+
bun install --production --omit=peer --frozen-lockfile --ignore-scripts
|
|
56
61
|
|
|
57
62
|
# Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
|
|
58
63
|
# These are not bundled by default to keep the base image lean. Enable at build time
|
|
@@ -60,7 +65,7 @@ RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
|
60
65
|
ARG OTEL_ENABLED=true
|
|
61
66
|
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
62
67
|
if [ "$OTEL_ENABLED" = "true" ]; then \
|
|
63
|
-
bun add --omit=dev --ignore-scripts @hono/otel \
|
|
68
|
+
bun add --omit=dev --omit=peer --ignore-scripts @hono/otel \
|
|
64
69
|
@opentelemetry/instrumentation-http \
|
|
65
70
|
@opentelemetry/exporter-metrics-otlp-http \
|
|
66
71
|
@opentelemetry/exporter-trace-otlp-http \
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/nist-nvd-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/nist-nvd-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -294,6 +294,7 @@ The Dockerfile defaults to HTTP transport, stateless session mode, and logs to `
|
|
|
294
294
|
| `src/services/nvd-http` | NVD HTTP client with rate-limit pacing and retry. |
|
|
295
295
|
| `src/services/nvd-cve` | CVE service — search, fetch-by-ID, CPE audit, change history, normalization. |
|
|
296
296
|
| `src/services/nvd-cpe` | CPE service — dictionary search and normalization. |
|
|
297
|
+
| `src/services/nvd-source` | Source service — resolves NVD contributor identifiers to their published names. |
|
|
297
298
|
| `tests/` | Unit and integration tests mirroring `src/`. |
|
|
298
299
|
|
|
299
300
|
## Development guide
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "weaknesses[].source and references[].source now resolve NVD's contributor identifiers to published names (e.g. CVE, CISA-ADP) instead of raw GUIDs — a breaking value-format change with no schema change to warn consumers on upgrade."
|
|
3
|
+
breaking: true
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.2.0 — 2026-07-31
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- **`NvdSourceService`** (`src/services/nvd-source/`) — fetches NVD's source dictionary (`/rest/json/source/2.0`) once per process, cached behind a 24-hour TTL with single-flighted loads so a burst of tool calls shares one upstream request. ([#46](https://github.com/cyanheads/nist-nvd-mcp-server/issues/46))
|
|
12
|
+
|
|
13
|
+
## Changed
|
|
14
|
+
|
|
15
|
+
- **`weaknesses[].source` and `references[].source` resolve to NVD's published contributor name** instead of the raw source identifier — `af854a3a-2127-422b-91ae-364da2661108` now emits `CVE`, `134c704f-9b21-4f2e-91b3-4a467353bcc0` emits `CISA-ADP`. Email-form identifiers (`security@apache.org`) are left untouched, and an identifier absent from the dictionary passes through as its raw value. Resolution happens in `normalizeCve()`, so both `nvd_get_cve` and `nvd_audit_cpe` inherit it. **⚠️ Breaking:** the raw GUID is not preserved in any sibling field — a consumer string-matching the old value breaks on upgrade with no schema change to warn it. ([#46](https://github.com/cyanheads/nist-nvd-mcp-server/issues/46))
|
|
16
|
+
- **`nvd_get_cve` and `nvd_audit_cpe`'s `source` field descriptions** now say the value is the resolved contributor name and that an unresolvable identifier passes through as-is.
|
|
17
|
+
|
|
18
|
+
## Fixed
|
|
19
|
+
|
|
20
|
+
- **A dictionary lookup could stall a CVE fetch for the full CVE retry budget** — `NvdSourceService` loaded `source/2.0` through the same client used for CVE requests, so an unreachable dictionary spent every retry attempt and timeout the keyed CVE budget allows. `NvdHttpClient.get` gained an optional per-request `NvdRequestBudget` (`maxRetries`, `timeoutMs`), and the source service now loads on a bounded budget (`maxRetries: 0`, `timeoutMs: 3_000`) instead of inheriting the caller's.
|
|
21
|
+
- **A caller-cancelled dictionary load was recorded as an upstream outage** — cancelling the load (the caller's own `ctx.signal` aborting) set the same 5-minute failure TTL as a real NVD outage, degrading every subsequent caller to raw identifiers for that window. The load now checks `ctx.signal.aborted` before treating a failure as an outage and leaves the cache untouched on cancellation.
|
|
22
|
+
- **`nvd_get_cve` with `brief: true` resolved source names it then discarded** — brief rows carry no `source` field, so resolving one spent an upstream dictionary request (on a cold cache) for values `toBriefCve` drops. `nvd_get_cve` now passes `resolveSources: false` for brief fetches, and `nvd_search_cves` never resolves at all.
|
|
23
|
+
|
|
24
|
+
## Dependencies
|
|
25
|
+
|
|
26
|
+
- `@biomejs/biome` ^2.5.5 → ^2.5.6
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "nvd_get_cve and nvd_audit_cpe replace their configurations output field with configurationNodes — a flat array of nodes, each tagged with the group it came from — on mcp-ts-core 0.12.3."
|
|
3
|
+
breaking: true
|
|
4
|
+
security: false
|
|
5
|
+
agent-notes: |
|
|
6
|
+
A consumer reading `configurations` moves to `configurationNodes` and reaches
|
|
7
|
+
criteria one level shallower: `configurationNodes[].cpeMatch[]` rather than
|
|
8
|
+
`configurations[].nodes[].cpeMatch[]`. Group membership rides each node as
|
|
9
|
+
`groupIndex`, and the single `operator` splits into `groupOperator` and
|
|
10
|
+
`nodeOperator`.
|
|
11
|
+
|
|
12
|
+
Tool inputs are strict on `@cyanheads/mcp-ts-core` 0.12.x — a call carrying an
|
|
13
|
+
argument key the schema does not declare now comes back as an error naming
|
|
14
|
+
that key instead of having it stripped.
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# 0.3.0 — 2026-08-24
|
|
18
|
+
|
|
19
|
+
## Added
|
|
20
|
+
|
|
21
|
+
- **`.github/CONTRIBUTING.md` and `.github/CODE_OF_CONDUCT.md`** — how to tell a server bug from a framework bug before filing, what makes a report actionable, and the project's conduct rules.
|
|
22
|
+
|
|
23
|
+
## Changed
|
|
24
|
+
|
|
25
|
+
- **`nvd_get_cve` and `nvd_audit_cpe` emit `configurationNodes` in place of `configurations`.** One entry per upstream node, carrying `groupIndex`, `groupOperator`, `nodeOperator`, and its own `cpeMatch[]`, so criteria sit one level shallower. Hoisting the group rather than the node is what keeps `(X1.0 OR X1.1) AND Y` distinguishable from `X1.0 AND X1.1 AND Y`.
|
|
26
|
+
- **Rendered CPE match lines label the vulnerable component in both directions.** A match that is the vulnerable component reads `vulnerable component`; previously only the negative case was labelled and the affirmative one said nothing.
|
|
27
|
+
- **The `Configurations:` summary line reports group, node, and match counts.** It previously reported node-group and match counts, which under the new shape would have counted nodes as groups.
|
|
28
|
+
- **Tool inputs are strict.** An argument key a tool's schema does not declare is rejected by name as an error result rather than silently stripped.
|
|
29
|
+
- **The advertised `outputSchema` declares the error envelope.** A client that validates `structuredContent` without checking `isError` no longer rejects an error result with `-32602`.
|
|
30
|
+
- **Advertised JSON Schema is 2020-12**, not draft-07.
|
|
31
|
+
- **Protocol revision 2026-07-28 is served on every HTTP endpoint**, alongside the 2025-era revisions negotiated at `initialize`.
|
|
32
|
+
- **`transport.sessionMode` reports the mode the server resolved to**, never `auto`, on both the landing page and `/.well-known/mcp.json`.
|
|
33
|
+
- **`ctx.log` output reaches the client** as `notifications/message`, gated by the client's `logging/setLevel`.
|
|
34
|
+
- **`.env.example` sets `MCP_SESSION_MODE=stateless` explicitly**, so a source run resolves the mode the `Dockerfile` already set; the file previously documented the `stateful` default.
|
|
35
|
+
- **The production Docker stage installs with `--omit=peer`** on both its `bun install` and its OpenTelemetry `bun add`, keeping the framework's optional peer tiers out of the runtime image.
|
|
36
|
+
- **Repo tooling resync** — `tsconfig.json` typechecks `src/` and `tests/` under `noEmit` with emit split into `tsconfig.build.json`, `scripts/tree.ts` honors directory-only gitignore patterns, and the shipped `skills/` are re-synced to the 0.12.x framework.
|
|
37
|
+
|
|
38
|
+
## Dependencies
|
|
39
|
+
|
|
40
|
+
- `@cyanheads/mcp-ts-core` `^0.11.0` → `^0.12.3`
|
|
41
|
+
- `@biomejs/biome` `^2.5.6` → `^2.5.10`
|
|
42
|
+
- `@types/node` `^26.1.2` → `^26.2.0`
|
|
43
|
+
- `tsc-alias` `^1.9.1` → `^1.9.2`
|
|
44
|
+
- `typescript` `^6.0.3` → `^7.0.2`
|
|
45
|
+
- `vitest` `^4.1.10` → `^4.1.11`
|
|
46
|
+
- `packageManager` `bun@1.3.14` → `bun@1.4.0`, matching the pins in both `Dockerfile` stages. `engines.bun` stays `>=1.3.0`.
|
|
47
|
+
- The framework's MCP SDK moves from `@modelcontextprotocol/sdk` `^1.29.0` to `@modelcontextprotocol/server` `^2.0.0`; this server imports neither directly.
|
|
48
|
+
- The framework gap also carries upstream security hardening: `rejectPrivateIPs` now range-checks the full non-global IP surface instead of pattern-matching prefixes, and credentials, query strings, and fragments are stripped from resource URIs before they reach logs or telemetry.
|
package/changelog/template.md
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
# to author a new release. Set that file's H1 to `# <version> — YYYY-MM-DD`
|
|
5
5
|
# with a concrete date.
|
|
6
6
|
|
|
7
|
-
# Required. One-line GitHub Release-style headline. 350 character cap
|
|
8
|
-
# Default short and scannable. Don't pad, don't stitch
|
|
9
|
-
#
|
|
10
|
-
#
|
|
7
|
+
# Required. One-line GitHub Release-style headline. 350 character cap — a
|
|
8
|
+
# ceiling, not a target. Default short and scannable. Don't pad, don't stitch
|
|
9
|
+
# unrelated changes with commas/semicolons into an inventory — pick the
|
|
10
|
+
# headline, like a tag's theme line. Quotes required: unquoted YAML treats
|
|
11
|
+
# `: ` inside the value as a key separator and fails GitHub's strict parser.
|
|
11
12
|
summary: ""
|
|
12
13
|
|
|
13
14
|
# Set `true` when consumers must change code to upgrade: API removals,
|
|
@@ -24,9 +25,10 @@ security: false
|
|
|
24
25
|
|
|
25
26
|
# Optional free-form notes for maintenance agents processing this release.
|
|
26
27
|
# Not rendered in CHANGELOG — consumed by agents running `maintenance` on
|
|
27
|
-
# downstream servers.
|
|
28
|
-
#
|
|
29
|
-
#
|
|
28
|
+
# downstream servers. ADOPTION STEPS ONLY — new files to create, fields to
|
|
29
|
+
# populate, one-time migration steps. Never a second rendering of the body:
|
|
30
|
+
# if a body bullet already says it, name the bullet's symbol instead of
|
|
31
|
+
# re-explaining. Omit the field entirely when there's nothing to say.
|
|
30
32
|
# agent-notes: |
|
|
31
33
|
# <instructions for downstream maintenance agents>
|
|
32
34
|
---
|
|
@@ -41,17 +43,54 @@ security: false
|
|
|
41
43
|
each bullet with the symbol or concept name in **bold** so they can skip
|
|
42
44
|
what's irrelevant and zoom in on what's not.
|
|
43
45
|
|
|
44
|
-
Tone: terse, fact-dense, not verbose.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
Tone: terse, fact-dense, not verbose. Bullet shape: **symbol** + what
|
|
47
|
+
changed + at most one consumer-facing caveat. One sentence by default, two
|
|
48
|
+
when the second carries weight — a bullet past ~40 words or three sentences
|
|
49
|
+
is wrong. The depth lives one hop away: the linked issue carries the why,
|
|
50
|
+
the commit diff carries the how. The changelog names what changed and what
|
|
51
|
+
a consumer does about it; a reader who wants mechanism opens the link.
|
|
52
|
+
|
|
53
|
+
Model length on THIS guide, never on the previous entry — entries modeled
|
|
54
|
+
on entries compound.
|
|
55
|
+
|
|
56
|
+
Cut (each has shipped as a wall of text; these are the cruft):
|
|
57
|
+
- History/justification narration — how the bug worked, why the old
|
|
58
|
+
behavior was wrong. One short clause at most; the issue carries the story.
|
|
59
|
+
- Design-rationale defense — "chosen over Y because…", "guarding the
|
|
60
|
+
getter is not enough…". That is the author arguing with a reviewer;
|
|
61
|
+
reviewers read the PR, not the changelog.
|
|
62
|
+
- Defensive unchanged-clauses — "X is unchanged", "byte-identical to
|
|
63
|
+
<prev>". Keep one only where its absence would cause a real misread,
|
|
64
|
+
as a short parenthetical.
|
|
65
|
+
- Edge-case inventories — marker lists, not-flagged lists, escape tables.
|
|
66
|
+
Tests and the issue carry those.
|
|
67
|
+
- Mechanism walkthroughs (JSDoc, CLAUDE.md/AGENTS.md, or the relevant
|
|
68
|
+
skill own those), ceremonial framings ("This release introduces…"),
|
|
69
|
+
backwards-compat paragraphs, file-by-file test enumerations. Prefer
|
|
70
|
+
code/symbol names over English re-explanations.
|
|
71
|
+
|
|
72
|
+
Verified ≠ included: the every-claim-verified-from-the-diff rule bounds
|
|
73
|
+
the TRUTH of what you write, never the AMOUNT.
|
|
74
|
+
|
|
75
|
+
Example — same fact, right size:
|
|
76
|
+
|
|
77
|
+
TOO LONG: **`fetchWithTimeout`'s `timeoutMs` bounds the whole exchange**
|
|
78
|
+
(#341). `fetch` resolves once headers arrive and the deadline was
|
|
79
|
+
cleared as the helper returned, so a peer that answered promptly and
|
|
80
|
+
then stalled the stream held the request open indefinitely. A 2xx
|
|
81
|
+
carrying a body now comes back as a passthrough wrapper that disarms
|
|
82
|
+
the deadline when the body closes, errors, or is cancelled; …
|
|
83
|
+
[+90 more words of mechanism and edge cases]
|
|
84
|
+
|
|
85
|
+
RIGHT: **`fetchWithTimeout`'s `timeoutMs` now bounds the whole
|
|
86
|
+
exchange, not just the headers** (#341). A stalled body aborts with
|
|
87
|
+
the same `Timeout` error; the returned `Response` is a wrapper, so
|
|
88
|
+
identity assertions (`toBe(response)`) no longer hold.
|
|
52
89
|
|
|
53
90
|
Narrative intro: skip by default. Add one short sentence only when the
|
|
54
|
-
release theme genuinely needs framing the bullets can't carry.
|
|
91
|
+
release theme genuinely needs framing the bullets can't carry. When many
|
|
92
|
+
bullets share one upgrade consequence, state it ONCE — intro line or
|
|
93
|
+
agent-notes — never per bullet.
|
|
55
94
|
|
|
56
95
|
Sections: Keep a Changelog order — Added, Changed, Deprecated, Removed,
|
|
57
96
|
Fixed, Security. Include only sections with entries; delete the rest
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import { nvdAuditCpe, nvdGetCve, nvdGetCveHistory, nvdSearchCpes, nvdSearchCves,
|
|
|
11
11
|
import { initNvdCpeService } from './services/nvd-cpe/nvd-cpe-service.js';
|
|
12
12
|
import { initNvdCveService } from './services/nvd-cve/nvd-cve-service.js';
|
|
13
13
|
import { initNvdHttpClient } from './services/nvd-http/nvd-http-client.js';
|
|
14
|
+
import { initNvdSourceService } from './services/nvd-source/nvd-source-service.js';
|
|
14
15
|
await createApp({
|
|
15
16
|
name: 'nist-nvd-mcp-server',
|
|
16
17
|
title: 'nist-nvd-mcp-server',
|
|
@@ -29,6 +30,7 @@ await createApp({
|
|
|
29
30
|
initNvdHttpClient(cfg.apiKey, cfg.requestTimeoutMs);
|
|
30
31
|
initNvdCveService(core.config, core.storage);
|
|
31
32
|
initNvdCpeService(core.config, core.storage);
|
|
33
|
+
initNvdSourceService(core.config, core.storage);
|
|
32
34
|
},
|
|
33
35
|
});
|
|
34
36
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAC7E,OAAO,EACL,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,aAAa,GACd,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAC7E,OAAO,EACL,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,aAAa,GACd,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAEnF,MAAM,SAAS,CAAC;IACd,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,qBAAqB;IAC5B,KAAK,EAAE,CAAC,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,gBAAgB,CAAC;IAC/E,SAAS,EAAE,CAAC,cAAc,CAAC;IAC3B,OAAO,EAAE,EAAE;IACX,YAAY,EACV,4FAA4F;QAC5F,qGAAqG;QACrG,qFAAqF;QACrF,qFAAqF;QACrF,8EAA8E;QAC9E,6EAA6E;QAC7E,uEAAuE;IAEzE,KAAK,CAAC,IAAI;QACR,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;QAC9B,iBAAiB,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;QACpD,iBAAiB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7C,iBAAiB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7C,oBAAoB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -9,19 +9,19 @@ export declare const nvdAuditCpe: import("@cyanheads/mcp-ts-core").ToolDefinitio
|
|
|
9
9
|
virtualMatchString: z.ZodOptional<z.ZodString>;
|
|
10
10
|
versionStart: z.ZodOptional<z.ZodString>;
|
|
11
11
|
versionStartType: z.ZodDefault<z.ZodEnum<{
|
|
12
|
-
including: "including";
|
|
13
12
|
excluding: "excluding";
|
|
13
|
+
including: "including";
|
|
14
14
|
}>>;
|
|
15
15
|
versionEnd: z.ZodOptional<z.ZodString>;
|
|
16
16
|
versionEndType: z.ZodDefault<z.ZodEnum<{
|
|
17
|
-
including: "including";
|
|
18
17
|
excluding: "excluding";
|
|
18
|
+
including: "including";
|
|
19
19
|
}>>;
|
|
20
20
|
severityMin: z.ZodOptional<z.ZodEnum<{
|
|
21
|
+
CRITICAL: "CRITICAL";
|
|
22
|
+
HIGH: "HIGH";
|
|
21
23
|
LOW: "LOW";
|
|
22
24
|
MEDIUM: "MEDIUM";
|
|
23
|
-
HIGH: "HIGH";
|
|
24
|
-
CRITICAL: "CRITICAL";
|
|
25
25
|
}>>;
|
|
26
26
|
allLanguages: z.ZodDefault<z.ZodBoolean>;
|
|
27
27
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
@@ -52,18 +52,17 @@ export declare const nvdAuditCpe: import("@cyanheads/mcp-ts-core").ToolDefinitio
|
|
|
52
52
|
source: z.ZodString;
|
|
53
53
|
cweIds: z.ZodArray<z.ZodString>;
|
|
54
54
|
}, z.core.$strip>>;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}, z.core.$strip>>;
|
|
55
|
+
configurationNodes: z.ZodArray<z.ZodObject<{
|
|
56
|
+
groupIndex: z.ZodNumber;
|
|
57
|
+
groupOperator: z.ZodOptional<z.ZodString>;
|
|
58
|
+
nodeOperator: z.ZodOptional<z.ZodString>;
|
|
59
|
+
cpeMatch: z.ZodArray<z.ZodObject<{
|
|
60
|
+
vulnerable: z.ZodBoolean;
|
|
61
|
+
criteria: z.ZodString;
|
|
62
|
+
versionStartIncluding: z.ZodOptional<z.ZodString>;
|
|
63
|
+
versionStartExcluding: z.ZodOptional<z.ZodString>;
|
|
64
|
+
versionEndIncluding: z.ZodOptional<z.ZodString>;
|
|
65
|
+
versionEndExcluding: z.ZodOptional<z.ZodString>;
|
|
67
66
|
}, z.core.$strip>>;
|
|
68
67
|
}, z.core.$strip>>;
|
|
69
68
|
references: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nvd-audit-cpe.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/nvd-audit-cpe.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"nvd-audit-cpe.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/nvd-audit-cpe.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAcjE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsVtB,CAAC"}
|