An MCP (Model Context Protocol) server that provides access to the OSV (Open Source Vulnerabilities) database. This project implements an SSE-based MCP server that allows LLM-powered applications to query the OSV database for vulnerability information. The server provides tools for: 1. Querying vulnerabilities for a specific package version or commit 2. Batch querying vulnerabilities for multiple
Add this skill
npx mdskills install StacklokLabs/osv-mcpWell-documented MCP server with clear tool schemas and comprehensive setup instructions
1# OSV MCP Server2[](https://archestra.ai/mcp-catalog/stackloklabs__osv-mcp)34An MCP (Model Context Protocol) server that provides access to the5[OSV (Open Source Vulnerabilities) database](https://osv.dev/).67## Overview89This project implements an SSE-based MCP server that allows LLM-powered10applications to query the OSV database for vulnerability information. The server11provides tools for:12131. Querying vulnerabilities for a specific package version or commit142. Batch querying vulnerabilities for multiple packages or commits153. Getting detailed information about a specific vulnerability by ID1617## Installation1819### Prerequisites2021- Go 1.21 or later22- [Task](https://taskfile.dev/) (optional, for running tasks)23- [ko](https://ko.build/) (optional, for building container images)2425### Building from source2627```bash28# Clone the repository29git clone https://github.com/StacklokLabs/osv-mcp.git30cd osv-mcp3132# Build the server33task build34```3536## Usage3738### Running with ToolHive (Recommended)3940The easiest way to run the OSV MCP server is using41[ToolHive](https://github.com/stacklok/toolhive), which provides secure,42containerized deployment of MCP servers:4344```bash45# Install ToolHive (if not already installed)46# See: https://docs.stacklok.com/toolhive/guides-cli/install4748# Register a supported client so ToolHive can auto-configure your environment49thv client setup5051# Run the OSV MCP server (packaged as 'osv' in ToolHive)52thv run osv5354# List running servers55thv list5657# Get detailed information about the server58thv registry info osv59```6061The server will be available to your MCP-compatible clients and can query the62OSV database for vulnerability information.6364### Running from Source6566### Server Configuration6768The server can be configured using environment variables:6970- `MCP_PORT`: The port number to run the server on (default: 8080)7172 - Must be a valid integer between 0 and 6553573 - If invalid or not set, the server will use port 80807475- `MCP_TRANSPORT`: The transport mode for the server (default: `sse`)76 - Supported values: `sse`, `streamable-http`77 - If invalid or not set, the server will use SSE transport mode7879Example:8081```bash82# Run on port 300083MCP_PORT=3000 ./build/osv-mcp-server8485# Run on default port 808086./build/osv-mcp-server87```8889### MCP Tools9091The server provides the following MCP tools:9293#### query_vulnerability9495Query for vulnerabilities affecting a specific package version or commit.9697**Input Schema:**9899```json100{101 "type": "object",102 "properties": {103 "commit": {104 "type": "string",105 "description": "The commit hash to query for. If specified, version should not be set."106 },107 "version": {108 "type": "string",109 "description": "The version string to query for. If specified, commit should not be set."110 },111 "package_name": {112 "type": "string",113 "description": "The name of the package."114 },115 "ecosystem": {116 "type": "string",117 "description": "The ecosystem for this package (e.g., PyPI, npm, Go)."118 },119 "purl": {120 "type": "string",121 "description": "The package URL for this package. If purl is used, package_name and ecosystem should not be set."122 }123 }124}125```126127#### query_vulnerabilities_batch128129Query for vulnerabilities affecting multiple packages or commits at once.130131**Input Schema:**132133```json134{135 "type": "object",136 "properties": {137 "queries": {138 "type": "array",139 "description": "Array of query objects",140 "items": {141 "type": "object",142 "properties": {143 "commit": {144 "type": "string",145 "description": "The commit hash to query for. If specified, version should not be set."146 },147 "version": {148 "type": "string",149 "description": "The version string to query for. If specified, commit should not be set."150 },151 "package_name": {152 "type": "string",153 "description": "The name of the package."154 },155 "ecosystem": {156 "type": "string",157 "description": "The ecosystem for this package (e.g., PyPI, npm, Go)."158 },159 "purl": {160 "type": "string",161 "description": "The package URL for this package. If purl is used, package_name and ecosystem should not be set."162 }163 }164 }165 }166 },167 "required": ["queries"]168}169```170171#### get_vulnerability172173Get details for a specific vulnerability by ID.174175**Input Schema:**176177```json178{179 "type": "object",180 "properties": {181 "id": {182 "type": "string",183 "description": "The OSV vulnerability ID"184 }185 },186 "required": ["id"]187}188```189190## Examples191192### Querying vulnerabilities for a package193194```json195{196 "package_name": "lodash",197 "ecosystem": "npm",198 "version": "4.17.15"199}200```201202### Querying vulnerabilities for a commit203204```json205{206 "commit": "6879efc2c1596d11a6a6ad296f80063b558d5e0f"207}208```209210### Batch querying vulnerabilities211212```json213{214 "queries": [215 {216 "package_name": "lodash",217 "ecosystem": "npm",218 "version": "4.17.15"219 },220 {221 "package_name": "jinja2",222 "ecosystem": "PyPI",223 "version": "2.4.1"224 }225 ]226}227```228229### Getting vulnerability details230231```json232{233 "id": "GHSA-vqj2-4v8m-8vrq"234}235```236237## Development238239### Running tests240241```bash242task test243```244245### Linting246247```bash248task lint249```250251### Formatting code252253```bash254task fmt255```256257## Contributing258259We welcome contributions to this MCP server! If you'd like to contribute, please260review the [CONTRIBUTING guide](./CONTRIBUTING.md) for details on how to get261started.262263If you run into a bug or have a feature request, please264[open an issue](https://github.com/StacklokLabs/osv-mcp/issues) in the265repository or join us in the `#mcp-servers` channel on our266[community Discord server](https://discord.gg/stacklok).267268## License269270This project is licensed under the Apache v2 License - see the LICENSE file for271details.272
Full transparency — inspect the skill content before installing.