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 整合