@cyanheads/nist-nvd-mcp-server 0.1.3
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 +410 -0
- package/CLAUDE.md +410 -0
- package/Dockerfile +99 -0
- package/LICENSE +201 -0
- package/README.md +306 -0
- package/changelog/0.1.x/0.1.0.md +19 -0
- package/changelog/0.1.x/0.1.1.md +29 -0
- package/changelog/0.1.x/0.1.2.md +12 -0
- package/changelog/0.1.x/0.1.3.md +22 -0
- package/changelog/template.md +119 -0
- package/dist/config/server-config.d.ts +15 -0
- package/dist/config/server-config.d.ts.map +1 -0
- package/dist/config/server-config.js +27 -0
- package/dist/config/server-config.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/resources/definitions/index.d.ts +6 -0
- package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/index.js +6 -0
- package/dist/mcp-server/resources/definitions/index.js.map +1 -0
- package/dist/mcp-server/resources/definitions/nvd-cve.resource.d.ts +9 -0
- package/dist/mcp-server/resources/definitions/nvd-cve.resource.d.ts.map +1 -0
- package/dist/mcp-server/resources/definitions/nvd-cve.resource.js +36 -0
- package/dist/mcp-server/resources/definitions/nvd-cve.resource.js.map +1 -0
- package/dist/mcp-server/tools/definitions/index.d.ts +10 -0
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/index.js +10 -0
- package/dist/mcp-server/tools/definitions/index.js.map +1 -0
- package/dist/mcp-server/tools/definitions/nvd-audit-cpe.tool.d.ts +116 -0
- package/dist/mcp-server/tools/definitions/nvd-audit-cpe.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/nvd-audit-cpe.tool.js +329 -0
- package/dist/mcp-server/tools/definitions/nvd-audit-cpe.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/nvd-get-cve-history.tool.d.ts +45 -0
- package/dist/mcp-server/tools/definitions/nvd-get-cve-history.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/nvd-get-cve-history.tool.js +132 -0
- package/dist/mcp-server/tools/definitions/nvd-get-cve-history.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/nvd-get-cve.tool.d.ts +36 -0
- package/dist/mcp-server/tools/definitions/nvd-get-cve.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/nvd-get-cve.tool.js +183 -0
- package/dist/mcp-server/tools/definitions/nvd-get-cve.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/nvd-search-cpes.tool.d.ts +40 -0
- package/dist/mcp-server/tools/definitions/nvd-search-cpes.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/nvd-search-cpes.tool.js +140 -0
- package/dist/mcp-server/tools/definitions/nvd-search-cpes.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/nvd-search-cves.tool.d.ts +90 -0
- package/dist/mcp-server/tools/definitions/nvd-search-cves.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/nvd-search-cves.tool.js +342 -0
- package/dist/mcp-server/tools/definitions/nvd-search-cves.tool.js.map +1 -0
- package/dist/services/nvd-cpe/nvd-cpe-service.d.ts +27 -0
- package/dist/services/nvd-cpe/nvd-cpe-service.d.ts.map +1 -0
- package/dist/services/nvd-cpe/nvd-cpe-service.js +58 -0
- package/dist/services/nvd-cpe/nvd-cpe-service.js.map +1 -0
- package/dist/services/nvd-cpe/types.d.ts +41 -0
- package/dist/services/nvd-cpe/types.d.ts.map +1 -0
- package/dist/services/nvd-cpe/types.js +6 -0
- package/dist/services/nvd-cpe/types.js.map +1 -0
- package/dist/services/nvd-cve/nvd-cve-service.d.ts +79 -0
- package/dist/services/nvd-cve/nvd-cve-service.d.ts.map +1 -0
- package/dist/services/nvd-cve/nvd-cve-service.js +345 -0
- package/dist/services/nvd-cve/nvd-cve-service.js.map +1 -0
- package/dist/services/nvd-cve/types.d.ts +185 -0
- package/dist/services/nvd-cve/types.d.ts.map +1 -0
- package/dist/services/nvd-cve/types.js +6 -0
- package/dist/services/nvd-cve/types.js.map +1 -0
- package/dist/services/nvd-http/nvd-http-client.d.ts +26 -0
- package/dist/services/nvd-http/nvd-http-client.d.ts.map +1 -0
- package/dist/services/nvd-http/nvd-http-client.js +175 -0
- package/dist/services/nvd-http/nvd-http-client.js.map +1 -0
- package/package.json +91 -0
- package/server.json +125 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2025 Casey Hand @cyanheads
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>@cyanheads/nist-nvd-mcp-server</h1>
|
|
3
|
+
<p><b>Search and audit CVEs by keyword, severity, CWE, CISA KEV status, and CPE via the NIST National Vulnerability Database. STDIO or Streamable HTTP.</b>
|
|
4
|
+
<div>5 Tools • 1 Resource</div>
|
|
5
|
+
</p>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<div align="center">
|
|
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
|
+
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div align="center">
|
|
15
|
+
|
|
16
|
+
[](https://github.com/cyanheads/nist-nvd-mcp-server/releases/latest/download/nist-nvd-mcp-server.mcpb) [](https://cursor.com/en/install-mcp?name=nist-nvd-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvbmlzdC1udmQtbWNwLXNlcnZlciJdfQ==) [](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22nist-nvd-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cyanheads%2Fnist-nvd-mcp-server%22%5D%7D)
|
|
17
|
+
|
|
18
|
+
[](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Tools
|
|
25
|
+
|
|
26
|
+
Five tools for vulnerability research, CPE auditing, and change tracking against the NIST NVD API 2.0:
|
|
27
|
+
|
|
28
|
+
| Tool | Description |
|
|
29
|
+
|:-----|:------------|
|
|
30
|
+
| `nvd_search_cves` | Search CVEs by keyword, severity, CWE, date range, or CISA KEV status. |
|
|
31
|
+
| `nvd_get_cve` | Fetch one or more CVEs by ID — full CVSS scores, CWE, CPE configs, KEV fields, and references. |
|
|
32
|
+
| `nvd_search_cpes` | Search the NVD CPE dictionary by product keyword or partial match string. |
|
|
33
|
+
| `nvd_audit_cpe` | Find all CVEs affecting a specific product version by CPE name or virtual match string. |
|
|
34
|
+
| `nvd_get_cve_history` | Retrieve the change history for a CVE — score revisions, status transitions, and reference additions. |
|
|
35
|
+
|
|
36
|
+
### `nvd_search_cves`
|
|
37
|
+
|
|
38
|
+
The primary discovery tool for vulnerability surveillance and triage workflows.
|
|
39
|
+
|
|
40
|
+
- Full-text keyword search across CVE descriptions (AND-semantics across words)
|
|
41
|
+
- Severity filter by CVSS v2/v3/v4 label (LOW, MEDIUM, HIGH, CRITICAL)
|
|
42
|
+
- CWE weakness filter (e.g., `CWE-79`, `NVD-CWE-Other`)
|
|
43
|
+
- CISA KEV filter — limit results to known-exploited vulnerabilities
|
|
44
|
+
- Convenience date shorthands: `pubDays` and `lastModDays` for "last N days" queries
|
|
45
|
+
- Explicit ISO 8601 date range parameters (`pubStartDate`/`pubEndDate`, etc.) with 120-day max span
|
|
46
|
+
- Auto-clamps convenience date params that exceed 120 days and reports clamped values in `queryMeta`
|
|
47
|
+
- Pagination via `limit` (up to 2000) and `offset`
|
|
48
|
+
- Results are always brief; call `nvd_get_cve` for full detail
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
### `nvd_get_cve`
|
|
53
|
+
|
|
54
|
+
Fetch one or more CVEs by ID with full detail or brief summaries.
|
|
55
|
+
|
|
56
|
+
- Batch up to 100 CVE IDs per call
|
|
57
|
+
- Full mode: all CVSS scores across v2.0, v3.0, v3.1, and v4.0; CWE weaknesses; CPE configurations; CISA KEV fields; references
|
|
58
|
+
- Brief mode (`brief: true`): ID, status, top severity, KEV name — recommended for batches larger than 10
|
|
59
|
+
- `includeReferences: false` to strip the references array and reduce response size
|
|
60
|
+
- Per-ID parity check: `queryMeta.missingIds` lists any requested IDs NVD didn't return
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
### `nvd_search_cpes`
|
|
65
|
+
|
|
66
|
+
Look up product identifiers before auditing.
|
|
67
|
+
|
|
68
|
+
- Keyword search (e.g., `"apache http server"`, `"openssl"`) or partial CPEv2.3 pattern
|
|
69
|
+
- Returns full CPE name, human-readable title, deprecation status, and superseding CPEs
|
|
70
|
+
- Pagination up to 10,000 entries — narrow the keyword when `totalResults > returned`
|
|
71
|
+
- Use this before `nvd_audit_cpe` — CPE names are arcane strings; guessing audits the wrong product
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
### `nvd_audit_cpe`
|
|
76
|
+
|
|
77
|
+
Full CVE audit for a specific product version.
|
|
78
|
+
|
|
79
|
+
- Two modes: exact `cpeName` (NVD auto-applies `isVulnerable`) or `virtualMatchString` with optional version range bounds
|
|
80
|
+
- Version range via `versionStart`/`versionEnd` with inclusive/exclusive type control
|
|
81
|
+
- Client-side severity filter (`severityMin`) to strip low-signal entries
|
|
82
|
+
- Returns full CVE records (ID, CVSS scores, CWE, CPE configurations, KEV fields, references)
|
|
83
|
+
- Echoes the CPE identifier used in `queryMeta` so callers can verify the correct product was queried
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
### `nvd_get_cve_history`
|
|
88
|
+
|
|
89
|
+
Track a CVE's lifecycle over time.
|
|
90
|
+
|
|
91
|
+
- Returns change events in reverse-chronological order: CVSS revisions, status transitions, reference additions, CPE configuration updates
|
|
92
|
+
- Paginated via `limit` and `offset`
|
|
93
|
+
- Note: the NVD history endpoint is significantly slower without an API key — set `NVD_API_KEY` and raise `NVD_REQUEST_TIMEOUT_MS` for reliable operation
|
|
94
|
+
|
|
95
|
+
## Resource
|
|
96
|
+
|
|
97
|
+
| Type | Name | Description |
|
|
98
|
+
|:-----|:-----|:------------|
|
|
99
|
+
| Resource | `nvd://cve/{cveId}` | Full CVE record by ID — same data as `nvd_get_cve` for a single ID, as a stable URI for injectable context. |
|
|
100
|
+
|
|
101
|
+
All resource data is also reachable via tools.
|
|
102
|
+
|
|
103
|
+
## Features
|
|
104
|
+
|
|
105
|
+
Built on [`@cyanheads/mcp-ts-core`](https://www.npmjs.com/package/@cyanheads/mcp-ts-core):
|
|
106
|
+
|
|
107
|
+
- Declarative tool, resource, and prompt definitions — single file per primitive, framework handles registration and validation
|
|
108
|
+
- Unified error handling — handlers throw, framework catches, classifies, and formats
|
|
109
|
+
- Pluggable auth: `none`, `jwt`, `oauth`
|
|
110
|
+
- Swappable storage backends: `in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`
|
|
111
|
+
- Structured logging with optional OpenTelemetry tracing
|
|
112
|
+
- STDIO and Streamable HTTP transports
|
|
113
|
+
|
|
114
|
+
NVD-specific:
|
|
115
|
+
|
|
116
|
+
- Token-bucket rate limiter enforces NVD's 5 req/30s (no key) and 50 req/30s (with key) limits with automatic queuing
|
|
117
|
+
- Sliding-window minimum inter-request gap derived from the window and limit — no burst, no 403s
|
|
118
|
+
- Automatic retry with backoff via `withRetry`; parses `Retry-After` header on 403 responses
|
|
119
|
+
- HTML-response guard catches NVD rate-limit pages served as HTML instead of 403
|
|
120
|
+
|
|
121
|
+
Agent-friendly output:
|
|
122
|
+
|
|
123
|
+
- `queryMeta` on every response — total results, returned count, page offset, and any date-clamping events so agents can reason about what was actually queried
|
|
124
|
+
- `missingIds` in batch CVE lookups — per-ID parity check instead of a silent partial result
|
|
125
|
+
- CPE echo in audit responses — `cpeName` or `virtualMatchString` reflected back so callers can verify the correct product was audited
|
|
126
|
+
|
|
127
|
+
## Getting started
|
|
128
|
+
|
|
129
|
+
Add the following to your MCP client configuration file.
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"mcpServers": {
|
|
134
|
+
"nist-nvd": {
|
|
135
|
+
"type": "stdio",
|
|
136
|
+
"command": "bunx",
|
|
137
|
+
"args": ["nist-nvd-mcp-server@latest"],
|
|
138
|
+
"env": {
|
|
139
|
+
"MCP_TRANSPORT_TYPE": "stdio",
|
|
140
|
+
"MCP_LOG_LEVEL": "info",
|
|
141
|
+
"NVD_API_KEY": "your-api-key"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Or with npx (no Bun required):
|
|
149
|
+
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"mcpServers": {
|
|
153
|
+
"nist-nvd": {
|
|
154
|
+
"type": "stdio",
|
|
155
|
+
"command": "npx",
|
|
156
|
+
"args": ["-y", "nist-nvd-mcp-server@latest"],
|
|
157
|
+
"env": {
|
|
158
|
+
"MCP_TRANSPORT_TYPE": "stdio",
|
|
159
|
+
"MCP_LOG_LEVEL": "info",
|
|
160
|
+
"NVD_API_KEY": "your-api-key"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Or with Docker:
|
|
168
|
+
|
|
169
|
+
```json
|
|
170
|
+
{
|
|
171
|
+
"mcpServers": {
|
|
172
|
+
"nist-nvd": {
|
|
173
|
+
"type": "stdio",
|
|
174
|
+
"command": "docker",
|
|
175
|
+
"args": [
|
|
176
|
+
"run", "-i", "--rm",
|
|
177
|
+
"-e", "MCP_TRANSPORT_TYPE=stdio",
|
|
178
|
+
"-e", "NVD_API_KEY=your-api-key",
|
|
179
|
+
"ghcr.io/cyanheads/nist-nvd-mcp-server:latest"
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
For Streamable HTTP, set the transport and start the server:
|
|
187
|
+
|
|
188
|
+
```sh
|
|
189
|
+
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 NVD_API_KEY=... bun run start:http
|
|
190
|
+
# Server listens at http://localhost:3010/mcp
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Prerequisites
|
|
194
|
+
|
|
195
|
+
- [Bun v1.3.0](https://bun.sh/) or higher (or Node.js v24+).
|
|
196
|
+
- Optional: [NVD API key](https://nvd.nist.gov/developers/request-an-api-key) — free, raises rate limit from 5 req/30s to 50 req/30s.
|
|
197
|
+
|
|
198
|
+
### Installation
|
|
199
|
+
|
|
200
|
+
1. **Clone the repository:**
|
|
201
|
+
|
|
202
|
+
```sh
|
|
203
|
+
git clone https://github.com/cyanheads/nist-nvd-mcp-server.git
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
2. **Navigate into the directory:**
|
|
207
|
+
|
|
208
|
+
```sh
|
|
209
|
+
cd nist-nvd-mcp-server
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
3. **Install dependencies:**
|
|
213
|
+
|
|
214
|
+
```sh
|
|
215
|
+
bun install
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
4. **Configure environment:**
|
|
219
|
+
|
|
220
|
+
```sh
|
|
221
|
+
cp .env.example .env
|
|
222
|
+
# edit .env and set NVD_API_KEY if you have one
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## Configuration
|
|
226
|
+
|
|
227
|
+
| Variable | Description | Default |
|
|
228
|
+
|:---------|:------------|:--------|
|
|
229
|
+
| `NVD_API_KEY` | NVD API key. Without it, rate limit is 5 req/30s; with it, 50 req/30s. Get one free at [nvd.nist.gov/developers/request-an-api-key](https://nvd.nist.gov/developers/request-an-api-key). | — |
|
|
230
|
+
| `NVD_REQUEST_TIMEOUT_MS` | Per-request timeout in milliseconds. The history endpoint is slow without an API key — raise to 60000 if using `nvd_get_cve_history` without a key. | `10000` |
|
|
231
|
+
| `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |
|
|
232
|
+
| `MCP_HTTP_PORT` | Port for HTTP server. | `3010` |
|
|
233
|
+
| `MCP_AUTH_MODE` | Auth mode: `none`, `jwt`, or `oauth`. | `none` |
|
|
234
|
+
| `MCP_LOG_LEVEL` | Log level (RFC 5424). | `info` |
|
|
235
|
+
| `LOGS_DIR` | Directory for log files (Node.js only). | `<project-root>/logs` |
|
|
236
|
+
| `OTEL_ENABLED` | Enable [OpenTelemetry instrumentation](https://github.com/cyanheads/mcp-ts-core/tree/main/docs/telemetry). | `false` |
|
|
237
|
+
|
|
238
|
+
See [`.env.example`](./.env.example) for the full list of optional overrides.
|
|
239
|
+
|
|
240
|
+
## Running the server
|
|
241
|
+
|
|
242
|
+
### Local development
|
|
243
|
+
|
|
244
|
+
- **Build and run:**
|
|
245
|
+
|
|
246
|
+
```sh
|
|
247
|
+
# One-time build
|
|
248
|
+
bun run rebuild
|
|
249
|
+
|
|
250
|
+
# Run the built server
|
|
251
|
+
bun run start:stdio
|
|
252
|
+
# or
|
|
253
|
+
bun run start:http
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
- **Run checks and tests:**
|
|
257
|
+
|
|
258
|
+
```sh
|
|
259
|
+
bun run devcheck # Lint, format, typecheck, security
|
|
260
|
+
bun run test # Vitest test suite
|
|
261
|
+
bun run lint:mcp # Validate MCP definitions against spec
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Docker
|
|
265
|
+
|
|
266
|
+
```sh
|
|
267
|
+
docker build -t nist-nvd-mcp-server .
|
|
268
|
+
docker run --rm -e NVD_API_KEY=your-key -p 3010:3010 nist-nvd-mcp-server
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
The Dockerfile defaults to HTTP transport, stateless session mode, and logs to `/var/log/nist-nvd-mcp-server`. OpenTelemetry peer dependencies are installed by default — build with `--build-arg OTEL_ENABLED=false` to omit them.
|
|
272
|
+
|
|
273
|
+
## Project structure
|
|
274
|
+
|
|
275
|
+
| Directory | Purpose |
|
|
276
|
+
|:----------|:--------|
|
|
277
|
+
| `src/index.ts` | `createApp()` entry point — registers tools/resources and inits services. |
|
|
278
|
+
| `src/config` | Server-specific environment variable parsing and validation with Zod. |
|
|
279
|
+
| `src/mcp-server/tools` | Tool definitions (`*.tool.ts`). |
|
|
280
|
+
| `src/mcp-server/resources` | Resource definitions (`*.resource.ts`). |
|
|
281
|
+
| `src/services/nvd-http` | NVD HTTP client with token-bucket rate limiting and retry. |
|
|
282
|
+
| `src/services/nvd-cve` | CVE service — search, fetch-by-ID, CPE audit, change history, normalization. |
|
|
283
|
+
| `src/services/nvd-cpe` | CPE service — dictionary search and normalization. |
|
|
284
|
+
| `tests/` | Unit and integration tests mirroring `src/`. |
|
|
285
|
+
|
|
286
|
+
## Development guide
|
|
287
|
+
|
|
288
|
+
See [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:
|
|
289
|
+
|
|
290
|
+
- Handlers throw, framework catches — no `try/catch` in tool logic
|
|
291
|
+
- Use `ctx.log` for request-scoped logging, `ctx.state` for tenant-scoped storage
|
|
292
|
+
- Register new tools and resources via the barrels in `src/mcp-server/*/definitions/index.ts`
|
|
293
|
+
- Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
|
|
294
|
+
|
|
295
|
+
## Contributing
|
|
296
|
+
|
|
297
|
+
Issues and pull requests are welcome. Run checks and tests before submitting:
|
|
298
|
+
|
|
299
|
+
```sh
|
|
300
|
+
bun run devcheck
|
|
301
|
+
bun run test
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## License
|
|
305
|
+
|
|
306
|
+
Apache-2.0 — see [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Initial release — 5 tools and 1 resource for searching and auditing NIST NVD CVEs, CPEs, and change history."
|
|
3
|
+
breaking: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 0.1.0 — 2026-05-24
|
|
7
|
+
|
|
8
|
+
Initial release of `nist-nvd-mcp-server`.
|
|
9
|
+
|
|
10
|
+
## Added
|
|
11
|
+
|
|
12
|
+
- `nvd_search_cves` — search CVEs by keyword, severity (CVSS v2/v3/v4), CWE, date range, and CISA KEV status; convenience `pubDays`/`lastModDays` shorthands with auto-clamping at the 120-day API maximum
|
|
13
|
+
- `nvd_get_cve` — fetch up to 100 CVEs by ID; full or brief mode; `missingIds` parity check in response
|
|
14
|
+
- `nvd_search_cpes` — keyword and partial-match search against the NVD CPE dictionary
|
|
15
|
+
- `nvd_audit_cpe` — CPE-based CVE audit via exact `cpeName` or `virtualMatchString` with version range bounds; client-side severity filter
|
|
16
|
+
- `nvd_get_cve_history` — paginated change history for a CVE (CVSS revisions, status transitions, reference additions)
|
|
17
|
+
- `nvd://cve/{cveId}` resource — stable URI for injecting a single CVE record as context
|
|
18
|
+
- `NvdHttpClient` with token-bucket rate limiting (5 req/30s without key, 50 req/30s with key), automatic retry with backoff, and `Retry-After` header parsing
|
|
19
|
+
- Two-service architecture: `NvdCveService` (CVE + CPE audit + history) and `NvdCpeService` (CPE dictionary search)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Launch release — full implementation: 5 tools, 1 resource, 3 services, 65 tests; field-test fixes for date validation, missing ID tracking, and error classification."
|
|
3
|
+
breaking: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 0.1.1 — 2026-05-24
|
|
7
|
+
|
|
8
|
+
Full launch implementation on top of the initial scaffold. Includes the complete NVD tool surface, field-test fixes, and pre-launch polish.
|
|
9
|
+
|
|
10
|
+
## Added
|
|
11
|
+
|
|
12
|
+
- **`nvd_search_cves`** — search CVEs by keyword, severity (CVSS v2/v3/v4), CWE, date range, CISA KEV status; `pubDays`/`lastModDays` shorthands with 120-day auto-clamping
|
|
13
|
+
- **`nvd_get_cve`** — fetch up to 100 CVEs by ID; full/brief mode; `missingIds` parity tracking in response
|
|
14
|
+
- **`nvd_search_cpes`** — keyword and partial-match search against the NVD CPE dictionary
|
|
15
|
+
- **`nvd_audit_cpe`** — CPE-based CVE audit via exact `cpeName` or `virtualMatchString` with version range bounds and client-side severity filter
|
|
16
|
+
- **`nvd_get_cve_history`** — paginated change history for a CVE (CVSS revisions, status transitions, reference additions)
|
|
17
|
+
- **`nvd://cve/{cveId}`** resource — stable URI for injecting a single CVE record as context
|
|
18
|
+
- **`NvdHttpClient`** — token-bucket rate limiting (5 req/30s unauthenticated, 50 req/30s with API key), automatic retry with backoff, `Retry-After` header parsing
|
|
19
|
+
- **`NvdCveService`** and **`NvdCpeService`** — two-service architecture with normalized domain types
|
|
20
|
+
- 65 tests across all tools and resources
|
|
21
|
+
|
|
22
|
+
## Fixed
|
|
23
|
+
|
|
24
|
+
- **`nvd_search_cves`** date input validation: co-requirement check (start and end must be provided together) and inversion check (end before start) added with `missing_date_pair` and `date_range_inverted` error reasons
|
|
25
|
+
- **`nvd_search_cves`** date format: ISO 8601 timestamps now use `.000Z` suffix instead of `000 UTC+00:00`, matching the NVD API's accepted format
|
|
26
|
+
- **`nvd_get_cve`** array input validation: added `min(1)` constraint on the CVE IDs array
|
|
27
|
+
- **`nvd_get_cve`** missing IDs: `missingIds` array now surfaces in `queryMeta` and in `format()` output when any requested CVE was not returned by NVD
|
|
28
|
+
- **`NvdCveService`** error classification: single-CVE not-found and CPE-not-found errors now throw typed `McpError(NotFound)` instead of plain `Error` with attached `data`
|
|
29
|
+
- **`nvd_get_cve_history`** tool description: added explicit note that the NVD history endpoint is significantly slower without an API key (40–55s vs default 10s timeout); recommends `NVD_API_KEY` and/or `NVD_REQUEST_TIMEOUT_MS`
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Scope npm package to @cyanheads/nist-nvd-mcp-server."
|
|
3
|
+
breaking: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 0.1.2 — 2026-05-24
|
|
7
|
+
|
|
8
|
+
## Fixed
|
|
9
|
+
|
|
10
|
+
- **Package name** scoped to `@cyanheads/nist-nvd-mcp-server` in `package.json`, `server.json` (`packages[].identifier`), and all README badges (npm badge URL, Cursor base64 config, VS Code URL-encoded config)
|
|
11
|
+
- **`bundle` script** updated to use `bun run build` instead of `npm run build`
|
|
12
|
+
- **`author` field** aligned to the `cyanheads <email> (url)` format used across the ecosystem
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Field-test fixes: CVSS v2 severity derivation, CPE format validation, invalid date errors, severity/version cross-check, offset-past-end message, and description accuracy."
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.1.3 — 2026-05-24
|
|
8
|
+
|
|
9
|
+
## Fixed
|
|
10
|
+
|
|
11
|
+
- **`nvd-cve-service`** — CVSS v2 base severity now derived from the numeric score when NVD omits `baseSeverity` (v2 responses never include it). Ranges: 0→NONE, 0.1–3.9→LOW, 4.0–6.9→MEDIUM, 7.0–10.0→HIGH ([#11](https://github.com/cyanheads/nist-nvd-mcp-server/issues/11))
|
|
12
|
+
- **`nvd_search_cves`** — invalid date strings now throw `invalid_date_format` with `data.reason` instead of an untyped error ([#9](https://github.com/cyanheads/nist-nvd-mcp-server/issues/9))
|
|
13
|
+
- **`nvd_search_cves`** — `severity=CRITICAL` with `severityVersion=v2` now throws `invalid_severity_for_version` locally before hitting NVD; CVSS v2 has no CRITICAL tier ([#13](https://github.com/cyanheads/nist-nvd-mcp-server/issues/13))
|
|
14
|
+
- **`nvd_search_cves`** — offset-past-end (returned=0, totalResults>0) now displays an actionable pagination message instead of "No CVEs matched the search criteria" ([#14](https://github.com/cyanheads/nist-nvd-mcp-server/issues/14))
|
|
15
|
+
- **`nvd_search_cves`** — description corrected: no-filter queries return CVEs in NVD default index order (oldest-first by CVE ID), not "most recently modified" ([#12](https://github.com/cyanheads/nist-nvd-mcp-server/issues/12))
|
|
16
|
+
- **`nvd_search_cpes` / `nvd_audit_cpe`** — malformed CPE strings (not starting with `cpe:2.3:`) now throw `invalid_cpe_format` locally before hitting the API ([#10](https://github.com/cyanheads/nist-nvd-mcp-server/issues/10))
|
|
17
|
+
|
|
18
|
+
## Changed
|
|
19
|
+
|
|
20
|
+
- **Tool descriptions** tightened across `nvd_search_cves`, `nvd_search_cpes`, `nvd_audit_cpe`, `nvd_get_cve_history`, and `nvd://cve/{cveId}` — removed redundant language, sharpened guidance
|
|
21
|
+
- **Spread patterns** simplified to `&&`-conditional spreads throughout service and tool layers (code simplification pass)
|
|
22
|
+
- **`@module` tags** corrected to include `src/` prefix on all definitions
|