SquatScan

io.github.haseeb-xd由 GitHub 账号 haseeb-xd 发布v0.1.0更新于 Nov 17, 2026

Detects slopsquatted/typosquatted npm packages before you install them.

发布方自己的服务:scan.mx Email Diagnostics

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

概览

AI 生成的概览

在安装前检查 npm 包名是否存在抢注(slopsquatting)或仿冒(typosquatting)风险,给出 0–100 评分和 GREEN、YELLOW、RED 结论。

可以做什么
  • 检查单个 npm 包,可指定版本
  • 一次检查多个包名
  • 解析 npm install 命令并检查其中每个包
  • 用 reasons 列表说明评分依据和结论原因
适用场景
当 AI 编程助手推荐 npm 包,你想在执行 npm install 前确认这些包真实存在、不是攻击者注册的仿冒名时使用。也适合一次性审查整条安装命令或依赖列表。
运行要求
以 stdio 方式在本机运行。默认需要已安装并运行 Docker(必须带 -i 参数);也可改用 Java 17+ 和已构建的 jar。无需账号、API 密钥或环境变量。需要能访问公共 npm registry。
安装前请注意
只做查询,不会安装任何东西;是否调用由助手自行决定,若不明确要求可能被跳过。包名会发送到公共 npm registry。结论是基于启发式信号的风险评分,并非安全保证。

安装

在 SourceWeft 中

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

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

SquatScan

SquatScan is an MCP server that checks npm packages for signs of slopsquatting before you install them.

https://github.com/user-attachments/assets/bac28180-2958-4d56-9410-46e5d1373f4c

AI coding assistants sometimes suggest npm packages that don't exist. Attackers register those made-up names and fill them with malware, so the suggested npm install succeeds and installs the attacker's code. SquatScan catches these packages before they are installed.

How it works

For each package name, SquatScan looks it up on the npm registry and combines these signals into a risk score from 0 to 100:

  • whether the package exists at all
  • how close the name is to a popular package (e.g. lodahs vs lodash)
  • how new the package is
  • how many downloads it has
  • whether it links to a source repository
  • how many versions and maintainers it has

The score maps to a verdict:

VerdictScoreWhat to do
🟢 GREENunder 40No strong risk signals. Go ahead.
🟡 YELLOW40–69Some suspicious signals. Check the name before installing.
🔴 RED70 or moreLooks like a squatted package. Don't install it.

Every result includes a reasons list that explains which signals affected the score.

Install

You need Docker installed and running.

Claude Code:

bash
claude mcp add -s user squatscan -- docker run -i --rm ghcr.io/haseeb-xd/squatscan:0.1.0

Claude Desktop (or any MCP client): add this to your config file (Settings → Developer → Edit Config), then fully restart the app:

json
{  "mcpServers": {    "squatscan": {      "command": "docker",      "args": ["run", "-i", "--rm", "ghcr.io/haseeb-xd/squatscan:0.1.0"]    }  }}

The -i flag is required. Without it, Docker closes stdin and the server exits immediately.

SquatScan is also listed in the MCP Registry as io.github.haseeb-xd/squatscan.

Run without Docker (Java 17+)
bash
./mvnw clean package -DskipTestsmkdir -p ~/.squatscan && cp target/squatscan-0.1.0.jar ~/.squatscan/squatscan.jarclaude mcp add -s user squatscan -- java -jar "$HOME/.squatscan/squatscan.jar"

On Windows, use an absolute path with forward slashes, e.g. C:/Users/<you>/.squatscan/squatscan.jar.

Usage

Start a new Claude session, then ask things like:

  • Is lodahs safe to install?
  • Check react, reqeusts and some-hallucinated-pkg-xyz
  • I'm about to run npm install express lodahs. Is that OK?

Tools

ToolWhat it does
check_package(name, version?)Checks one package
check_packages(names[])Checks several packages at once
check_install_command(command)Reads a command like npm install a b c and checks every package in it

Make Claude check every time (recommended)

Claude decides for itself when to call an MCP tool, and it often skips SquatScan. To make it check every time, add this to ~/.claude/CLAUDE.md:

markdown
Before recommending or installing ANY npm package, check every package name with thesquatscan MCP tools. RED: don't install it and suggest the intended package.YELLOW: warn me and ask before continuing. GREEN: go ahead.

Troubleshooting

  • Shows "failed" in /mcp: make sure Docker is running (or that java is on your PATH if you're not using Docker). Run claude --debug to see startup errors.
  • New tools don't appear: start a new Claude session. Sessions that are already running don't pick up newly added servers.

Scope

npm packages only. Runs entirely on your machine; the only network calls go to the public npm registry. No accounts or data collection.

来源:README.md,提交 5cab2a5

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:该软件包类型无法在沙箱中运行。

版本历史

1
  1. v0.1.0最新Nov 17, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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

其他 Scan 集成