NPMScan

io.github.salemalem由 GitHub 帳號 salemalem 發布v3.1.2更新於 Oct 24, 2026

Detect malicious or vulnerable npm packages: registry search, OSV.dev and GitHub advisory lookups

發布方自己的服務:scan.mx Email Diagnostics

已驗證Streamable HTTP可網頁執行資料庫開發者工具安全與監控

概覽

AI 產生的概覽

唯讀的 npm 套件與漏洞查詢服務:搜尋套件、檢查 OSV/NVD 公告、安裝腳本、發布來源與維護者資訊。

可以做什麼
  • 搜尋 npm 套件並比較候選套件,附下載量、相依數與仿冒套件訊號
  • 取得套件及指定版本的中繼資料、維護者資料與維護者變更歷史
  • 查詢 OSV.dev 與 NIST NVD 的漏洞、CVE、惡意套件標記與最新公告,可單筆或批次
  • 掃描安裝腳本、傳遞相依樹、發布來源證明與授權條款合規
  • 比對鎖定檔、模擬升級、排序修復優先順序並產生 CycloneDX 或 SPDX SBOM
  • 稽核 GitHub 儲存庫的相依套件,並解析 npm audit 原始輸出
適用情境
適合在需要判斷某個 npm 套件是否可安全安裝、相依清單或鎖定檔是否有已知漏洞、兩份相依快照之間有何變化,或在多個候選套件中做選擇時使用。
執行需求
使用 npmscan.com 上的遠端 streamable HTTP 端點;不需要 API 金鑰、帳號或本機執行環境。服務為無狀態,並依 IP 限制每分鐘 30 次請求。
安裝前請注意
查詢內容以及貼上的 package.json、鎖定檔或 SBOM 內容會傳送到 npmscan.com,再由其查詢 npm、OSV.dev、GitHub 與 NVD。安裝腳本與來源證明的結果屬於啟發式或結構性判斷,並非惡意行為的證明。有依 IP 的速率限制。

安裝

在 SourceWeft 中

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

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

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.salemalem%2Fnpmscan/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

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

{
  "mcpServers": {
    "npmscan": {
      "type": "http",
      "url": "https://npmscan.com/api/mcp"
    }
  }
}

README

NPMScan plugin for Claude Code

A Claude Code plugin that gives Claude read-only npm package and vulnerability lookups, backed by npmscan.com's free, unauthenticated MCP server.

NPMScan is also officially listed for both ChatGPT and Claude on npmscan.com's MCP page, so users can verify that this plugin points at the same public service.

Official listings

Pending:

