Rug Pull Detector

io.github.4hmetuyar由 GitHub 帳號 4hmetuyar 發布v0.2.1更新於 Oct 24, 2026

Baselines an MCP server's tools and detects tool-definition changes after approval

已驗證STDIO僅桌面開發者工具安全與監控

概覽

AI 產生的概覽

本機 MCP 用戶端,為另一個 MCP 伺服器的工具定義建立基準,並在之後偵測變更,以找出核准後才發生的 rug pull。

可以做什麼
  • 連線到目標伺服器並儲存其工具的標準化雜湊與快照,建立可信基準
  • 之後重新連線,將目前工具與已存基準比對,回報被修改、新增與移除的工具
  • 每次檢查(包含首次接觸)都會對即時工具清單執行工具投毒模式掃描
  • 列出所有已儲存基準的伺服器
  • 也可從命令列執行同樣的基準與檢查步驟,並輸出 SARIF 供 CI 或排程工作使用
適用情境
適合在加入第三方 MCP 伺服器後,想確認它在核准之後是否悄悄改動工具描述、schema 或標註的情況。可用於定期複查、工作階段前檢查,或在 CI 中對已信任的伺服器設下關卡。
執行需求
透過 npx 以 stdio 在本機執行。需要 Node.js;只有當目標是遠端 HTTP 伺服器時才需要網路存取。目標可用 stdio 指令、URL,或 MCP 風格 JSON 設定加伺服器名稱指定。未宣告帳號或 API 金鑰;基準儲存在本機目錄。
安裝前請注意
連線到 stdio 目標會啟動你提供的任何指令,因此只應指向你打算執行的伺服器。遙測預設關閉;設定 GUARDBEE_TELEMETRY=1 會把伺服器、工具、成功與否、耗時以及檔案路徑等短參數值傳送給第三方。基準身分取決於你給的標籤,改名呼叫方式會重新建立基準。它只偵測工具清單漂移,不偵測工具呼叫內部的惡意行為。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Rug Pull Detector,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

@guardbee/mcp-rug-pull-detector

🇬🇧 English | 🇹🇷 Türkçe | 🇨🇳 中文 | 🇯🇵 日本語 | 🇰🇷 한국어 | 🇧🇷 Português | 🇪🇸 Español | 🇩🇪 Deutsch

[npm version] [npm downloads] [License: MIT]

An MCP (Model Context Protocol) server that connects live to another MCP server and detects an MCP rug pull — a server presenting one tool definition when you approve it, then silently serving a different one later.

Every other scanner in this monorepo reads source code or a config file once. This one is architecturally different: it's an MCP client. It spawns the target server (stdio) or opens a session with it (Streamable HTTP), calls the real tools/list RPC, and remembers what it saw — the same trust-on-first-use model an SSH client uses for host keys. A tool's description, input/output schema, or annotations changing between two calls to the exact same server is not something any static analysis of that server's source could ever catch, because the server may not have changed its source at all — it can decide server-side, at request time, what to tell which client.

Telemetry is off by default. With GUARDBEE_TELEMETRY=1 it sends the server, tool, success, duration and short parameter values such as a file path; longer strings and fields like content, token or password are replaced with a placeholder. See @guardbee/mcp-telemetry.

Claude ──► rug-pull-detector ──► (spawns / connects to) ──► Target MCP server              │                                                  │              │                                          tools/list (real RPC)              ▼         .guardbee/tool-baselines/<hash>.json              │    1st contact: baseline_server → store canonical hash per tool    every later: check_server    → re-fetch, diff against stored hash

The trust-on-first-use model

baseline_server connects once, fetches every tool's {name, description, inputSchema, outputSchema, annotations}, canonicalizes it (deep key-sorted JSON) and stores a SHA-256 hash plus the full snapshot — one JSON file per server under .guardbee/tool-baselines/.

Every check_server also runs the tool-poisoning catalog scan on the live tools/list, including the first time a server is seen and when no baseline is stored yet. A poisoned description does not wait for a second visit.

