osv-advisory-mcp-server
Query OSV.dev for package vulnerabilities, batch-audit dependency lists, and fetch full advisory records via MCP.
README
<div align="center"> <h1>@cyanheads/osv-advisory-mcp-server</h1> <p><b>Query OSV.dev for package vulnerabilities, batch-audit dependency lists, and fetch full advisory records via MCP. STDIO or Streamable HTTP.</b> <div>4 Tools</div> </p> </div>
<div align="center">
</div>
<div align="center">
</div>
<div align="center">
Public Hosted Server: https://osv-advisory.caseyjhand.com/mcp
</div>
Tools
4 tools for querying the OSV.dev vulnerability database — single package lookups, batch dependency audits, and full advisory fetch:
| Tool | Description |
|---|---|
osv_query_package |
Query known vulnerabilities for a single package version by name, ecosystem, and version |
osv_query_batch |
Batch vulnerability query for an array of package tuples — one call for a full dependency list or SBOM audit |
osv_get_vulnerability |
Fetch the full advisory record for a single OSV vulnerability ID |
osv_list_ecosystems |
Return the list of supported ecosystem identifier strings |
osv_query_package
The primary "is this package version vulnerable?" tool.
- Accepts
name,ecosystem(case-sensitive exact match — useosv_list_ecosystemsto validate), andversion - Returns all matching advisories: OSV IDs, CVE aliases, CVSS severity vectors, derived severity label, first safe versions, affected version ranges (SEMVER/ECOSYSTEM/GIT), and CWE IDs
aliasesfield surfaces CVE IDs for chaining tonist-nvd-mcp-serverfor CVSS base scores, EPSS exploitation probability, and CISA KEV status- No API key required — OSV.dev is fully public and keyless
osv_query_batch
The primary tool for dependency audits, SBOM scanning, and lockfile triage.
- Accepts an array of
{name, ecosystem, version}tuples (1–1000 packages per call) - Ecosystem strings are validated by OSV.dev itself, not a static allowlist — an unrecognized ecosystem surfaces as that entry's per-package
errorrather than failing the whole batch - Returns per-package results positionally matching the input, with
vulnerable,vulnCount,vulns(includingaliasesandseverityLabel), andfixedVersions - Includes aggregate summary:
totalPackages,vulnerableCount,cleanCount,errorCount,totalVulns,worstSeverity
osv_get_vulnerability
Fetch the complete advisory record by OSV ID.
- Accepts any OSV ID prefix:
GHSA-(GitHub),PYSEC-(Python),RUSTSEC-(Rust),GO-(Go),DSA-/DLA-(Debian),CVE-(direct CVE fallbacks) - Returns: summary, full advisory details text, all CVE aliases, all affected packages and their version ranges, fix versions, CVSS severity vectors, CWE weakness IDs, and references (ADVISORY, FIX, REPORT, etc.)
- Use after
osv_query_packageorosv_query_batchreturns a vuln ID and you need the full advisory context — remediation guidance, scope of affected packages, or eligibility criteria
osv_list_ecosystems
Return the list of valid ecosystem identifier strings. Ecosystem strings are case-sensitive exact matches — "pypi" is not "PyPI". Call this tool before querying to validate ecosystem strings from lockfiles or user input. The list is static (sourced from the OSV schema spec) and may occasionally lag newly added ecosystems.
Features
Built on @cyanheads/mcp-ts-core:
- Declarative tool definitions — single file per tool, framework handles registration and validation
- Unified error handling — handlers throw, framework catches, classifies, and formats
- Pluggable auth:
none,jwt,oauth - Swappable storage backends:
in-memory,filesystem,Supabase,Cloudflare KV/R2/D1 - Structured logging with optional OpenTelemetry tracing
- STDIO and Streamable HTTP transports
OSV-specific:
- No API key required — OSV.dev is fully public, keyless, and has no published rate limit
- Parallel single-package queries in
osv_query_batchreturn full records includingaliases(CVE IDs) that the upstream batch endpoint omits - Per-package queries isolate failures — one invalid ecosystem or upstream error surfaces as that row's
error, leaving the rest of the batch intact
Agent-friendly output:
aliases(CVE IDs) prominently surfaced on every vuln entry — the primary composition point for chaining tonist-nvd-mcp-serverfor CVSS base scores, EPSS, and CISA KEV statusseverityLabelderived fromdatabase_specific.severity(GHSA records) or the highest CVSS base score;nullrather than fabricated when neither source is available- Echo of query parameters (
queryMeta) onosv_query_packageoutput so agents can verify the request was applied correctly - Batch aggregate summary (
worstSeverity,vulnerableCount,cleanCount) for quick triage without reading per-package rows
Getting started
Public Hosted Instance
A public instance is available at https://osv-advisory.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:
{
"mcpServers": {
"osv-advisory-mcp-server": {
"type": "streamable-http",
"url": "https://osv-advisory.caseyjhand.com/mcp"
}
}
}
Self-Hosted / Local
Add the following to your MCP client configuration file. No API key is required — OSV.dev is fully public.
{
"mcpServers": {
"osv-advisory-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/osv-advisory-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}
Or with npx (no Bun required):
{
"mcpServers": {
"osv-advisory-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/osv-advisory-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}
Or with Docker:
{
"mcpServers": {
"osv-advisory-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MCP_TRANSPORT_TYPE=stdio",
"ghcr.io/cyanheads/osv-advisory-mcp-server:latest"
]
}
}
}
For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcp
Prerequisites
- Bun v1.3.0 or higher (or Node.js v24+).
- No API key required — OSV.dev is fully public.
Installation
- Clone the repository:
git clone https://github.com/cyanheads/osv-advisory-mcp-server.git
- Navigate into the directory:
cd osv-advisory-mcp-server
- Install dependencies:
bun install
- Configure environment:
cp .env.example .env
# edit .env if needed (no required vars)
Configuration
All configuration is validated at startup. No server-specific env vars are required — OSV.dev is keyless and fully public.
| Variable | Description | Default |
|---|---|---|
OSV_REQUEST_TIMEOUT_MS |
HTTP request timeout in milliseconds for OSV.dev API calls. | 10000 |
MCP_TRANSPORT_TYPE |
Transport: stdio or http. |
stdio |
MCP_HTTP_PORT |
Port for HTTP server. | 3010 |
MCP_HTTP_ENDPOINT_PATH |
HTTP endpoint path. | /mcp |
MCP_PUBLIC_URL |
Public origin override for TLS-terminating reverse-proxy deployments. | none |
MCP_AUTH_MODE |
Auth mode: none, jwt, or oauth. |
none |
MCP_LOG_LEVEL |
Log level (RFC 5424). | info |
LOGS_DIR |
Directory for log files (Node.js only). | <project-root>/logs |
STORAGE_PROVIDER_TYPE |
Storage backend. | in-memory |
OTEL_ENABLED |
Enable OpenTelemetry instrumentation (spans, metrics, completion logs). | false |
See .env.example for the full list of optional overrides.
Running the server
Local development
-
Build and run:
# One-time build bun run rebuild # Run the built server bun run start:stdio # or bun run start:http -
Run checks and tests:
bun run devcheck # Lint, format, typecheck, security bun run test # Vitest test suite bun run lint:mcp # Validate MCP definitions against spec
Docker
docker build -t osv-advisory-mcp-server .
docker run --rm -p 3010:3010 osv-advisory-mcp-server
The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/osv-advisory-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
Project structure
| Directory | Purpose |
|---|---|
src/index.ts |
createApp() entry point — registers tools and inits services. |
src/mcp-server/tools |
Tool definitions (*.tool.ts) — osv_query_package, osv_query_batch, osv_get_vulnerability, osv_list_ecosystems. |
src/services/osv-api |
OSV.dev REST API service — fetch, retry, response normalization. |
tests/ |
Unit and integration tests mirroring src/. |
Development guide
See CLAUDE.md/AGENTS.md for development guidelines and architectural rules. The short version:
- Handlers throw, framework catches — no
try/catchin tool logic - Use
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storage - Register new tools via the barrel in
src/mcp-server/tools/definitions/index.ts - Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues and pull requests are welcome. Run checks and tests before submitting:
bun run devcheck
bun run test
License
Apache-2.0 — see LICENSE for details.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。