Osv Advisory Mcp Server

io.github.cyanheadsv0.1.15更新於 Oct 8, 2026

Query OSV.dev for package vulnerabilities and batch-audit dependency lists via MCP.

已驗證Streamable HTTP可網頁執行Developer ToolsSecurity & Monitoring

概覽

AI 產生的概覽

讓助理在 OSV.dev 上查詢已知的套件漏洞、批次稽核相依清單或 SBOM,並取得完整的安全性公告記錄。

功能
提供四個以公開漏洞資料庫 OSV.dev 為後端的工具。osv_query_package 依套件名稱、生態系與精確版本查詢單一套件的公告;osv_query_batch 一次呼叫可稽核最多 1000 個套件組合,回傳逐列結果與彙總統計;osv_get_vulnerability 回傳完整公告記錄,包含 CVE 別名、嚴重性、受影響版本範圍與參考連結;osv_list_ecosystems 列出有效的生態系識別字串。結果包含修正版本、受影響範圍、CWE 編號與嚴重性標籤,並會標示截斷,而不是回報為無風險。
適用情境
適合需要檢查某個相依套件版本是否有已知公告、稽核鎖定檔或 SBOM,或在排查問題時取得某筆公告詳情的情境。適用於安全審查與相依套件升級流程,讓助理引用公告資料而不是憑空猜測。
執行需求
可使用公開託管的 Streamable HTTP 端點,也可在本機執行。本機執行需要 Bun v1.4.0+ 或 Node.js v24+,或使用 Docker;npm 套件可透過 bunx 或 npx 啟動。不需要 API 金鑰或帳號,因為 OSV.dev 完全公開且免金鑰。選用環境變數可調整請求逾時、批次並行數、分頁上限、傳輸方式、連接埠、端點路徑、工作階段模式、驗證模式與日誌層級。
安裝前請注意
僅對公開資料庫進行唯讀查詢,不涉及憑證、付款或錢包私鑰。公告文字被視為不受信任的資料並在渲染邊界轉義,但仍來自第三方,不應當成指令執行。被截斷的結果不等於無風險,截斷或發生錯誤的列應視為尚未驗證。自行架設時若將 MCP_AUTH_MODE 設為 none,HTTP 端點將不進行身分驗證。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Osv Advisory Mcp Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "osv-advisory-mcp-server": {
      "type": "http",
      "url": "https://osv-advisory.caseyjhand.com/mcp"
    }
  }
}

README

@cyanheads/osv-advisory-mcp-server

Query OSV.dev for package vulnerabilities, batch-audit dependency lists, and fetch full advisory records via MCP. STDIO or Streamable HTTP.

4 Tools


Overview

Vulnerability data from OSV.dev, the open-source vulnerability database. Query a single package version, batch-audit a full dependency list or SBOM, and fetch complete advisory records with CVSS severity, CVE aliases, and affected version ranges. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.

Tools

ToolDescription
osv_query_packageQuery known vulnerabilities for a single package version by name, ecosystem, and version
osv_query_batchBatch vulnerability query for an array of package tuples — one call for a full dependency list or SBOM audit
osv_get_vulnerabilityFetch the full advisory record for a single OSV vulnerability ID
osv_list_ecosystemsReturn the list of supported ecosystem identifier strings

Capability reference

osv_query_package tool

  • Accepts name, ecosystem (case-sensitive exact match), and version — an exact version string, not a range
  • Surrounding whitespace is trimmed from all three before the request, and queryMeta echoes the trimmed values; interior whitespace (Rocky Linux) is kept. Blank or whitespace-only values are rejected before any upstream call
  • Returns matching advisories with OSV IDs, CVE aliases, severity entries (CVSS vectors, Ubuntu priorities), severityLabel with its severitySource, fixedVersions, affectedRanges (SEMVER/ECOSYSTEM/GIT), and cweIds
  • fixedVersions lists every fix the advisory records for the queried package (one per affected interval), matched the way OSV matches the query — release-suffixed ecosystems (Debian → Debian:12, Ubuntu:22.04 → Ubuntu:22.04:LTS) and PEP 503 names on PyPI. Other packages' fixes and GIT commits stay out of it; affectedRanges keeps every range
  • truncated: true means OSV paginated beyond OSV_QUERY_MAX_PAGES (default 10) — an empty vulns array with truncated: true is NOT a confirmed clean result
  • Typed invalid_ecosystem error when the ecosystem string isn't recognized by OSV — call osv_list_ecosystems for valid values, then retry
  • aliases on each vuln chain to nist-nvd-mcp-server for CVSS base scores, EPSS exploitation probability, and CISA KEV status

