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.

已验证STDIO仅桌面开发者工具安全与监控

概览

AI 生成的概览

让 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 密钥或凭据。
安装前请注意
它从不获取或读取包内容,因此没有 OSV 公告且下载量正常的恶意包仍可能返回 safe。audit_deps 读取清单而非锁文件,不解析依赖树,且其批量 OSV 调用失败时每个包都会报告 0 个漏洞。仅存在于私有注册表的包会被视为缺失。它大约每天联系一次规则更新源;可用 --offline、AGENT_GUARDS_NO_FEED=1 或本地配置文件中的 feed 设置关闭更新。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Package Guard Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

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

json
{ "mcpServers": { "package-guard": { "command": "npx", "args": ["-y", "package-guard-mcp"] } } }

Tools

  • verify_package: the main guard. Returns safe, caution, or danger, based on whether the registry has the name (if not you get likely_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 the dependencies and devDependencies in 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
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.3.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分