The advisory MCP server pairs well with a code-search MCP server (for example
GitHub's hosted search_code, or a local semantic code-search server). Together
they turn "is there a known vulnerability like X?" into "here is the matching
code path in this repository, and here is the fix."
advisory— this server, over a local clone ofgithub/advisory-database. Tools:list_advisories(filters below) andget_advisory(ghsa_id).- code search —
search_code(or equivalent) to locate a pattern in source.
- "Do we have advisories for this library / ecosystem / CWE?"
- "Where does the sink described by advisory
GHSA-…exist in this repo?" - "Triage which advisories actually reach code in this codebase."
- "Summarise the fix and affected version range for a review."
- Scope the class with
list_advisories— prefer narrow, structured filters over free text:ecosystem— accepts GitHub names (npm,pip,composer,maven,nuget,rubygems,go,rust,erlang,pub,swift,actions); these are mapped to the OSV names in the data (PyPI,Packagist,crates.io,Hex, …).cwes— comma-separated, bare or prefixed ("89","CWE-89","79,89").affects— package-name substring ("doctrine","sequelize").severity—low|medium|high|critical|unknown.published/updated— single day"2026-01-27"or inclusive range"2026-01-01..2026-06-30".sort(published|updated),direction(asc|desc),per_page(≤100).
- Read the detail with
get_advisory(ghsa_id)— thedescriptionusually contains the vulnerable pattern and the fix; also checkcwes,cvss,vulnerabilities[].vulnerable_version_range, andreferences. - Extract the pattern — the concrete code shape the advisory describes.
- Find it in code with
search_code, scoped to the target repository. - Correlate and act — confirm the code path uses an affected version, then write up the finding, the fix (upgrade / input validation), and the review.
Goal: locate the code behind an ORM query-injection advisory.
get_advisory("GHSA-2xmm-g482-4439")→ DQL injection through sorting parameters (CVE-2022-24752, CWE-89): a sort/ORDER BYvalue taken from user input was passed to the query builder; the fix validates the sort field and direction against an allow-list.- Pattern: an order/sort value derived from request input and concatenated into a query builder.
search_code: look fororderBy(/addOrderBy(fed from request/query parameters in the target repo.- Correlate: a matching call plus an affected dependency version indicates the code is reachable; recommend the upstream fix (allow-list the sort field) and the version upgrade.
Sibling classes already in the corpus: Sequelize (affects: "sequelize"),
Hibernate/NHibernate (affects: "hibernate"), Laravel Eloquent
(affects: "eloquent"), Django ORM (ecosystem: "pip", cwes: "89").
| Goal | Call |
|---|---|
| PHP/Composer SQL-injection cluster | list_advisories(ecosystem="composer", cwes="89", per_page=50) |
| Recently-changed criticals | list_advisories(severity="critical", updated="2026-08-01..2026-09-13") |
| One package's history | list_advisories(affects="sequelize") |
| A specific advisory | get_advisory("GHSA-…") |
.vscode/mcp.json (local; add a code-search server alongside advisory):
The github server is optional and requires access to GitHub's hosted MCP; for
a fully local/offline target, use a code-search MCP pointed at the repo instead.
- Search matches literal substrings of summary/description; there is no semantic ranking. Query with concrete terms (library names, CWE ids) and prefer the structured filters above.
- Rebuild + restart the server after code changes — it runs from
dist/. - Keep the database current:
git -C external/advisory-database pullbefore a session, or rely on the server's refresh-on-start. - Ports: the server's local API and the test suite both default around 18005/18006; the config above moves the server to 18025 so they don't collide.
{ "servers": { "advisory": { "command": "node", "args": ["${workspaceFolder}/dist/index.js"], "type": "stdio", "env": { "ADVISORY_REPO_PATH": "${workspaceFolder}/external/advisory-database", "ADVISORY_API_PORT": "18025" } }, "github": { "type": "http", "url": "https://api.githubcopilot.com/mcp/" } } }