Installaudit

io.github.CloudCorpRecords由 GitHub 帳號 CloudCorpRecords 發布v0.1.0更新於 Nov 7, 2026

Install-script inventory for a dependency tree: what runs when you install.

已驗證STDIO僅桌面開發者工具安全與監控

概覽

AI 產生的概覽

唯讀的 MCP 伺服器,盤點 Node.js 儲存庫中安裝時執行的程式碼,並給出 CLEAN 或 REVIEW 結論。

可以做什麼
  • 稽核儲存庫的安裝腳本:讀取 package.json 與 package-lock.json,回傳含結論、計數與發現項的 JSON 報告。
  • 列出 lockfile 項目帶有 hasInstallScript 的相依套件,區分直接與間接相依,並附上名稱、版本與 dev 標記。
  • 將根目錄的 preinstall、install、postinstall、prepare 腳本分類為網路、外部指令、建置或其他。
  • 回報相依套件總數、帶腳本的相依套件數、發現項總數等計數,排序固定且不含時間戳記。
適用情境
適合在對陌生或第三方儲存庫執行 npm install 之前使用,或在檢視相依樹時了解安裝階段會執行哪些東西。它回答的是比漏洞掃描更前置的問題:安裝這棵相依樹時有哪些程式碼會執行。
執行需求
透過 npx 或 Docker 以 stdio 在本機執行;未宣告驗證、環境變數或標頭。目標儲存庫必須同時包含 package.json 與 v2 或 v3 格式的 package-lock.json,否則會回傳錯誤。
安裝前請注意
它只讀取檔案,不會安裝、執行腳本或下載套件,因此不會執行它所回報的程式碼。它不顯示相依套件腳本的實際內容,也不判斷意圖,根腳本分類是依字面指令文字做樣式比對。v1 lockfile 以及 test、start 等非安裝腳本不在範圍內,CLEAN 結論並不代表安全保證。

安裝

在 SourceWeft 中

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

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

installaudit

Installing is running code. installaudit tells you whose code, before you install.

npm install does not just download files. Any package whose lockfile entry carries hasInstallScript: true runs code at install time, and so do the root package's own preinstall, install, postinstall, and prepare scripts. Most audits ask whether a dependency is vulnerable. installaudit asks a prior question: what executes the moment you install this tree?

It reads package.json and package-lock.json, inventories every install script in the tree, separates direct dependencies from transitive ones, classifies the root scripts by what they do, and returns a verdict. It never installs anything, never runs a script, and never fetches a package.

Install

bash
npx @reneturcios/installaudit audit

Or install it globally, or add it as an MCP server (below).

CLI

bash
# Audit the current directorynpx @reneturcios/installaudit audit
# Audit another pathnpx @reneturcios/installaudit audit ~/src/my-repo
# Machine readable outputnpx @reneturcios/installaudit audit ~/src/my-repo --json
# Run as an MCP server on stdionpx @reneturcios/installaudit mcp
# Print the versionnpx @reneturcios/installaudit --version

Exit codes:

  • 0 when the verdict is CLEAN.
  • 1 when the verdict is REVIEW.
  • 2 for usage errors, including a missing package.json or a missing package-lock.json.
  • 141 when the reader closed the output pipe early.

MCP

Add to your MCP client config:

json
{  "mcpServers": {    "installaudit": {      "command": "npx",      "args": ["-y", "@reneturcios/installaudit", "mcp"]    }  }}

Tool: audit_install_scripts, taking a path argument. It returns the full report as JSON: verdict, counts, and findings.

How the inventory works

Dependencies come from the lockfile, not from package.json alone, because the lockfile is the resolved tree that will actually be installed.

  • Lockfile v2 and v3 format: the packages object maps install paths such as node_modules/<name> to entries.
  • An entry with hasInstallScript: true runs code at install time and becomes a finding.
  • The package name is taken from the segment after the last node_modules/ segment of the path. Scoped names take two segments: node_modules/@scope/name is @scope/name, and node_modules/a/node_modules/@scope/name is also @scope/name.
  • A package is direct when its path has exactly one node_modules segment and its name is listed in the root package.json under dependencies or devDependencies. Everything else is transitive, including a nested copy whose name happens to match a direct dependency.
  • The version and the dev flag are read from the lockfile entry and reported with the finding.

