io.github.cyanheads/osv-advisory-mcp-server
Query OSV.dev for package vulnerabilities and batch-audit dependency lists via MCP.
ماذا يمكنك أن تفعل مع io.github.cyanheads/osv-advisory-mcp-server؟
- No API key required — OSV.dev is public and keyless, with no published rate limit
osv_query_batchfinds matching advisory IDs through OSV's/v1/querybatch, then fetches each unique advisory once, so batch rows carry the full records (aliasesincluded) the batch endpoint omits; requests are capped byOSV_BATCH_CONCURRENCYosv_list_ecosystemsis checked against the live OSV schema and API withbun run check:ecosystems- Truncation is never read as clean —
truncatedflags incomplete OSV pagination, and truncated batch rows are left out ofcleanCount aliases(CVE IDs) on every advisory chain tonist-nvd-mcp-serverfor CVSS base scores and CISA KEV status- Responses are capped at 24,000 bytes. Start retrieval by repeating the original input with
page: overflow.page. Continue the samepathwithoffset: page.nextOffsetandrevision: page.revisionuntilnextOffsetis null. Fetch each `entries[].deferre... - Advisory text in
content[]is escaped so it can't render as live HTML or links;structuredContentkeeps every OSV string verbatim
التثبيت
أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: .cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).
claude mcp add --transport http osv-advisory-mcp-server 'https://osv-advisory.caseyjhand.com/mcp'
{
"mcpServers": {
"osv-advisory-mcp-server": {
"type": "http",
"url": "https://osv-advisory.caseyjhand.com/mcp"
}
}
}
@cyanheads/osv-advisory-mcp-serverclaude mcp add osv-advisory-mcp-server -e 'OSV_REQUEST_TIMEOUT_MS=10000' -e 'OSV_BATCH_CONCURRENCY=10' -e 'OSV_QUERY_MAX_PAGES=10' -e 'MCP_LOG_LEVEL=info' -- npx -y @cyanheads/osv-advisory-mcp-server@0.3.0
{
"mcpServers": {
"osv-advisory-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/osv-advisory-mcp-server@0.3.0"
],
"env": {
"OSV_REQUEST_TIMEOUT_MS": "10000",
"OSV_BATCH_CONCURRENCY": "10",
"OSV_QUERY_MAX_PAGES": "10",
"MCP_LOG_LEVEL": "info"
}
}
}
}
متغيرات البيئة
OSV_REQUEST_TIMEOUT_MSHTTP request timeout in milliseconds for OSV.dev API calls.OSV_BATCH_CONCURRENCYMaximum number of concurrent OSV.dev requests issued by osv_query_batch.OSV_QUERY_MAX_PAGESMaximum number of OSV.dev result pages followed per package or commit before marking a result truncated.MCP_LOG_LEVELSets the minimum log level for output (e.g., 'debug', 'info', 'warn').
@cyanheads/osv-advisory-mcp-serverclaude mcp add osv-advisory-mcp-server -e 'MCP_TRANSPORT_TYPE=<MCP_TRANSPORT_TYPE>' -e 'OSV_REQUEST_TIMEOUT_MS=10000' -e 'OSV_BATCH_CONCURRENCY=10' -e 'OSV_QUERY_MAX_PAGES=10' -e 'MCP_HTTP_HOST=127.0.0.1' -e 'MCP_HTTP_PORT=3010' -e 'MCP_HTTP_ENDPOINT_PATH=/mcp' -e 'MCP_AUTH_MODE=none' -e 'MCP_SESSION_MODE=stateless' -e 'MCP_LOG_LEVEL=info' -- npx -y @cyanheads/osv-advisory-mcp-server@0.3.0
{
"mcpServers": {
"osv-advisory-mcp-server": {
"command": "npx",
"args": [
"-y",
"@cyanheads/osv-advisory-mcp-server@0.3.0"
],
"env": {
"MCP_TRANSPORT_TYPE": "<MCP_TRANSPORT_TYPE>",
"OSV_REQUEST_TIMEOUT_MS": "10000",
"OSV_BATCH_CONCURRENCY": "10",
"OSV_QUERY_MAX_PAGES": "10",
"MCP_HTTP_HOST": "127.0.0.1",
"MCP_HTTP_PORT": "3010",
"MCP_HTTP_ENDPOINT_PATH": "/mcp",
"MCP_AUTH_MODE": "none",
"MCP_SESSION_MODE": "stateless",
"MCP_LOG_LEVEL": "info"
}
}
}
}
متغيرات البيئة
MCP_TRANSPORT_TYPESelects the HTTP transport.OSV_REQUEST_TIMEOUT_MSHTTP request timeout in milliseconds for OSV.dev API calls.OSV_BATCH_CONCURRENCYMaximum number of concurrent OSV.dev requests issued by osv_query_batch.OSV_QUERY_MAX_PAGESMaximum number of OSV.dev result pages followed per package or commit before marking a result truncated.MCP_HTTP_HOSTThe hostname for the HTTP server.MCP_HTTP_PORTThe port to run the HTTP server on.MCP_HTTP_ENDPOINT_PATHThe endpoint path for the MCP server.MCP_AUTH_MODEAuthentication mode to use: 'none', 'jwt', or 'oauth'.MCP_SESSION_MODEHTTP session mode. This server deploys stateless because its tools do not use multi-round input.MCP_LOG_LEVELSets the minimum log level for output (e.g., 'debug', 'info', 'warn').
التوثيق
مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.
المحتويات
@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.
5 Tools
Public Hosted Server: https://osv-advisory.caseyjhand.com/mcp
Overview
Vulnerability data from OSV.dev, the open-source vulnerability database. Query a package version or Git commit, batch-audit a dependency list or SBOM, and fetch complete advisory records with CVSS severity, CVE aliases, and affected version ranges.
Tools
| Tool | Description |
|---|---|
osv_query_package | Query a package version by name/ecosystem/version or Package URL (PURL) |
osv_query_batch | Audit up to 1000 package versions in one call — a full dependency list or SBOM |
osv_query_commit | Query known vulnerabilities for a full Git commit hash |
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 |
Capability reference
osv_query_package tool
- Provide
name,ecosystem(case-sensitive exact match), andversion, or apurlsuch aspkg:pypi/jinja2@3.1.4. A PURL needs exactly one version: embedded in the URL or supplied separately. Versions are exact, never ranges - Each advisory carries CVE
aliases,severityLabelwith itsseveritySource, the queried package'sfixedVersions,affectedRanges, andcweIds truncated: truemeans OSV had more pages thanOSV_QUERY_MAX_PAGESfollows, so an emptyvulnslist is not a clean result; an unrecognized ecosystem fails asinvalid_ecosystem
osv_query_batch tool
- 1–1000
{name, ecosystem, version}tuples or{purl, version?}entries per call; mix either form, andresults[i]matchespackages[i] - Each row carries
vulnerable,vulnCount,vulns,truncated, anderror; a failure lands in the affected rows'errorinstead of failing the call summarytotals the scan (vulnerableCount,cleanCount,truncatedCount,errorCount,totalVulns,worstSeverity), and truncated rows never count as clean. The whole scan has a 50-second deadline
osv_query_commit tool
- One full
commit: 40 hexadecimal characters for SHA-1 or 64 for SHA-256; either letter case is accepted, abbreviations are rejected - Advisories retain record-wide severity, aliases, and GIT ranges with repository URLs and ordered events. No package-specific
fixedVersionsare inferred truncated: truemeans more OSV pages remain; an empty truncated result is not confirmed clean
osv_get_vulnerability tool
- One exact advisory ID from any OSV source (
GHSA-,PYSEC-,RUSTSEC-,GO-,DSA-,USN-,CVE-, …), matched case-sensitively - Full record:
details,aliases, every affected package with its ranges and fixes,severityLabel,cweIds, andreferences - An unknown ID fails as
vulnerability_not_found;withdrawnis set only on retracted advisories
osv_list_ecosystems tool
- No input; returns the
ecosystemsstrings the query tools accept, plus anotewith the date the list was last checked against OSV.dev - Strings are case-sensitive exact matches:
PyPIworks,pypifails
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 public and keyless, with no published rate limit
osv_query_batchfinds matching advisory IDs through OSV's/v1/querybatch, then fetches each unique advisory once, so batch rows carry the full records (aliasesincluded) the batch endpoint omits; requests are capped byOSV_BATCH_CONCURRENCYosv_list_ecosystemsis checked against the live OSV schema and API withbun run check:ecosystems
Agent-friendly output:
- Truncation is never read as clean —
truncatedflags incomplete OSV pagination, and truncated batch rows are left out ofcleanCount aliases(CVE IDs) on every advisory chain tonist-nvd-mcp-serverfor CVSS base scores and CISA KEV status- Responses are capped at 24,000 bytes. Start retrieval by repeating the original input with
page: overflow.page. Continue the samepathwithoffset: page.nextOffsetandrevision: page.revisionuntilnextOffsetis null. Fetch eachentries[].deferred.pathseparately at offset zero without a revision; never copy the whole outputpageobject into the input - Advisory text in
content[]is escaped so it can't render as live HTML or links;structuredContentkeeps 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:
{
"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.
{
"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.4.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, and every variable is optional.
| Variable | Description | Default |
|---|---|---|
OSV_REQUEST_TIMEOUT_MS | HTTP request timeout for OSV.dev API calls, in milliseconds. | 10000 |
OSV_BATCH_CONCURRENCY | Maximum concurrent OSV.dev requests issued by osv_query_batch. | 10 |
OSV_QUERY_MAX_PAGES | Maximum OSV.dev result pages followed per package or commit before a result is marked truncated. | 10 |
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_SESSION_MODE | HTTP session mode: stateless, stateful, or auto. | stateless |
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 |
LOG_TOOL_FAILURE_PAYLOADS | Log each failed tool call's arguments and result, redacted by key name and capped at LOG_TOOL_FAILURE_PAYLOAD_MAX_BYTES (default 16384). A secret inside a free-form value is not redacted. | false |
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 bun run check:ecosystems # Compare osv_list_ecosystems with the live OSV schema and API
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/config | Server-specific environment variable parsing and validation with Zod. |
src/mcp-server/tools | Tool definitions (*.tool.ts) — osv_query_package, osv_query_batch, osv_query_commit, 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.enrichfor response context, andctx.signalfor 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:
bun run devcheck
bun run test
License
Apache-2.0 — see LICENSE for details.
الأسئلة الشائعة
ما هو io.github.cyanheads/osv-advisory-mcp-server؟
Query OSV.dev for package vulnerabilities and batch-audit dependency lists via MCP.
كيف أثبّت io.github.cyanheads/osv-advisory-mcp-server؟
يعمل كخادم بعيد. في Claude Code: claude mcp add --transport http osv-advisory-mcp-server 'https://osv-advisory.caseyjhand.com/mcp'. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.
هل يحتاج io.github.cyanheads/osv-advisory-mcp-server إلى مفتاح API؟
لا يذكر إدراجه في السجل أي مفتاح أو سر إلزامي. قد تتطلب بعض الميزات حسابًا لدى الخدمة التي يتصل بها.
هل io.github.cyanheads/osv-advisory-mcp-server مفتوح المصدر؟
نعم. شيفرته متاحة على GitHub بترخيص Apache-2.0.
من يصون io.github.cyanheads/osv-advisory-mcp-server؟
ينشره cyanheads. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.
من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.