osv_query_batch tool

  • Accepts an array of {name, ecosystem, version} tuples, 1–1000 per call; results[i] corresponds positionally to packages[i]
  • Each row's fields are trimmed of surrounding whitespace the same way as osv_query_package, and results[i] echoes the trimmed values; a blank field in any row rejects the call
  • Per-package vulnerable, vulnCount, vulns (with aliases, severityLabel, and the row package's fixedVersions), and a nullable error — one bad ecosystem or upstream failure fails only that row, not the whole batch
  • Aggregate summary: totalPackages, vulnerableCount, cleanCount, truncatedCount, errorCount, totalVulns, worstSeverity
  • cleanCount excludes truncated rows — a per-package truncated: true result is never counted clean even with zero findings
  • Per-package requests run in parallel, capped by OSV_BATCH_CONCURRENCY (default 10)

osv_get_vulnerability tool

  • Accepts one exact, complete advisory ID from any OSV source database, matched case-sensitively — GHSA- (GitHub), PYSEC- (PyPI), RUSTSEC- (Rust), GO- (Go), DSA-/DLA- (Debian), USN- (Ubuntu), RHSA- (Red Hat), CVE-, and the rest. IDs come from osv_query_package / osv_query_batch results
  • Surrounding whitespace is trimmed before the request (" GHSA-29mw-wpgm-hmr9 " resolves); input that can't be an OSV ID (wildcards, a bare package name, a prefix with no ID) is rejected before any upstream call, with a message naming the expected form
  • Returns the full record — details text, all CVE aliases, every affected package with its version ranges, ordered fixed events, and any package-level severity, severity entries with severityLabel and severitySource, cweIds, and references (ADVISORY, FIX, REPORT, etc.)
  • Typed vulnerability_not_found error when the ID doesn't exist in OSV — the recovery covers case and the Debian/Ubuntu/SUSE revision suffix (DSA-5678-1, not DSA-5678); a CVE-style alias may still resolve via nist-nvd-mcp-server
  • withdrawn is present only on retracted advisories — treat as no longer active, not as an error

osv_list_ecosystems tool

  • No input; returns the static list of valid ecosystem identifier strings plus an advisory note on currency
  • Ecosystem strings are case-sensitive exact matches — "pypi" fails where "PyPI" succeeds
  • Every ecosystem in the OSV schema's ecosystemName enum that OSV.dev accepts at query time, plus GIT (accepted via the ecosystemWithSuffix pattern); a schema ecosystem OSV.dev still rejects is left out. The note carries the verification date; the list may lag later additions

Features

Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.

OSV-specific:

  • No API key required — OSV.dev is fully public, keyless, and has no published rate limit
  • osv_query_batch issues parallel per-package requests (capped by OSV_BATCH_CONCURRENCY) and returns full records, including aliases, that the upstream OSV batch endpoint omits
  • Per-package failures are isolated in osv_query_batch — one invalid ecosystem or upstream error surfaces as that row's error without failing the whole batch
  • Ecosystem discovery via osv_list_ecosystems — the OSV schema's ecosystems that OSV.dev accepts, checked against both with bun run check:ecosystems

Agent-friendly output:

  • aliases (CVE IDs) surfaced on every vuln entry — the composition point for chaining to nist-nvd-mcp-server for CVSS base scores, EPSS, and CISA KEV status
  • severityLabel from the first source that yields one: database_specific.severity (GHSA, openEuler, and others; Medium reads as MODERATE), an Ubuntu priority, then the highest CVSS v3/v4 score computed from the vector as published (every metric group of a CVSS 4.0 vector; base and temporal for CVSS 3.x). Package-level severity counts when the record has none. severitySource names the entry used, with the computed score for CVSS; both are null rather than fabricated when no source yields a label
  • Truncation is never silently treated as clean — truncated (single query) and per-package truncated plus truncatedCount (batch) flag incomplete OSV pagination, and truncated rows are excluded from cleanCount
  • Query echo (queryMeta / effectiveQuery) and aggregate batch summary (worstSeverity, vulnerableCount, cleanCount) let agents verify requests and triage without reading every row
  • Advisory text is framed as untrusted data in content[] and escaped at the render boundary: tag-shaped text (<template>, <script), autolinks, reference definitions, non-http(s) link destinations (javascript:), and forged frame tags can't turn into live HTML or links in a Markdown client. structuredContent keeps every OSV string verbatim

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:

json
{  "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.

json
{  "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):

json
{  "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:

json
{  "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:

sh
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http# Server listens at http://localhost:3010/mcp

Prerequisites

  • Bun v1.4.0 or higher (or Node.js v24+).
  • No API key required — OSV.dev is fully public.

Installation

  1. Clone the repository:
sh
git clone https://github.com/cyanheads/osv-advisory-mcp-server.git
  1. Navigate into the directory:
sh
cd osv-advisory-mcp-server
  1. Install dependencies:
sh
bun install
  1. Configure environment:
sh
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.

VariableDescriptionDefault
OSV_REQUEST_TIMEOUT_MSHTTP request timeout for OSV.dev API calls, in milliseconds.10000
OSV_BATCH_CONCURRENCYMaximum concurrent OSV.dev requests issued by osv_query_batch.10
OSV_QUERY_MAX_PAGESMaximum OSV.dev result pages osv_query_package follows before marking a result truncated.10
MCP_TRANSPORT_TYPETransport: stdio or http.stdio
MCP_HTTP_PORTPort for HTTP server.3010
MCP_HTTP_ENDPOINT_PATHHTTP endpoint path./mcp
MCP_PUBLIC_URLPublic origin override for TLS-terminating reverse-proxy deployments.none
MCP_SESSION_MODEHTTP session mode: stateful, stateless, or auto. createApp() declares stateless — no tool has a multi-round input flow — and setting this overrides it.stateless
MCP_AUTH_MODEAuth mode: none, jwt, or oauth.none
MCP_LOG_LEVELLog level (RFC 5424).info
LOGS_DIRDirectory for log files (Node.js only).<project-root>/logs
STORAGE_PROVIDER_TYPEStorage backend.in-memory
OTEL_ENABLEDEnable 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:

    sh
    # One-time buildbun run rebuild
    # Run the built serverbun run start:stdio# orbun run start:http
  • Run checks and tests:

    sh
    bun run devcheck   # Lint, format, typecheck, securitybun run test       # Vitest test suitebun run lint:mcp   # Validate MCP definitions against specbun run check:ecosystems  # Compare osv_list_ecosystems with the live OSV schema and API

Docker

sh
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

DirectoryPurpose
src/index.tscreateApp() entry point — registers tools and inits services.
src/configServer-specific environment variable parsing and validation with Zod.
src/mcp-server/toolsTool definitions (*.tool.ts) — osv_query_package, osv_query_batch, osv_get_vulnerability, osv_list_ecosystems.
src/services/osv-apiOSV.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/catch in tool logic
  • Use ctx.log for request-scoped logging, ctx.enrich for response context, and ctx.signal for cancellable OSV requests
  • 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 are welcome. Run checks and tests before submitting:

sh
bun run devcheckbun run test

License

Apache-2.0 — see LICENSE for details.

來源:README.md,提交 29bf0e0

工具

0
工具後設資料尚未被收錄。

版本歷史

3
  1. v0.1.15最新Sep 24, 2026
  2. v0.1.14Sep 20, 2026
  3. v0.1.13Sep 16, 2026