
Package Guard Mcp
io.github.mlawsonking由 GitHub 帳號 mlawsonking 發布v1.3.0更新於 Oct 24, 2026
Supply-chain guard for AI coding agents: verify packages, check vulns/malware, detect typosquats.
概覽
讓 AI 程式助理在安裝前檢查 npm 與 PyPI 套件名稱,標示虛構名稱、仿冒套件與已知漏洞。
- 可以做什麼
- 提供工具在助理安裝前,將套件名稱與 npm 或 PyPI 登錄檔及 OSV 公告比對。verify_package 依名稱是否存在、已知漏洞與惡意軟體、套件年齡、每週下載量、與 npm 搜尋結果的名稱相似度、棄用狀態與授權條款,回傳 safe、caution 或 danger。check_vulns 查詢涵蓋七個生態系的 OSV,package_info 回傳登錄檔中介資料,audit_deps 檢查名稱清單或 package.json、requirements.txt,typosquat_scan 回報已註冊的 ASCII 形近名稱。
- 適用情境
- 當 AI 程式助理提議安裝套件,而你想在安裝前以確定性方式檢查虛構名稱、仿冒套件與已知公告時適用。最適合 npm 與 PyPI 工作流程,用快速的登錄檔與 OSV 查詢增加一道安全關卡。
- 執行需求
- 透過 stdio 在本機執行,通常使用 npx package-guard-mcp,因此需要 Node.js。需要連線至 npm 與 PyPI 登錄檔、OSV.dev 以及規則更新來源;端點可用 PACKAGE_GUARD_API 覆寫。未宣告任何帳號、API 金鑰或憑證。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Package Guard Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
package-guard-mcp
An MCP server that vets a package before your agent installs it. It checks that the name is registered, that OSV has no advisory against it, and how new and how downloaded it is. Deterministic, no LLM, free.
LLMs regularly suggest package names that don't exist, and attackers register those hallucinated names to slip malware into agent-run installs. People call it slopsquatting. The check for it is a registry lookup: if npm or PyPI has no package by that name, verify_package returns likely_hallucination: true. That means "not in this registry" and nothing more — it can't separate an invented name from a typo or a rename, and a package that only exists in your private registry will read as missing.
It never fetches or reads package contents. No install scripts, no code, no tarballs. A malicious package with no OSV advisory and healthy download numbers comes back safe.
Install
Tools
verify_package: the main guard. Returns safe, caution, or danger, based on whether the registry has the name (if not you getlikely_hallucination, plus a "did you mean" list on npm), known vulnerabilities and malware from OSV, age and weekly downloads, whether the name is within 2 edits of an npm search hit, deprecation, and license.check_vulns: known vulnerabilities and malware advisories for a name and version, from OSV.package_info: registry metadata, including latest version, deprecation, license, repository, weekly downloads, and age.audit_deps: check a list of names, or thedependenciesanddevDependenciesin a package.json, or a requirements.txt.typosquat_scan: generate ASCII lookalike names and report which are registered.
Scope and limits
check_vulns is a straight OSV.dev query and covers all seven ecosystems: npm, PyPI, Go, crates.io, RubyGems, Maven, NuGet. Everything else needs a package registry, and there are two clients: npm and PyPI. So verify_package, package_info, audit_deps and typosquat_scan take npm or pypi only. Suggestions and the confusable-name signal use npm's search API, so they are npm only.
audit_deps reads manifests, not lockfiles, and does not resolve the dependency tree. It checks the entries you send and nothing they depend on, up to 40 names. A version range is reduced to the digits inside it, so ^4.17.20 is checked as 4.17.20.
vulnerabilities.checked: false with count: null means the OSV request failed and the package was not checked; verify_package downgrades the verdict to caution instead of calling it safe. count: 0 means OSV answered and had nothing. audit_deps has no such guard yet: if its batch OSV call fails, every package reports 0 vulns.
Rule updates
About once a day this server asks the rules feed whether there is a newer ruleset, and applies it if
there is. The request carries two things: which surface asked, which here is facade, and the rules
version already installed. No machine id, no user id, no file names, nothing you scanned.
Bundles are signed with Ed25519 and verified against a public key compiled into this package, so it
does not matter which mirror served one. A bundle that fails its signature, its schema, or its ReDoS
check is discarded and the rules you already had stay in place. --offline turns updates off, as
does AGENT_GUARDS_NO_FEED=1 or {"feed": false} in ~/.agent-guards/config.json. The bundle
format and how to verify one yourself: https://github.com/mlawsonking/MCP/blob/main/rules/README.md
It calls https://package-guard.vercel.app (set PACKAGE_GUARD_API to override). One of six agent guards in this repo. MIT.
來源:package-guard-mcp/README.md,提交 91f3fa7
工具
0版本歷史
1- v1.3.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分