Root scripts come from package.json. Only preinstall, install, postinstall, and prepare are read, because those are the scripts npm runs around install. Each one present is a finding, classified from its command body.

Rules

ruleseveritywhat it means
DEP-INSTALL-SCRIPTmedium (direct), low (transitive)A dependency whose lockfile entry has hasInstallScript: true. Evidence is name@version.
ROOT-SCRIPT-NETWORKhighA root lifecycle script classified as NETWORK.
ROOT-SCRIPT-SHELL-OUTmediumA root lifecycle script classified as SHELL-OUT.
ROOT-SCRIPT-BUILDlowA root lifecycle script classified as BUILD.
ROOT-SCRIPT-OTHERinfoA root lifecycle script classified as OTHER.

Root script classification uses simple, documented patterns, checked in this priority order: NETWORK first, then SHELL-OUT, then BUILD, then OTHER.

classpatterns
NETWORKcurl or wget, or an http:// or https:// URL combined with a fetch or download tool word (fetch, download, curl, wget).
SHELL-OUTA shell interpreter word (sh, bash, zsh), node -e, or a script interpreter word (python, python3, perl, ruby).
BUILDtsc, npm run build (also pnpm, yarn, and bun), or a build tool name (webpack, vite, rollup, esbuild, parcel, gulp, grunt, babel).
OTHERAnything else.

Counts reported in every report:

  • totalDeps: every dependency entry found in the lockfile packages object, excluding the root entry.
  • depsWithScripts: entries with hasInstallScript: true.
  • directWithScripts: the direct subset of depsWithScripts.
  • transitiveWithScripts: the transitive subset of depsWithScripts.
  • rootScripts: root lifecycle scripts present among preinstall, install, postinstall, and prepare.
  • findings: total findings.

Findings are sorted deterministically by rule, then by name. Reports contain no timestamps, so the same tree always produces the same report.

Verdict

  • CLEAN: no root NETWORK or SHELL-OUT scripts, and no dependency install scripts. A root BUILD or OTHER script alone still verdicts CLEAN; it is reported as a low or info finding, not hidden.
  • REVIEW: anything else. At least one thing in this tree runs code at install time that is worth a human look.

Limits

  • Lockfile-based only. A missing package-lock.json is an error (exit 2), not an empty report, because without the lockfile there is no resolved tree to inventory. A missing package.json is likewise an error.
  • Script bodies of dependencies are not in the lockfile and are not fetched. For a dependency, installaudit reports presence, name, version, dev flag, and direct or transitive position. It does not report what the script does and does not judge intent. A package with an install script may be entirely legitimate; native builds are the common case.
  • Root script classification is pattern based. It reads the literal command text in package.json; it does not follow a script into the files it invokes, expand variables, or trace what a downloaded file would do.
  • Only lockfile v2 and v3 are supported, through the packages object. The legacy lockfile v1 dependencies object is not read, so a v1 lockfile is an error rather than a half inventory.
  • Only the four install-adjacent root scripts are read. Other scripts, such as test or start, are out of scope even when their commands look risky.
  • Direct means listed in dependencies or devDependencies of the root package.json. A dependency that is only reachable through the tree is transitive by definition here, regardless of who maintains it.

來源:README.md,提交 a636311

工具

1

audit_install_scripts

Inventory install-time code execution for a repo: every dependency whose lockfile entry carries hasInstallScript, grouped by ecosystem position (direct vs transitive), plus the root package.json lifecycle scripts classified into build, network, shell-out, and other. Verdict CLEAN when nothing runs at install, REVIEW when install scripts exist.

輸入參數path必填

版本歷史

1
  1. v0.1.0最新Oct 30, 2026

評分

已滿足適用檢查項的 90%

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

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分