
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
概览
本地 MCP 客户端,为另一个 MCP 服务器的工具定义建立基线,并在之后检测变更,从而发现批准后发生的 rug pull。
- 可以做什么
- 连接目标服务器并为其工具保存规范化哈希与快照,建立可信基线
- 之后重新连接并对比当前工具与已存基线,报告被修改、新增和移除的工具
- 每次检查(包括首次接触)都会对实时工具列表做工具投毒模式扫描
- 列出所有已保存基线的服务器
- 也可从命令行执行同样的基线与检查步骤,并输出 SARIF 供 CI 或定时任务使用
- 适用场景
- 适用于添加第三方 MCP 服务器后,想确认它在获批之后是否悄悄改动了工具描述、schema 或注解的场景。适合定期复查、会话前检查,或在 CI 中对已信任的服务器设卡。
- 运行要求
- 通过 npx 以 stdio 在本地运行。需要 Node.js;仅当目标是远程 HTTP 服务器时才需要网络访问。目标可用 stdio 命令、URL,或 MCP 风格 JSON 配置加服务器名指定。未声明账号或 API 密钥;基线保存在本地目录。
安装
在 SourceWeft 中
- 打开 控制台中的 Rug Pull Detector,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
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=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.
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, becausedestructiveHint: true → falseis 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 anmcpServers-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
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)
MCP Tools
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)
--stdiouses 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 properargsarray) for anything beyond a trivial command line.- Baseline identity is the
labelyou 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-auditorortool-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
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版本历史
1- v0.2.1最新Sep 29, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分