check_server connects again later — after a version bump, before every session, on a schedule, whatever cadence you choose — and re-fetches the same information. Any tool whose hash no longer matches is reported:

  • critical — an existing tool's definition changed (tool_definition_drift). This is the rug pull itself. The finding says exactly which field changed (description / input schema / output schema / annotations) with the before/after description text, because destructiveHint: true → false is just as much a lie as a rewritten description — both change what a caller believes they're authorizing.
  • medium — a new tool appeared that wasn't in the baseline (tool_added). Could be a legitimate release. Still worth a look — nothing stops a server introducing its dangerous tool only after the benign ones already earned trust.
  • low — a previously baselined tool is no longer offered (tool_removed).

If no baseline exists yet, check_server captures one automatically and reports clean (pass autoBaseline: false / --no-auto-baseline to require an explicit baseline_server call first instead).


Features

  • Real MCP client — not a mock, not a source-code heuristic. Speaks the actual protocol over stdio or Streamable HTTP to whatever server you point it at.
  • Canonical hashing covers name, description, input schema, output schema, and annotations (readOnlyHint, destructiveHint, ...) — a server can't dodge detection by only touching the fields a naive diff would skip.
  • Three ways to specify a target: --stdio="command arg1 arg2", --url=<http-url>, or --config=<file> --server=<name> (reads an mcpServers-style JSON config directly — the same shape as a Claude Desktop config)
  • SARIF 2.1.0 output — CI/CD integration
  • 28 tests: pure unit tests for hashing/diffing/storage, plus real stdio process-spawning integration tests against a fixture MCP server (not mocked) covering drift, addition, removal, and label isolation. End-to-end verified against ai-code-scanner's own real, already-published MCP server — connected over genuine stdio JSON-RPC, baselined its 4 real tools, and confirmed a second check reports clean.

Quick Start

Claude Desktop / MCP Client

json
{  "mcpServers": {    "guardbee-rug-pull-detector": {      "command": "npx",      "args": ["-y", "@guardbee/mcp-rug-pull-detector"]    }  }}

Then ask Claude to baseline a server you're about to add, and to re-check it periodically (e.g. "check this MCP server against its baseline before we use it today").

CLI (CI/CD or scheduled check)

bash
# First contact — do this only after you've reviewed the server's toolsnpx @guardbee/mcp-rug-pull-detector baseline --config=claude_desktop_config.json --server=some-third-party-server
# Every later run — e.g. a scheduled job, or right before your app startsnpx @guardbee/mcp-rug-pull-detector check --config=claude_desktop_config.json --server=some-third-party-server --fail-on=critical

MCP Tools

ToolDescription
baseline_serverConnects to a server and stores its current tools as the trusted baseline
check_serverConnects to a server and diffs its current tools against the stored baseline
list_baselinesLists every server with a stored baseline

Configuration

No guardbee.yml section — the only persistent state is the baseline directory itself (.guardbee/tool-baselines/ by default, override with --baseline-dir).


Limitations (by design)

  • --stdio uses a simple whitespace split, not shell-quote parsing — a command/argument containing spaces will break. Use --config=<file> --server=<name> (reading a real JSON config with a proper args array) for anything beyond a trivial command line.
  • Baseline identity is the label you give it (or the command line / URL if you don't), not anything cryptographic about the server itself — renaming how you invoke a server starts a fresh baseline. Keep the label stable.
  • This detects drift in the tool list a server presents, not malicious behavior inside a tool call that was always there. It's the rug-pull defense, not a replacement for mcp-server-auditor or tool-poisoning-scanner — run all three.
  • Connecting to a stdio target means spawning whatever command you give it — the same thing every MCP client already does when you add a server to its config. Only point this at servers you intend to run.

Development

bash
npm run buildnpm test             # 28 tests

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/rug-pull-detector/README.md,提交 040e072

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.2.1最新Sep 29, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分