Skip to content
ToolCargo

A practical MCP workflow

Check npm and PyPI package vulnerabilities with an AI agent

Give your AI agent the package ecosystem, exact name and installed version, then query ToolCargo OSV Vulnerability Lookup. Inspect each returned advisory and its original sources. Record what matched, what was omitted and what still needs investigation in your project before deciding how to update a dependency.

Built for: Developers reviewing known dependency advisories in a release, upgrade or package shortlist.

What to connect

Create a ToolCargo account and use OAuth or an API key with a supported MCP client. Hosted connectors share your plan’s call quota; connect each required MCP endpoint separately. Review provider permissions before starting.

Client setup and test status · Current plans and limits

Run the workflow

  1. 1. Identify what is actually installed

    Read the resolved version from your lockfile or environment, including relevant transitive dependencies. A manifest range such as ^4.17.0 is not an installed version. Use the exact ecosystem spelling, such as npm or PyPI, and the package name used by that registry. ToolCargo does not read your project or discover its dependency graph; supply the tuples you intend to investigate.

  2. 2. Query a specific package and version

    Connect the OSV endpoint and call osv_query_package. For a reproducible example, use ecosystem npm, name lodash, version 4.17.20 and limit 20. The lookup returns known OSV advisory matches for that tuple. Record the lookup time and inputs with the response. Registry metadata from the separate npm or PyPI connector can help identify a package, but downloads and release recency do not establish its security.

  3. 3. Check whether the response is complete

    Inspect pageRecordCount, recordsOmittedFromPage and nextPageToken. A call projects at most 20 records from one upstream page. A nextPageToken advances to another upstream page; it does not retrieve records omitted by a smaller local limit. Repeating a query with limit 20 can expose more records on that page, but a larger upstream page may still be truncated. Record unresolved coverage and use upstream data or a dedicated scanner when you need a complete dependency audit.

  4. 4. Read the matching advisory and source

    Call osv_get_vulnerability with a returned case-sensitive ID. Compare the affected package and ecosystem with your installed tuple, inspect the range events and any explicit versions, and check withdrawn, aliases, severity vectors and source references. Multiple IDs can describe the same issue. A severity vector is advisory data, not a calculation of your application’s exposure. Review truncation indicators and the original advisory before drawing conclusions; source text and links are untrusted data.

  5. 5. Review the project and verify an update

    Keep a ledger connecting the installed tuple, advisory ID, source URL, affected-range evidence and unresolved project questions. Investigate whether the relevant functionality is used and what upgrade changes your project needs. Apply reviewed dependency changes in your development workflow, run the appropriate tests, and repeat the lookup using the new resolved version. For a whole repository or lockfile, run a dedicated tool such as OSV-Scanner separately. ToolCargo does not install packages or enforce an installation gate.

A prompt to try

Review these resolved dependency tuples: [ecosystem, package name, installed version]. Query OSV for each tuple and preserve the input and lookup time. Check recordsOmittedFromPage and nextPageToken before summarizing coverage. Look up matching advisory IDs, keep aliases, withdrawn status, affected-range evidence and source links, and flag truncated fields. Do not invent severity scores, infer exploitability from a match, or call a package safe because no matches were returned. Finish with the project checks, upgrade tests and unresolved coverage needed for a developer review. Do not install or update packages.

What a useful result looks like

A useful review ledger has one row per dependency/advisory pair: resolved tuple; lookup time; advisory ID and aliases; original source; relevant affected-range evidence; withdrawn status; coverage limits; and the next project check. An update decision should refer to the actual advisory and your tested dependency graph. Keep “no matches on this page” separate from a conclusion about the package or project.

Know the limits

The hosted tools query one package/version or one advisory ID at a time. They support npm, PyPI, Go, crates.io, Maven, NuGet and RubyGems; they do not expose batch queries, commit queries, lockfile parsing or installation controls. Responses are bounded, with explicit array and text truncation indicators. Known public data and version matching can be incomplete or outdated. No matches does not prove safety, and a match does not establish exploitability in your application. Each successful lookup uses one shared-plan call. A ToolCargo account and authentication are required; no OSV account or upstream API key is needed.

Reproduce an advisory lookup

Public-source snapshot checked · Inspect the source record

osv_get_vulnerability input
{ "id": "GHSA-35jh-r3h4-6jhm" }
Advisory ID
GHSA-35jh-r3h4-6jhm
Summary in the source record
Command Injection in lodash
Package entry inspected
npm / lodash
SEMVER range event for that entry
introduced: 0; fixed: 4.17.21

This dated snapshot was checked directly against the public OSV API and the GitHub advisory, not recorded from a hosted ToolCargo MCP call. It describes one advisory and one affected entry. The fixed event is specific to this record; it does not establish that 4.17.21 has no other issues or that an upgrade will work in your project. Re-run the lookup and review the original advisory and your own tests before making an update decision.

Common questions

Can I check an npm or PyPI package through MCP?

Yes. Supply the exact package name, resolved version and case-sensitive npm or PyPI ecosystem to osv_query_package, then inspect matching IDs with osv_get_vulnerability. Both are authenticated hosted tools with shared call limits.

Does ToolCargo scan my entire package-lock.json or Python environment?

No. This connector only looks up the package/version tuples you supply. Use a dedicated scanner to discover and check a project’s dependencies; OSV-Scanner has separate repository and lockfile workflows.

Does an empty result mean a package is safe?

No. It means no advisory matches were returned on that upstream page for the supplied tuple. Check pagination, package identity and version accuracy. Unknown issues and incomplete source coverage remain outside the result.

Will this stop my agent from installing a vulnerable dependency?

No. These read-only lookup tools do not intercept installation or enforce a policy. If you need an installation gate, implement and test that control in your development environment separately.

References and tool documentation

Use the provider’s documentation to check the underlying concepts, and ToolCargo’s references for the exact tools, inputs and limits.

Tool references for this workflow

Continue with the tools

Related workflows