
Slopsquat Scanner
io.github.4hmetuyar由 GitHub 账号 4hmetuyar 发布v0.1.1更新于 Oct 24, 2026
Checks declared npm/PyPI dependencies against real registries to catch slopsquatting
概览
本地 MCP 服务器,将项目声明的 npm 与 PyPI 依赖与真实仓库比对,识别抢注或幻觉生成的包名。
- 可以做什么
- 扫描目录中 package.json 声明的 npm 依赖并逐个查询 npm 仓库
- 检查 requirements.txt 或 pyproject.toml 中的 pip 依赖是否存在于 PyPI
- 自动识别并同时检查同一目录下的 npm 与 pip 清单
- 针对 npm 或 PyPI 检查单个包名是否存在
- 以 dependency_not_found(严重)或 dependency_recently_published(低)报告结果,并可输出 SARIF 供 CI 使用
- 适用场景
- 适合在 AI 编程助手建议或写入包名后、安装之前确认这些包确实存在。也适合在 CI 流程中让未在任何仓库发布的包名导致构建失败。
- 运行要求
- 以 stdio 方式在本地运行,通常通过 npx 启动已发布的 npm 包。需要 Node.js 以及访问公共 npm 仓库和 PyPI JSON API 的网络连接;无需 API 密钥或账号。
安装
在 SourceWeft 中
- 打开 控制台中的 Slopsquat Scanner,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
@guardbee/mcp-slopsquat-scanner
🇬🇧 English | 🇹🇷 Türkçe | 🇨🇳 中文 | 🇯🇵 日本語 | 🇰🇷 한국어 | 🇧🇷 Português | 🇪🇸 Español | 🇩🇪 Deutsch
[npm version] [npm downloads] [License: MIT]
An MCP (Model Context Protocol) server that checks every dependency declared in a project's own manifest (package.json, requirements.txt, pyproject.toml) against the real npm/PyPI registry — not a local database, an actual network lookup.
LLM coding assistants hallucinate plausible-sounding package names at a measurable rate — research on open-source models puts it around 21.7%. Attackers know this and pre-register exactly those names on npm/PyPI, so the next person who copies the same suggestion doesn't get an install error — they get the attacker's code instead. This is slopsquatting, and unlike a typo-squat, there's no misspelling to catch by eye: the hallucinated name is often more plausible-sounding than the real package it was meant to be.
Telemetry is off by default. With
GUARDBEE_TELEMETRY=1it sends the server, tool, success, duration and short parameter values such as a file path; longer strings and fields likecontent,tokenorpasswordare replaced with a placeholder. See@guardbee/mcp-telemetry.
Why a live registry lookup, not a local list
There's no way to maintain a local "known bad" list for this — the whole point of a slopsquat is that it's a new name, registered specifically to catch a specific hallucination, possibly hours before someone runs npm install. A static pattern can't know that; only asking the registry "does this exact name exist right now" can. This package only checks a project's own directly declared dependencies (the dependencies/devDependencies/peerDependencies/optionalDependencies sections of package.json, or requirements.txt/pyproject.toml for Python) — not the full resolved lockfile tree. Transitive dependencies were already vetted by whichever maintainer published the package that depends on them; the actual risk moment is when a new name gets typed (by a human or an AI assistant) directly into your own manifest.
A name that doesn't exist at all is unambiguous and reported critical — verify the correct name before you or a teammate installs it. A name that does exist but was only published in the last 30 days is reported low/informational, not critical: this is routine for real new packages too, and on its own doesn't prove anything malicious — it's a "worth a second look" signal, not a verdict.
Features
- Checks npm and PyPI — package.json, requirements.txt, and pyproject.toml (both PEP 621
[project] dependenciesand Poetry's[tool.poetry.dependencies]) - Direct dependencies only — fast, and matches where the actual slopsquatting risk moment is
- Scoped npm packages (
@scope/name) handled correctly — found and fixed a real URL-encoding bug during development (encodeURIComponenton the whole name double-encodes the registry's own@scope%2Fnameconvention, producing a URL the registry doesn't recognize as a single package) - No API key required — queries the public, unauthenticated npm registry and PyPI JSON API directly
- SARIF 2.1.0 output — CI/CD integration (GitHub Code Scanning, etc.)
- 18 unit tests covering the manifest parsers (including a check that transitive lockfile entries are correctly not included) and the severity classification logic, all against real, deterministic fixtures — no mocked network calls, since parsing and classification are pure functions that don't need one. End-to-end verified against the real npm and PyPI registries with a fixture mixing real packages (
react,vitest,requests) and deliberately hallucinated ones — caught both hallucinated names, zero false positives on the real ones. Also run against this monorepo's ownpackage.jsonfiles as a dogfooding check: zero false positives on real dependencies, and one genuinely correct low-severity finding (@guardbee/mcp-telemetry, itself only ~2 weeks old on npm at the time) — exactly the intended "worth a look, not an alarm" behavior.
Quick Start
Claude Desktop / MCP Client
CLI (CI/CD)
MCP Tools
Detected Patterns
Configuration (guardbee.yml)
Limitations (by design)
- Direct dependencies only. A hallucinated or squatted name inside a transitive dependency (something a package you depend on itself depends on) isn't checked — that package's own maintainers already resolved it against a real registry when they published.
- The "recently published" signal is genuinely ambiguous. Real new packages get published constantly; this is reported at low severity specifically because it is not proof of anything, only a "look closer" prompt.
- Network-dependent. Every check is a live HTTP request to the npm/PyPI registry — a project with many dependencies means many requests (bounded to 8 concurrent at a time), and a registry outage or rate limit will show up as a tool error, not a false "doesn't exist" finding (registry errors are reported separately from a genuine 404).
- No version-pin awareness. This checks whether the name exists, not whether the specific version range you've pinned is itself suspicious — that's a different, already-covered problem (see
@guardbee/mcp-dependency-auditorfor known-CVE checking).
Development
License
MIT — GuardBee
Feedback
Questions, ideas, or a false positive? Start a thread in GitHub Discussions or open an issue. If GuardBee is useful to you, a ⭐ on the repository helps others find it.
来源:packages/slopsquat-scanner/README.md,提交 040e072
工具
0版本历史
1- v0.1.1最新Sep 29, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分