What it adds

  • MCP server (npmscan, https://npmscan.com/api/mcp) with twenty-three tools — see Tools below. Every tool result includes an npmscanUrl linking back to the full write-up on npmscan.com. No API key or auth required — same public data as the website. The server is stateless and rate-limited to 30 requests/minute per IP. Every vulnerability finding carries isMalware, so a confirmed-malicious package is reported as malware to remove, never as an ordinary bug.

  • /npmscan:dependency-audit skill — chains batch_query_vulnerabilities → get_package/get_package_version → analyze_transitive_dependencies → the maintainer/provenance/license/remediation/alternative tools into one dependency-audit report, instead of leaving that tool sequencing to Claude each time. Also handles PR-style before/after diffs via diff_dependencies, raw npm audit --json output via enrich_npm_audit, and a bare GitHub repo URL via audit_github_repository. Triggers automatically when you paste a package.json/lockfile/SBOM, give a GitHub repo URL, or ask to check/audit your dependencies, or invoke it directly. See skills/dependency-audit/SKILL.md.

  • /npmscan:package-trust-check skill — a deep, single-package investigation for "is X safe / was X compromised" questions: a malware check (including versions npm has since removed for being malicious), maintainer add/remove history (account-takeover patterns), publish-provenance cross-checks, and install-script scanning, in one report. Triggers automatically on a trust question about one named package; not for auditing a whole dependency list (that's dependency-audit). See skills/package-trust-check/SKILL.md.

  • /npmscan:new-dependency-evaluation skill — for a forward-looking choice about what to add, not what's already installed: comparing 2-5 named candidates ("axios vs got vs node-fetch"), evaluating one candidate against its real peers, or shortlisting candidates from a described need. Orchestrates compare_packages/suggest_alternative/search_packages into a structured side-by-side with a deterministic pick. See skills/new-dependency-evaluation/SKILL.md.

  • /npmscan:incident-response skill — turns an existing finding, or just a vague symptom description ("npm install did something weird"), into concrete get_remediation_playbook steps: real incident references, severity, and prevention tips, not improvised advice. See skills/incident-response/SKILL.md.

  • /npmscan:ci-pr-gate skill — turns a dependency change (a before/after snapshot, or one or more named "bump X from A to B" upgrades) into one deterministic PASS/WARN/FAIL verdict formatted for a CI check or PR-comment bot, applying a fixed policy on top of diff_dependencies/simulate_dependency_upgrade — not a conversational report (that's dependency-audit's job). See skills/ci-pr-gate/SKILL.md.

Tools

NPMScan provides twenty-three tools:

ToolDescription
search_packagesSearch the npm registry by name or keywords. Each result includes weekly/monthly download counts, dependent-package counts, and rank among npmscan's own top-100k-by-downloads snapshot, so you can tell an established package from an abandoned or squatted one that merely matches the query text — flags possibleTyposquatOf when a low-popularity result's name is one typo away from a top-5,000 package.
get_packageLatest version, install scripts (preinstall/install/postinstall/prepare), maintainers, license, recent version history, weekly downloads, GitHub stars, TypeScript support, days since last publish, ecosystem-wide download rank, a 3-month download trend, and an isLatestVersionVulnerable/highestSeverity verdict (with fixed versions and isMalware per finding) — plus a rule-based (not model-generated) maintenance/popularity summary and typosquat flag computed from those numbers.
get_package_versionMetadata for one exact version plus an OSV.dev check scoped to that version — isVulnerable/highestSeverity as a direct safe/not-safe answer, with each finding's severity, summary, fixed version and isMalware. For checking a version pinned in a lockfile. A version npm has removed but OSV still has advisories for (usually one pulled for being malicious) comes back with versionExists: false and those findings, not a bare "not found".
get_maintainer_profilePackages an npm username currently maintains via npm's own maintainer:<username> search index, plus precomputed download/dependent totals across all of them. Lists the most-downloaded limit packages (default 50, max 250); totals still cover every package found. A plain info lookup, not a security check — pair it with check_maintainer_blast_radius for the actual compromised-account signal.
query_vulnerabilitiesOSV.dev lookup for known vulnerabilities affecting a package, optionally scoped to a version, with isVulnerable/highestSeverity as a direct verdict and each finding's severity, summary, fixed version and isMalware. For npm it also cross-checks the name/version against the registry: a name or version that isn't on npm still returns its OSV data, with packageExists: false and an existenceCheckNote — so a typo doesn't read as "clean", and a version removed for malware still shows its findings. Accepts packageName as an alias for name, and other ecosystems via ecosystem (e.g. "PyPI").
batch_query_vulnerabilitiesOSV.dev lookup across a whole dependency inventory at once — pass a flat packages list, or paste raw package.json/lockfile/CycloneDX JSON/SPDX JSON content via content and it parses that for you. Chunks large inventories internally, with severity, summary, CVE aliases, fixed version and isMalware per finding. Also reports names/versions that aren't on npm (unresolvedPackages/nonexistentVersions — never read those as clean), per-package signals (deprecated, install scripts, popularity, typosquat), and for lockfiles a source check that flags a tarball from an unexpected host or one that is a different package than declared (identityMismatch).
get_latest_advisoriesRecently published npm advisories from one of three sources (one per call): type: "reviewed" (default) is GitHub's curated, mostly CVE-backed set, filterable by severity, vulnerability category, affected package name, or an exact GHSA/CVE ID; type: "malware" is GitHub's own malicious-package advisories; type: "osv" is OSV.dev's OpenSSF malicious-packages feed (MAL- ids). Cursor-paginated. These are feeds of recent advisories, not a package's full history — to check whether a package is or was malware, use query_vulnerabilities and its isMalware flags.
get_cveNIST NVD lookup for one exact CVE ID (authoritative CVSS score/vector, CWEs, references), or a keyword/severity/CWE/date-range search. Enriched with CISA KEV status (actively exploited in the wild?) and FIRST.org EPSS (30-day exploitation probability). Falls back to the raw MITRE CVE record when NVD has no data yet. Not npm-scoped — NVD covers every ecosystem.
analyze_install_scriptFetches a package's published tarball and statically scans its preinstall/install/postinstall/prepare lifecycle scripts — and the files they reference, pulled from the tarball itself — against npmscan's red-flags rubric (child_process use, network calls, sensitive-path/env access, obfuscation, untrusted remote binaries, exfil hosts, eval on decoded strings, CI telemetry) plus a typosquat check. Returns a totalScore and riskTier. A prepare-only package scores 0 unless its command does something alarming, since npm never runs a dependency's prepare on install. A heuristic static scan, not proof of malice — it doesn't execute code or check maintainer history.
analyze_transitive_dependenciesRecursively resolves 1-15 direct/root packages' dependency graphs to a configurable depth (default 2, max 3) and batch-checks every resolved package against OSV.dev — surfaces vulnerabilities buried several levels deep that a flat batch_query_vulnerabilities call would miss, with vulnerablePaths naming which direct dependency pulled in each vulnerable transitive package. A total-node budget caps runaway graphs, reported via truncated/truncationNote rather than silently returning a partial scan as complete.
check_package_provenanceChecks a version's npm/Sigstore publish provenance against reality: flags a non-GitHub-hosted builder or an attested source repo that doesn't match package.json's own repository field; flags a package missing provenance while its npm-scope/maintainer peers consistently have it (skipped for versions published before npm provenance existed, 2023-04-19); and diffs the published tarball's install scripts/dependencies against the source repository at the attested commit — the pattern of a stolen-npm-token publish that bypasses CI. For a version npm has removed, the error names any OSV advisories for it. Structural only, not a cryptographic re-verification of the Sigstore bundle.
check_maintainer_changesReconstructs a package's maintainer-add/remove history from the npm packument and flags account-takeover patterns — a new maintainer who published shortly after being added, a sudden full maintainer-list replacement, a long-standing maintainer quietly dropped, or a maintainer change not yet tied to any release. Also cross-checks the declared GitHub repository for transfers/archival.
check_maintainer_blast_radiusGiven an npm username, finds the packages that account currently maintains and flags a tight cluster of packages published within a short rolling window of each other — the compromised-account pattern behind incidents like the 2025 chalk/debug ("qix") compromise and the 2026 keyv/cacheable ("Shai-Hulud") worm. Clusters over a year old count for a quarter, as do clusters at least 30 days old whose versions have no malware advisory, and clusters of near-unused packages don't count. A large total package count alone is never the signal. Lists the most-downloaded limit packages (default 50), always including every package in a cluster.
get_remediation_playbookMaps a finding's rule value from analyze_install_script/check_maintainer_changes/check_package_provenance (or an id slug guessed from a plain-language description) to a human-authored incident-response playbook — concrete steps, severity, real-incident references, and prevention tips, not just a link. Includes compromised-publisher for when your own npm account or tokens were used to publish malware (token revocation, credential rotation, deprecating the bad versions). Pure local lookup, batches up to 10 rules per call.
check_license_complianceGiven a package list and an optional allow/deny license policy, classifies each declared SPDX license (permissive/weak-copyleft/copyleft/network-copyleft/proprietary/public-domain/unknown), understands simple SPDX expressions (OR/AND/WITH), and reports a compliance verdict per package. With no policy given, applies a default rule flagging only copyleft/network-copyleft/proprietary. Ambiguous expressions are reported as needsReview, not silently guessed at.
diff_dependenciesCompares two raw snapshots of a package.json, package-lock.json, yarn.lock, or pnpm-lock.yaml — e.g. before/after a PR — and reports added/removed/version-bumped packages. For every added or bumped package: a newly introduced preinstall/install/postinstall script (installScriptIntroduced; a new prepare is listed but never runs on a registry install), vulnerabilityDelta (introduced/fixed/still-vulnerable/still-clean), sourceIntegrityChanged (same version, different tarball or hash — changeType: "source-swap"), and identityMismatch (the tarball is a different package or version than declared, with vulnerabilities checked for the real one). Also diffs the project's own root lifecycle scripts and overrides. Ideal for a CI gate reviewing a dependency-changing PR.
prioritize_remediationGiven a batch of already-flagged vulnerability findings, ranks them by what to actually fix first, into a remove-now/patch-now/patch-soon/scheduled/monitor tier per finding. Confirmed malware (a MAL- id, or an advisory whose OSV record is a malware advisory — looked up automatically) is remove-now; CISA KEV status (active exploitation) is patch-now; otherwise FIRST.org EPSS (30-day exploitation probability) leads, with severity as a fallback, and an EPSS of 10% or more is at least patch-soon. A fix-order ranking across a backlog, not a merge gate.
simulate_dependency_upgradeClassifies a specific version jump (e.g. a suggested fixedVersion) as safe/low-risk/review-recommended/breaking-change-likely/unknown/do-not-upgrade by semver bump, a newly-deprecated target, a newly-introduced preinstall/install/postinstall script, a tightened Node engine requirement, and a before/after OSV.dev check reporting vulnerabilityDelta. do-not-upgrade means the target is known malware, or npm no longer lists it while OSV still has advisories for it. Accepts a single packageName (or name)/currentVersion/targetVersion, or a packages batch of up to 100 upgrades in one call. Doesn't fetch changelogs or diff source — a fast deterministic pre-check.
suggest_alternativeSuggests better-maintained replacements for a deprecated, vulnerable, abandoned, or suspicious package by combining maintainer-provided deprecation hints, a hand-checked list of known successors for well-known packages (e.g. request → got/undici/ky, colors → @colors/colors), and deterministic npm search/category ranking — filtering out typosquats, deprecated, vulnerable and unverifiable candidates, and returning plain-language whySuggested notes, or a nonPackageAlternatives entry when a language built-in supersedes the package entirely.
compare_packagesGiven 2-5 candidate packages for the same job (e.g. "axios vs got vs node-fetch"), fans the same registry/popularity/maintenance/vulnerability enrichment get_package computes out across every candidate in parallel, adds a lightweight install-script risk signal (a prepare-only candidate isn't penalized) and an install-size rollup (own + transitive), and returns a structured side-by-side plus a deterministic, reasoned pick — never a deprecated or typosquat-flagged candidate. A name that fails to resolve still appears with found:false rather than failing the whole call.
audit_github_repositoryGiven a GitHub repo URL, fetches its package.json/lockfile from the default branch (auto-detecting monorepos via workspace globs) and checks every lockfile entry for known vulnerabilities, then gives up to 100 packages — vulnerable ones first — the license-compliance, install-script and, for up to 5 elevated-risk packages (one slot per package, not per version), ownership-risk checks, in one call, no copy-pasting file contents required. coverage and a summary starting PARTIAL AUDIT say when not everything got every check. The most expensive tool in the suite; avoid calling it in a tight loop across many repos.
generate_sbomGenerates a spec-valid CycloneDX or SPDX SBOM from the same packages/content inputs batch_query_vulnerabilities accepts, with npmscan's own vulnerability and license findings embedded in each format's native fields (CycloneDX's top-level vulnerabilities[], SPDX's externalRefs[]). Every finding's VEX state is in_triage — an honest "OSV/GHSA match found, not manually assessed," never a stronger claim.
enrich_npm_auditIngests raw npm audit --json output directly (npm 7+ or legacy npm 6 format) and ranks it with the same CISA KEV + FIRST.org EPSS + severity scoring as prioritize_remediation, resolving each finding's GHSA advisory to a CVE alias first (npm audit JSON almost never carries a CVE id on its own). yarn audit --json/pnpm audit --json are rejected rather than misparsed — use batch_query_vulnerabilities with the manifest/lockfile for those.

Install

Option 1: add this repo as a marketplace

/plugin marketplace add salemalem/npmscan-mcp-plugin/plugin install npmscan@npmscan/reload-plugins

Option 2: point Claude Code at a local checkout

claude --plugin-dir ./npmscan-mcp-plugin

Useful for testing changes before pushing them.

Option 3: skip the plugin, add the MCP server directly

If you only want the tools (no bundled skills), you don't need this repo at all:

claude mcp add --transport http npmscan https://npmscan.com/api/mcp

or in .mcp.json / ~/.claude.json:

json
{  "mcpServers": {    "npmscan": {      "type": "http",      "url": "https://npmscan.com/api/mcp"    }  }}

(The "type": "http" field is required — Claude Code treats an entry with a url but no type as misconfigured and skips it.)

Try it

Does lodash have any known vulnerabilities?Find npm packages for parsing CSV filesBefore I install left-pad, tell me about its maintainers and install scripts.Is chalk 5.6.1 safe? I heard there was a supply-chain incident.What changed between these two package-lock.json snapshots?Should we use axios, got, or node-fetch for our new HTTP client?Audit https://github.com/expressjs/express for dependency issues.

Or paste a package.json and ask "audit my dependencies for vulnerabilities."

Repo layout

npmscan-mcp-plugin/├── .claude-plugin/│   ├── plugin.json        # plugin manifest│   └── marketplace.json   # lets this repo be added directly as a marketplace├── .mcp.json               # bundles the npmscan MCP server├── README.md├── CHANGELOG.md            # what changed in each plugin version├── LICENSE├── .github/plugin/│   └── plugin.json         # GitHub Copilot plugin manifest├── gemini-extension.json   # Gemini CLI extension manifest├── llms-install.md         # setup steps for Cline's one-click installer├── assets/logo-400.png     # 400×400 logo for the Cline marketplace├── assets/screenshot-*.png # Codex listing screenshots (npmscan.com pages)├── .codex-plugin/│   └── plugin.json         # Codex plugin manifest (ignored by Claude Code)├── .agents/plugins/│   └── marketplace.json    # lets Codex add this repo as a marketplace├── .codexignore            # paths the plugin scanner skips├── .plugin-scanner.toml    # HOL plugin-scanner config (see Using it with Codex)├── SECURITY.md             # how to report a security problem├── kimi.plugin.json        # Kimi plugin manifest (ignored by Claude Code)├── icon.png                # Kimi plugin icon (dark tile, npmscan.com branding)├── locales/                # Kimi interface translations (zh-CN)│   └── zh-CN.json├── outreach/               # directory listings: tracker, per-directory notes, scripts└── skills/                 # shared by both clients; generated, don't edit here (see below)    ├── dependency-audit/    │   ├── SKILL.md    │   └── references/test-prompts.md    ├── package-trust-check/    │   ├── SKILL.md    │   └── references/test-prompts.md    ├── new-dependency-evaluation/    │   ├── SKILL.md    │   └── references/test-prompts.md    ├── incident-response/    │   ├── SKILL.md    │   └── references/test-prompts.md    └── ci-pr-gate/        ├── SKILL.md        └── references/test-prompts.md

Validate and test locally

bash
claude plugin validate .claude --plugin-dir .

Then in the session, run /npmscan:dependency-audit, /npmscan:package-trust-check, /npmscan:new-dependency-evaluation, /npmscan:incident-response, or /npmscan:ci-pr-gate (or just paste a package.json/name a package and ask) to exercise each skill, and try the prompts in each skill's references/test-prompts.md.

Submitting to a marketplace

NPMScan is already listed in Anthropic's plugin directory (see Official listings). The values used for that submission form are in outreach/targets/claude.md; update them there when the plugin changes.

  • Self-hosted (this repo): nothing further to do — anyone can /plugin marketplace add this repo directly, as shown above.
  • claude-plugins-community: submit via claude.ai/admin-settings/directory/submissions/plugins/new (Team/Enterprise orgs) or platform.claude.com/plugins/submit (individual authors). Run claude plugin validate . first — the review pipeline runs the same check.
  • claude-plugins-official: curated directly by Anthropic; there's no application form for it.

See Anthropic's plugin docs for the full development and distribution guide.

Using it with Kimi

This same repo is also a Kimi plugin: kimi.plugin.json declares the same MCP server and points at the same skills/ directory. Claude Code ignores that file, and Kimi prefers it over .claude-plugin/plugin.json, so each client reads its own manifest and both load the same five skills.

  • Kimi Code CLI: /plugins install https://github.com/salemalem/npmscan-mcp-plugin (or /plugins install ./ from a local checkout).
  • Kimi Work: in the plugin marketplace, click "Custom plugin" and ask Plugin Builder to import https://github.com/salemalem/npmscan-mcp-plugin. It appears under the Personal tab; click + to install.

The manifest is prepared for the official Kimi marketplace: full zh-CN locale, brandColor (#ef4444, npmscan.com's primary red), a dark rounded-tile icon.png built from the site's dark-mode logo, and hostKind: hosted. Kimi's local validation passed with 0 errors / 0 warnings on v3.0.2 (the last version imported into Kimi; see outreach/targets/kimi.md). Official-marketplace publication goes through a Kimi review step — see outreach/targets/kimi.md for the status and the application steps.

Test results and marketplace submission steps: outreach/targets/kimi.md.

When editing, keep Kimi-only settings inside kimi.plugin.json. Don't add root-level commands/, agents/, or hooks/ directories for Kimi, because Claude Code auto-loads those too.

Using it with Grok Build

Grok Build reads this repo as-is (.claude-plugin/plugin.json, .mcp.json and skills/), so it needs no Grok-specific manifest.

  • Status: submitted to xAI's official marketplace in xai-org/plugin-marketplace#1506 as a remote source pinned to commit 5cbf977 (v3.1.2). It's waiting for xAI to approve the CI run and do a code-owner review. The source stays on this personal-account repo rather than the NPMscan org, so the Claude and ChatGPT listings don't have to move.
  • After merge: install with /marketplace or grok plugin install npmscan inside Grok Build.
  • Updating: Grok Build installs the pinned commit only. To ship a new release, open a PR to xai-org/plugin-marketplace that bumps the sha of the npmscan entry in .grok-plugin/marketplace.json, then run python3 scripts/generate-plugin-index.py, scripts/validate-catalog.py and scripts/generate-plugin-index.py --check there. The index script fetches every plugin in the catalog and takes several minutes.

Using it with Gemini CLI

This repo is also a Gemini CLI extension: gemini-extension.json declares the same MCP server (httpUrl, streamable HTTP), and Gemini CLI loads the same five skills from skills/.

bash
gemini extensions install https://github.com/salemalem/npmscan-mcp-plugin

The install follows main, so each push offers installed users an update. The extension gallery finds the repo by its gemini-cli-extension GitHub topic and re-crawls it daily; there's nothing to submit. Check a change with gemini extensions validate . before pushing.

Antigravity CLI users (which replaced Gemini CLI for free and Google AI Pro/Ultra accounts) can bring the extension over with agy plugin import gemini after installing it in Gemini CLI.

Using it with Cline

Cline connects to the hosted server directly; there's nothing to build and no API key:

bash
cline mcp install npmscan --transport http https://npmscan.com/api/mcp --yes

or in cline_mcp_settings.json:

json
{  "mcpServers": {    "npmscan": {      "type": "streamableHttp",      "url": "https://npmscan.com/api/mcp"    }  }}

llms-install.md has the same steps for Cline's one-click installer. Cline's marketplace logo is assets/logo-400.png.

Using it with Factory (Droid)

Droid installs Claude Code plugins as they are: it translates .claude-plugin/ and .mcp.json into its own layout when it caches the plugin. Add this repo as a marketplace, then install the plugin:

bash
droid plugin marketplace add salemalem/npmscan-mcp-plugindroid plugin install npmscan@npmscan-mcp-plugin --scope user

The marketplace takes its name from the repo (npmscan-mcp-plugin), not from the name in .claude-plugin/marketplace.json, so the plugin ID is npmscan@npmscan-mcp-plugin. Check it with droid mcp list: npmscan should show as http connected, and the five skills come with it.

Using it with Codex

This repo is also a Codex plugin: .codex-plugin/plugin.json points at the same skills/ and the same .mcp.json, and .agents/plugins/marketplace.json lets you add the repo as a marketplace:

bash
codex plugin marketplace add salemalem/npmscan-mcp-plugincodex plugin add npmscan@npmscan

Check it with codex mcp list: npmscan should show as enabled at https://npmscan.com/api/mcp. The other clients ignore .codex-plugin/ and .agents/.

Before changing the Codex manifest, run the HOL plugin-scanner that awesome-codex-plugins uses (it needs 80 or more with no critical or high findings):

bash
pipx install --force "plugin-scanner==3.57.0"plugin-scanner scan . --format text

.plugin-scanner.toml turns off one Kimi rule that misreads kimi.plugin.json (hol-guard#6032). Remove it once that's fixed.

Using it with TRAE

TRAE connects to the hosted server directly. Open this link to add it in one click (TRAE asks you to confirm):

trae://trae.ai-ide/mcp-import?type=http&name=npmscan&config=eyJ1cmwiOiJodHRwczovL25wbXNjYW4uY29tL2FwaS9tY3AifQ%3D%3D

Or go to Settings > MCP > Add > Create Manually and paste:

json
{  "mcpServers": {    "npmscan": {      "url": "https://npmscan.com/api/mcp"    }  }}

For one project only, put the same JSON in .trae/mcp.json. To add the skills, copy the folders in skills/ to ~/.trae/skills/ (or .trae/skills/ in a project), or zip one skill folder and use Upload Skill in TRAE's marketplace.

Also available for other AI clients

The same npmscan MCP server and the same dependency-audit / package-trust-check / new-dependency-evaluation / incident-response / ci-pr-gate skills are also available in ChatGPT via the official npmscan app listing (submission artifacts live in the main npmscan app repo, under mcp/).

Where to edit the skills: the main npmscan repo's mcp/skills/ is the only source. This repo's skills/ folder is generated from it by npm run sync:plugin-skills (run in the main repo), which rewrites the few platform-specific sentences for Claude; npm run sync:plugin-skills -- --check fails when the two have drifted. An edit made directly in this repo's skills/ is overwritten by the next sync.

License

MIT — see LICENSE.

Made by BlockHacks.io — protecting the open source ecosystem.

來源:README.md,提交 abb5d68

工具

23

search_packages

Search npm packages

Search the npm registry by name or keywords. Each result includes its current weekly/monthly download counts, dependentsCount (how many other npm packages depend on it), topPackagesRank (position among npmscan's own top-100k-by-downloads snapshot — not live, but a second independent popularity signal), and deterministic (not model-generated) popularityTier/maintenanceTier labels — a package matching the query with a 'very-low' popularityTier, zero dependents, or a 'stale' maintenanceTier is very likely an abandoned, copy-paste, or squatted package, not a real contender, regardless of how relevant its name/description look. A result may also carry possibleTyposquatOf — set when its name is one typo away (e.g. 'raect' vs 'react') from a top-5,000 package while itself having very low popularity; treat that as a red flag to call out explicitly, not silently filter. Use these (not name recognition or the package's own README) to judge which candidates are actually established, and call get_package on your shortlist for install-script risk, TypeScript support, and GitHub stars before recommending one. Includes a link to each package's full npmscan.com risk/analysis page.

輸入參數limitquery必填

get_package

Get npm package details

Fetch npm registry metadata for a package: latest version, install scripts (preinstall/postinstall are a key risk signal), maintainers, license, recent version history, weekly downloads, GitHub stars, TypeScript support, days since last publish, a topPackagesRank (position among npm's ~100k most-downloaded packages, from npmscan's own periodically-refreshed snapshot — not live), and a downloadTrend (growing/stable/declining vs. ~3 months ago). Also checks the LATEST version against OSV.dev for known vulnerabilities — isLatestVersionVulnerable/highestSeverity give a direct safe/not-safe answer, and each finding includes severity, a summary, and the fixedVersion to upgrade to (use get_package_version or query_vulnerabilities to check a specific older version instead). If the OSV.dev query itself fails (network/timeout/upstream outage), isLatestVersionVulnerable comes back `false` only because the field has to be a boolean — vulnerabilityCheckFailed:true is the real signal there, and means the safe/not-safe answer is unknown, not confirmed clean. Also returns popularityTier/maintenanceTier (deterministic rule-based labels, not model-generated) and a plain-language maintenanceSummary, plus a possibleTyposquatOf flag if the name is one typo away from a top-5,000 package while itself being obscure — read `deprecated` and maintenanceSummary before recommending a package, since a long gap since the last release can mean either a stable/finished package or a slowing one. Includes a link to the full npmscan.com analysis page.

輸入參數name必填

get_package_version

Get a specific npm package version

Fetch registry metadata for one exact version of a package (dependencies, install scripts, tarball) AND check that exact version against OSV.dev for known vulnerabilities — isVulnerable/highestSeverity give a direct answer, and each finding includes severity, a summary, and the fixedVersion to upgrade to. Use this to check a version pinned in a lockfile rather than the latest release. If the OSV.dev query itself fails (network/timeout/upstream outage), isVulnerable comes back `false` only because the field has to be a boolean — vulnerabilityCheckFailed:true is the real signal there, and means the answer is unknown, not confirmed clean.

輸入參數name必填version必填

get_maintainer_profile

Get basic profile info for an npm maintainer

Given an npm username, returns every package npm's own maintainer:<username> search index currently returns for that account (registry.npmjs.org's /-/v1/search — the public registry API has no dedicated 'list packages by maintainer' endpoint otherwise), plus precomputed aggregates: currentlyMaintainsCount (still listed as maintainer right now vs. already-revoked), totalWeeklyDownloads and totalDependents summed across every returned package, and avatarUrl — a proxied Gravatar image (null if no email is on record). This is a plain info lookup — it does NOT run the publish-cluster / compromised-account detection that check_maintainer_blast_radius does; use that tool instead when the goal is a security read on whether this account's recent activity looks like a takeover, not just a profile summary. Natural pairing with check_maintainer_changes: once that tool names a maintainer on a package, call this with that maintainer's username to see the rest of what they touch. npmscanUrl is this account's profile page on npmscan itself; npmProfileUrl is the account's actual page on npmjs.com, included for verification since that's the authoritative record of the account.

輸入參數limitmaintainerUsername必填

query_vulnerabilities

Query known vulnerabilities for a package

Query OSV.dev for known vulnerabilities affecting an npm package, optionally scoped to one exact version (e.g. to check whether a version pinned in a lockfile is safe). Returns isVulnerable and highestSeverity as a direct answer, plus each finding's severity, a plain-language summary, CVE aliases, and the fixedVersion to upgrade to — not a raw advisory dump. Also cross-checks the name/version against the npm registry: isVulnerable:false on a package that does not actually exist there (typo, wrong ecosystem) would otherwise look identical to a genuinely clean result — see packageExists/existenceCheckNote. A name or version not found on the registry does NOT discard already-fetched OSV data or short-circuit into an error: OSV/GHSA advisory data is independent of the package's current registry listing, and a package/version pulled from npm for being malicious (unpublished/yanked) is exactly the case where real vulnerability data must still be reported, not hidden behind a 404. Use before recommending, installing, or upgrading a package.

輸入參數nameversionecosystempackageName

batch_query_vulnerabilities

Batch query known vulnerabilities

Check a whole npm dependency inventory against OSV.dev in one call: pass `packages: [{name, version?}]`, or raw package.json / package-lock / yarn.lock / pnpm-lock / CycloneDX / SPDX content via `content`. Large inventories are chunked automatically. Each finding has severity, summary, CVE aliases, fixedVersion and isMalware, so no per-package follow-up is needed. Before calling anything clean, read: - `unresolvedPackages`/`nonexistentVersions` (and each result's `registryStatus`): a name or version not on npm shows vulnerabilityCount 0 just like a clean package. A version npm removed can still have real OSV findings (often malware). - A `packages` entry with no version is checked against every historical version; confirm against the version actually in use before calling it vulnerable. - `signals` (deprecated, hasInstallScripts, popularity/maintenance tiers, possibleTyposquatOf): 0 vulnerabilities can still be deprecated, abandoned or a typosquat. `signals` is null for git/file/workspace/URL entries, which are not scanned. - `source` (lockfile input): `nonRegistryHost` means the tarball comes from an unexpected host; `identityMismatch` means it is a different package/version than declared (`resolvedName`/`resolvedVersion`) and the counts describe the declared one. Treat both as lockfile tampering. - Use `uniqueVulnerabilityCount` for distinct issues; raw counts can list one CVE twice. - package.json input: `projectLifecycleScripts`/`projectLifecycleScriptRisk` are the project's own install scripts; peerDependencies are skipped unless `includePeerDependencies: true` (see `ignoredPeerDependencyNames`); `declaredSpec` marks a version resolved from a range, which can change on the next install. - npm aliases are followed: `package.actualName` is the real package the data describes.

輸入參數contentpackagesincludeDevDependenciesincludePeerDependencies

get_latest_advisories

Get latest npm security advisories

Browse recently published npm security advisories and known-malicious-package findings. Three disjoint sources, selected via type: "reviewed" (default) is GitHub's curated, mostly CVE-backed advisories; "malware" is GitHub's own known-malicious-package advisories; "osv" is OSV.dev's OpenSSF malicious-packages feed, a separate dataset whose entries use MAL-/OSV ids rather than GHSA ids. None of "malware"/"osv" carry a CVE or meaningful CWE beyond "embedded malicious code". Filter by severity, vulnerability category (XSS, SQL/NoSQL Injection, SSRF, Access Control, Code Injection, etc. — reviewed only), an affected package name, or (reviewed/malware only) look up one exact advisory by GHSA or CVE ID. Advisories GitHub has withdrawn (most often "Duplicate Advisory: ..." records merged into a canonical GHSA) are excluded from browse results, so a page can hold fewer than 30 entries; an exact ghsaId/cveId lookup still returns a withdrawn advisory, with withdrawnAt set — treat it as retracted, not as a live finding. Paginated with an opaque cursor: pass a previous response's nextCursor back in as cursor to fetch the next page.

輸入參數typecveIdcursorghsaIdaffectscategoryseveritydirection

get_cve

Look up a CVE in the NIST NVD

Look up authoritative NIST NVD data for one exact CVE ID (e.g. "CVE-2026-2950"), or browse/search NVD by keyword, CVSS severity, CWE, or a publication-date range. Every result is enriched with CISA KEV status (`kev`, non-null only if this CVE is a confirmed, actively-exploited-in-the-wild vulnerability — treat that as an urgent-patch signal regardless of CVSS score) and FIRST.org EPSS (`epss`, the probability of exploitation in the next 30 days — a better prioritization signal than CVSS severity alone, which measures impact, not likelihood). If the KEV or EPSS lookup itself fails (network/timeout/upstream outage), `kev`/`epss` come back `null` only because those fields have to be nullable — `kevCheckFailed`/`epssCheckFailed` (true in that case) is the real signal, and means "unknown", not "confirmed absent/unscored". For a search, a failed EPSS batch call sets `epssCheckFailed` on every result in that response, since one call scores every id together; `kevCheckFailed` is tracked per-CVE since each is looked up independently. For a single cveId lookup, if NVD has no record yet or hasn't scored it, this falls back to the raw MITRE CVE record automatically (`source: "mitre"` on the result) rather than returning nothing. NVD is NOT npm-scoped — unlike query_vulnerabilities/get_latest_advisories, search results can include CVEs for any ecosystem, so pass keywordSearch (e.g. the package name) to narrow it. Prefer this for the authoritative CVSS score/vector/KEV/EPSS data on a CVE already found via another tool, or when a user pastes a CVE ID/link directly; prefer get_latest_advisories for npm-specific browsing. NVD enforces a strict shared rate limit, so this tool may occasionally ask you to retry in a few seconds — do so rather than assuming failure.

輸入參數cveIdcweIdseveritystartIndexkeywordSearchpublishedSincepublishedUntilresultsPerPage

analyze_install_script

Analyze an npm package install script

Statically scans a package's preinstall/install/postinstall/prepare lifecycle scripts AND the file(s) they reference — fetched directly from the published tarball, not just the command string in package.json — against npmscan's documented red-flags rubric (/docs/red-flags): child_process use, network calls, access to sensitive paths/env (.ssh, .aws, .npmrc, *TOKEN/*KEY), obfuscation, remote binaries hosted off trusted CDNs, writes to HOME, Discord/Telegram/Pastebin exfil endpoints, eval on decoded strings, chmod+exec of downloaded binaries, and CI-metadata telemetry — plus a possibleTyposquatOf name check. Returns a weighted totalScore and riskTier ('none'/'low'/'moderate'/'high'/'critical'). This is a heuristic static scan, not proof of malice or a guarantee of safety: it doesn't execute any code, can't see behavior gated on runtime conditions, and does NOT check maintainer/ownership history (a separate red-flags signal this tool doesn't cover). Use get_package/get_package_version first for the raw script listing; use this when you need to know what an install script actually does, not just that one exists.

輸入參數name必填version

analyze_transitive_dependencies

Analyze transitive dependencies for vulnerabilities

Walk one or more root packages' dependency trees (e.g. a package.json "dependencies" section) up to `maxDepth` levels (default 2, max 3) and check every resolved package@version against OSV.dev, so vulnerabilities several levels down still surface. Read `summary` first; `vulnerablePaths` answers "which of my dependencies pulled this in"; `nodes` has the full graph. npm aliases are followed (`actualName`). Before calling a result clean: - A node with `resolutionError` (unsatisfiable range, 404, or a git/file/workspace/URL specifier) has `isVulnerable: null` — it was never scanned, not clean. - Only "dependencies" are followed (not dev/peer/optional). Each range is resolved independently to its max-satisfying version, so this shows which vulnerable versions are reachable, not npm's exact hoisted install. - The walk has a node budget: check `truncated`/`truncationNote`. Use batch_query_vulnerabilities instead when you already have a flat list of exact versions (faster, no graph walk).

輸入參數maxDepthpackages必填

check_package_provenance

Check an npm package version for publish-provenance red flags

Checks whether a package version was published with npm's own Sigstore-backed publish provenance (`npm publish --provenance`), and cross-checks that provenance against reality rather than just reporting its presence. Three checks: (1) parses the SLSA build attestation (declared source repo, commit, builder identity, GitHub Actions run URL) and flags a builder that isn't GitHub-hosted, or an attested source repo that doesn't match package.json's own `repository` field; (2) when this version LACKS provenance, checks whether most peer packages (same npm scope, or same maintainer for an unscoped name) DO have it — a package that's the odd one out in an org that otherwise always publishes from CI is a real anomaly, not proof of malice; (3) fetches package.json from the source repository at the exact attested commit (or a best-effort matching git tag when no provenance/commit is available) and diffs its install-lifecycle scripts (preinstall/install/postinstall/prepare) and dependency names against what's actually in the published tarball — this is the single highest-signal check here, since a script or dependency that exists on npm but was never committed is exactly the pattern of a stolen-npm-token publish that bypasses CI (the event-stream/ua-parser-js incident shape). This is a heuristic, structural check: it does NOT cryptographically re-verify the Sigstore bundle (Fulcio cert chain, Rekor inclusion proof) — it trusts that npm's registry already refused to accept a publish that failed that verification, and checks the CONTENT of what the registry reports instead. Most packages don't use --provenance yet, so its bare absence is never scored on its own — only an org-norm anomaly or an actual source mismatch is. Use get_package/get_package_version first for basic package info; use this specifically to assess publish-integrity risk.

輸入參數name必填version

check_maintainer_changes

Check an npm package for maintainer/ownership red flags

Reconstruct who has controlled an npm package and when, straight from the packument (each version records the maintainer list at publish time and who ran `npm publish`). Use it for the 'who controls this package, and did that change recently' question; use get_package/check_package_provenance for general health and publish integrity. Flags: 1. a maintainer added recently who then published soon after, on a package with real prior history — the takeover shape behind ua-parser-js, event-stream and the 2025 chalk/debug ('qix') compromise 2. the whole maintainer list replaced at once 3. a long-standing maintainer quietly dropped 4. a maintainer change on npm AFTER the latest release — more urgent: access changed hands but nothing has shipped yet It also checks the declared GitHub repository: transferred or renamed (`repository.ownerLogin`/`ownerAvatarUrl` show the CURRENT owner), unreachable, or a latest release that landed long after any real push activity. If it flags a newly added or fully replaced maintainer, follow up with check_maintainer_blast_radius on that username to see whether the same account touched other packages at the same time. Findings are signals to verify, not proof of compromise.

輸入參數name必填

check_maintainer_blast_radius

Check npm maintainer blast radius

Given an npm username, lists the packages npm's maintainer:<username> search index returns for that account and looks for a tight cluster of packages whose latest version was published within a short rolling window of each other — the shape of a compromised-account supply-chain attack, where a stolen credential is used on every package the account can publish to within hours (e.g. the September 2025 chalk/debug compromise, ~18 packages in ~2 hours). A large total package count is not itself a red flag; only a tight publish-time cluster is scored, weighted by its package count and combined weekly downloads/dependentsCount. Clusters mostly within one npm scope (a monorepo release) are dampened, and multiple clusters combine with diminishing returns. isCurrentMaintainer shows whether the account still maintains each package. avatarUrl is a proxied Gravatar image (null if no email is on record). Natural follow-up to check_maintainer_changes: call this with a newly added maintainer's username to see whether the same account touched other packages around the same time. Limitations: npm's search index can lag or omit packages; results are capped at 250 packages ranked by relevance, not recency (see resultsTruncated/totalPackagesFound); lastPublished reflects only each package's latest version. npmscanUrl is the account's npmscan profile; npmProfileUrl is its npmjs.com page.

輸入參數limitmaintainerUsername必填

check_license_compliance

Check a dependency list against a license policy

Given a list of packages (name + optional exact version or semver range — e.g. straight from a package.json "dependencies" object) and an optional allow/deny license policy, resolves each package's declared SPDX license and reports a compliance verdict per package. Classifies every license into one of permissive/weak-copyleft/copyleft/network-copyleft/proprietary/public-domain/unknown, and understands simple SPDX expressions: "(MIT OR GPL-3.0)" is compliant if EITHER side is permitted (a consumer may legally pick the clean alternative), "MIT AND Apache-2.0" requires both sides to pass, and "X WITH exception" is judged on X. A mixed/nested expression like "(MIT OR ISC) AND Apache-2.0" is reported as needsReview rather than guessed at. `policy.deny` entries always win over `policy.allow` (so a name can appear in both without a silent contradiction); with `policy.allow` set, anything not matching it is a violation (unproven is treated as non-compliant); with neither given, the default policy flags only copyleft/network-copyleft/proprietary (e.g. GPL/AGPL/UNLICENSED) — weak-copyleft (LGPL/MPL/EPL) and unrecognized license strings are surfaced but not auto-flagged. Policy entries accept an exact SPDX id, a family prefix ("GPL" catches GPL-2.0/GPL-3.0-only/etc.), or a category name. This reads only the registry-declared `license` field — it does not fetch or parse LICENSE file contents from the source repository.

輸入參數policypackages必填

diff_dependencies

Diff two package.json/lockfile snapshots

Compare two snapshots of a package.json, package-lock.json (v1-v3), yarn.lock (classic or Berry) or pnpm-lock.yaml (e.g. before/after a PR; formats can differ) and report added, removed and changed packages. Lockfiles cover the full resolved graph, so transitive-only changes are caught; npm aliases are followed (`actualName`). Up to 100 added/changed packages are checked in detail. Ideal for a CI gate. Per added/changed package: - `installScriptIntroduced`: a preinstall/install/postinstall script the old version lacked — the shape of a compromised-maintainer release. `prepare` never runs on a registry install, so it is excluded; `installScriptKeysIntroduced` lists every new key, prepare included. - `sourceIntegrityChanged`: the same version now resolves to a different tarball URL or hash, or a bump moved to another host (ordinary bumps are not flagged). A same-version swap is `changeType: "source-swap"`. - `identityMismatch`: the tarball is a different package or version than declared; `tarballName`/`tarballVersion` say what really installs, and the vulnerability fields describe that. - `vulnerabilityDelta` (introduced/fixed/still-vulnerable/still-clean) plus the findings, each with isMalware. Project-level: `projectLifecycleChanges` diffs the project's own root install scripts (package.json only; a PR that only adds a root postinstall changes no dependency), and `overridesChanges` diffs overrides/resolutions/pnpm.overrides, from package.json or between two pnpm-lock.yaml files (removing one can let a vulnerable version back in). Both count toward `flaggedCount`. Read `comparisonNote` when the two snapshots differ in format. Install-script checks are presence-only; use analyze_install_script to see what a script does.

輸入參數after必填before必填

prioritize_remediation

Rank a batch of flagged vulnerabilities by what to fix first

Rank vulnerability findings other tools already returned (batch_query_vulnerabilities, query_vulnerabilities, analyze_transitive_dependencies, diff_dependencies...) by what to fix first. Pass up to 200 `{packageName, cveId?, severity?, advisoryId?, currentVersion?, fixedVersion?, findingType?}`. Each gets a tier: remove-now / patch-now / patch-soon / scheduled / monitor. How the tier is decided: - remove-now: confirmed malware — `findingType: "malware"`, a MAL-* advisoryId, or an advisoryId whose OSV record is a malware advisory (CWE-506 or a MAL-* alias, looked up automatically). Malware is removed, not patched. Advisories that could not be looked up are listed in `malwareCheckFailedAdvisoryIds`. - patch-now: on the CISA KEV list (actively exploited), whatever the severity. - otherwise a score led by FIRST.org EPSS (30-day exploitation probability), with severity as a secondary signal — or the only signal when there is no EPSS data (no CVE id). An EPSS of 10% or more always ranks at least patch-soon. The tier is a fix-ORDER across a backlog, not a severity verdict or a merge gate: a CRITICAL CVE with low EPSS can rank monitor. Never describe a monitor/scheduled finding as "low severity", and judge whether a change that INTRODUCES a vulnerability is acceptable by its severity, not this tier.

輸入參數findings必填

simulate_dependency_upgrade

Simulate an npm dependency upgrade

Before running npm install, check whether upgrading a package from a current to a target version is safe. Pass `packageName` + `currentVersion` + `targetVersion` (omit target for "latest"), or `packages: [...]` (1-100) to check many in one call; a name that cannot be resolved comes back with `fetchError` instead of failing the batch. A natural follow-up to prioritize_remediation: pass its packageName/currentVersion/fixedVersion straight in. What it checks: - semver jump (major/minor/patch/prerelease; a 0.x minor bump counts as breaking; skipped majors are flagged) - registry signals on the target: deprecated, a newly added preinstall/install/postinstall script (`installScriptIntroduced`; a new `prepare` is listed in `installScriptKeysIntroduced` but never runs on a registry install), a tightened engines.node, prerelease - OSV for both versions: `vulnerabilityDelta` (introduced/fixed/still-vulnerable/still-clean) and `targetVulnerabilities` with isMalware — catching a "fix" that does not clear every CVE Result: one `riskTier` — safe / low-risk / review-recommended / breaking-change-likely / unknown / do-not-upgrade — with `reasons`. `do-not-upgrade` means the target is known malware, or npm no longer lists it while OSV still has advisories for it (how npm removes malicious releases). It does not read changelogs or diff source; it is a fast pre-check, not a substitute for release notes on a major bump.

輸入參數namepackagespackageNametargetVersioncurrentVersion

suggest_alternative

Suggest better-maintained npm alternatives

Given a package that looks deprecated, vulnerable, abandoned, or suspicious, suggest better-maintained alternatives in the same category. This tool first checks the source package's own latest-version health (deprecation, latest-version OSV verdict, popularity/maintenance tiers, typosquat flag), then combines maintainer-provided deprecation hints with deterministic npm search-based category matching. It ranks candidates using category overlap plus search_packages-style popularity/maintenance signals, filters out typosquats and weak/stale contenders, and returns a short list with plain-language whySuggested notes. A candidate is also never suggested if it's deprecated, has a confirmed HIGH/CRITICAL OSV vulnerability, or its own OSV check itself failed (network/timeout/upstream outage) — an unverifiable candidate is excluded the same as a confirmed-bad one, not defaulted to 'looks fine', since this tool's entire purpose is not recommending something dangerous. Best for turning a 'don't use this package' warning into an actionable replacement shortlist. If the OSV.dev vulnerability check fails for the SOURCE package (as opposed to a candidate, which gets excluded per above), source.isLatestVersionVulnerable comes back `false` only because the field has to be a boolean — source.vulnerabilityCheckFailed:true is the real signal there, and means that safe/not-safe answer is unknown, not confirmed clean.

輸入參數name必填limitreason

compare_packages

Compare npm packages side-by-side

Compare 2-5 candidate packages for the same job (e.g. "axios vs got vs node-fetch") side by side and get a deterministic pick. More than 5 names is rejected, never truncated; duplicate names are rejected. Use search_packages first if you have no shortlist. Per candidate: downloads and trend, popularity/maintenance tiers, GitHub stars, TypeScript support, license, deprecation, latest-version vulnerabilities, a tarball-free installScriptRisk (scores preinstall/install/postinstall; a prepare-only package scores 0 since prepare never runs on install — use analyze_install_script for the deep scan), and installSize (own size plus a transitive rollup up to depth 2 / 60 nodes; `truncated`/`sizeUnknownCount` mark a partial sum). `differentiators` names who stands out on each dimension. `recommendation.pick` comes from a weighted score (popularity, maintenance, deprecation, vulnerabilities, typosquat flag, install-script risk, TypeScript, stars; size is reported, not scored) — never a deprecated or typosquat-flagged candidate — with a `rationale` and a `confidence` from how close the top two scored. Before trusting the result: `vulnerabilityCheckFailed: true` means the safe/not-safe answer is unknown, not clean; a name that cannot be resolved stays in `candidates` with `found: false` and `resolutionError`.

輸入參數packages必填

audit_github_repository

Audit a GitHub repository's npm dependencies

Audit a GitHub repository's npm dependencies from its URL — no pasted files needed. Fetches package.json plus the first lockfile found (pnpm-lock.yaml, then package-lock.json, then yarn.lock) from the default branch (or `ref`), and detects monorepos (package.json workspaces, pnpm-workspace.yaml), merging member dependencies (up to 50 members). What it checks: - Every lockfile entry (up to 3,000; the repo's own workspace/link entries skipped) against OSV.dev, so `vulnerablePackageCount` covers the whole dependency set. - Up to 100 packages, vulnerable ones first, also get a license verdict (same default policy as check_license_compliance, or pass `policy`) and an install-script signal; up to 10 with lifecycle scripts get the deep tarball scan (`installScriptScanScope`). - Up to 5 high-risk packages (critical/high vulnerability, possible typosquat, deprecated) get the maintainer-change and provenance checks; others are named in `ownershipCheckNote`. Read `coverage` and the summary before calling a repo clean: a summary starting `PARTIAL AUDIT` (`coverage.complete: false`) means not every package got every check. `findings` has full detail only for packages with something to report; the other detailed packages are listed compactly in `cleanFindings`. Vulnerable packages past the 100-package detail cap are in `overflowVulnerablePackages`. peerDependencies are skipped unless `includePeerDependencies: true`. This is the most expensive tool here — do not call it in a loop across many repos.

輸入參數refurl必填policyincludeDevDependenciesincludePeerDependencies

get_remediation_playbook

Get the concrete remediation playbook for a flagged finding

Maps a finding's `rule` value from analyze_install_script, check_maintainer_changes, or check_package_provenance to the matching human-authored incident-response playbook (the same content published at /docs/playbooks) and returns its concrete, ordered steps, severity tier, real-incident references, and prevention tips — not just a link. Pass the exact `rule` string(s) a prior finding already returned (batch up to 10 in one call to cover a whole findings array; duplicates resolving to the same playbook are deduplicated) or an `id` to look up a specific playbook by slug directly. Each matched rule also gets its own short situationNote explaining specifically what that rule caught — so a batch of several different rules landing on the same playbook does not read as identical, repeated boilerplate. An unrecognized rule or id is not an error — it comes back with matched:false and a note, since a low-severity or baseline-only finding (e.g. analyze_install_script's lifecycle-present) legitimately has no dedicated playbook.

輸入參數idrules

generate_sbom

Generate a CycloneDX or SPDX SBOM

Given the same inputs batch_query_vulnerabilities accepts — either a flat {packages:[...]} list, or raw package.json / lockfile / CycloneDX JSON / SPDX JSON content via `content` — emits a spec-valid CycloneDX 1.6 or SPDX 2.3 JSON document (pick with `format`, default 'cyclonedx') with npmscan's own OSV.dev vulnerability findings and registry license data embedded in each spec's native fields: CycloneDX gets a top-level `vulnerabilities[]` array (VEX `analysis.state: 'in_triage'` — an unreviewed automated finding, not a claim of exploitability) and per-component `licenses[]`; SPDX (which has no vulnerabilities array in 2.3) gets one `externalRefs` SECURITY/advisory entry per finding and `licenseDeclared`/`licenseConcluded`. Only a flat package inventory is known here, so the CycloneDX `dependencies[]` transitive graph and any SPDX package hierarchy are intentionally omitted rather than fabricated. Set `includeVulnerabilities`/`includeLicenses` to false to skip either enrichment pass (faster, no registry/OSV calls for that pass); pass `policy` (same shape as check_license_compliance) to also get per-package compliance context; `componentName`/`componentVersion` name the SBOM's own root component/document if known. When `content` is a package.json, `peerDependencies` are excluded by default (a peer is often intentionally left unresolved by the consumer) — pass `includePeerDependencies: true` to include them as SBOM components too, since an SBOM meant to be complete shouldn't silently omit a whole dependency category.

輸入參數formatpolicycontentpackagescomponentNameincludeLicensescomponentVersionincludeDevDependenciesincludeVulnerabilitiesincludePeerDependencies

enrich_npm_audit

Rank raw `npm audit --json` output by what to fix first

Given the raw output of `npm audit --json` (npm 7+'s `{vulnerabilities: {...}}` format, or legacy npm 6's `{advisories: {...}}`), parses it directly — no need to re-paste package.json/lockfile content — and runs it through the same remove-now/patch-now/patch-soon/scheduled/monitor ranking prioritize_remediation exposes for hand-built finding lists (an advisory that is malware — a MAL-* id, or a GHSA whose OSV record carries CWE-506 / a MAL-* alias — is auto-detected and forces remove-now). npm audit's JSON almost never includes a CVE id (only a GHSA advisory URL), so this resolves each GHSA to its CVE alias via OSV.dev when one exists (ghsaResolvedToCveCount reports how many) before doing the same CISA KEV + FIRST.org EPSS + severity scoring — skipping this step would silently degrade most findings to severity-only ranking despite prioritize_remediation being built around CVE-keyed KEV/EPSS data. Also carries through npm-audit-specific context prioritize_remediation itself has no field for: isDirect (direct vs. transitive dependency) and fixAvailable/fixTarget (npm's own computed fix — note fixTarget can name a different package than the vulnerable one, e.g. bumping a parent to pull in a patched transitive dependency). A package with more than one distinct advisory in the source report only has its first advisory used for ranking; a warning names the package so query_vulnerabilities can be called on it directly for the rest. `yarn audit --json` and `pnpm audit --json` use different report shapes and are not supported — use batch_query_vulnerabilities with the project's manifest/lockfile for those instead.

輸入參數content必填

版本歷史

3
  1. v3.1.2最新Oct 10, 2026
  2. v3.1.0Oct 9, 2026
  3. v1.0.0Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Scan 整合