mcpField
G
Gauntlet

Gauntlet

本地服务
crates.io开发工具01 周前更新

关于 Gauntlet

Gauntlet 是面向开发者的 Rust 工具包,用于在部署前测试 MCP 服务的安全性与可靠性。它包含 schema 驱动的模糊测试和并发负载测试 CLI,并支持 CI 检查。

主要功能

  1. 01基于 Schema 的输入模糊测试
  2. 02输出 SARIF 格式发现结果
  3. 03并发 MCP 负载测试
  4. 04按工具统计延迟与吞吐量
  5. 05为 CI 设置延迟和错误阈值
  6. 06支持 stdio 和 Streamable HTTP

适用场景

  1. 01发布前发现崩溃和校验漏洞
  2. 02将安全发现上传至 GitHub code scanning
  3. 03在 CI 中检查延迟和错误预算

MCP 相关

共享的异步 MCP 客户端通过 stdio 或 Streamable HTTP 连接服务。mcp-fuzz 使用 MCP 获取工具及其 Schema,mcp-storm 则发送并发请求。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

暂未收录安装方式

我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。

代码仓库

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

属于 StudioMeyer MCP Stack 的一部分 — 在马略卡岛打造 🌴 · 如果你在使用,请点 ⭐

mcp-gauntlet

mcp-fuzz mcp-storm CI OpenSSF Scorecard License: MIT

面向 Model Context Protocol 服务的可靠性与安全工具包。 两个单二进制 CLI,共享一个快速的异步 MCP 客户端核心:

工具功能
🔬 mcp-fuzz知晓架构的模糊测试器。读取每个工具的 inputSchema,并向其发送一系列恶意、边界和格式错误的载荷,以发现 崩溃、挂起、内部错误和未被发现的验证漏洞。生成 SARIF,供 GitHub 代码扫描使用。
🌩️ mcp-storm负载测试工具(“MCP 版 k6”)。让 N 个并发工作线程向你的服务发起请求,报告每个工具的 p50/p95/p99 延迟和吞吐量,并根据延迟/错误率阈值 控制 CI 是否通过。

两者均使用 Rust 编写:各自为一个静态二进制文件,无需运行时,可直接用于任何 CI。它们通过 stdio(子进程)或 Streamable HTTP 使用 MCP 通信。

由 StudioMeyer 构建。与 mcp-armor(运行时防护)配套 — mcp-gauntlet 是部署前的攻击者与负载生成器。


为什么

MCP 服务经常无声失败,而且上线很快。大多数服务没有针对格式错误输入的测试,也没有延迟预算。mcp-gauntlet 通过两个命令即可同时满足这两项需求,你今天就可以将它们接入 CI — 无需手动编写任何测试,因为载荷是根据服务自身的架构生成的。


安装

# from crates.io
cargo install mcp-fuzz mcp-storm

# or from source
git clone https://github.com/studiomeyer-io/mcp-gauntlet
cd mcp-gauntlet && cargo build --release
# binaries in target/release/{mcp-fuzz,mcp-storm}

MSRV:Rust 1.86。


mcp-fuzz — 在用户遇到崩溃前将其找出

# fuzz a stdio server (everything after -- is the launch command)
mcp-fuzz run --stdio -- node my-server.js

# fuzz a remote HTTP endpoint, write SARIF for GitHub code scanning
mcp-fuzz run --http https://example.com/mcp --sarif findings.sarif

# only one tool, more payloads, fail CI on any HIGH finding
mcp-fuzz run --stdio --tool search --iterations 300 --fail-on high -- ./server

它会连接服务、调用 tools/list,并根据架构为每个工具生成载荷:

  • 类型混淆(需要数字时提供字符串,……)
  • 边界值(空字符串 / 10 万字符的字符串、i64::MAX、负数、零、超大浮点数)
  • 注入(路径遍历、SQLi、命令/模板/格式字符串、提示词注入、CRLF、NUL 字节、从右到左/零宽 Unicode)— 仅作为数据发送,绝不执行
  • 缺少必填字段、类型错误的 arguments、深层嵌套

结果会分类处理:连接断开 ⇒ 崩溃(高),超时 ⇒ 挂起(高),-32603 ⇒ 内部错误(中),接受违反架构的数据 ⇒ 接受无效输入(低)。正常返回 -32602 invalid params 会被视为服务正确执行了验证 — 不会记为发现项。

测试运行可复现(--seed)。崩溃后,模糊测试器会重新启动服务并继续;如果无法恢复服务,它只会记录一次并正常停止,而不会把之后的每个载荷都归咎于最初的崩溃。

mcp-fuzz report
───────────────
server         my-server (protocol 2025-11-25)
tools          7
payloads sent  412
findings       2 total — 1 high, 0 medium, 1 low, 0 info

Findings (worst first):
  [HIGH  ] crash            search::server crashed on field 'query': null-byte
           stderr tail:
           thread 'main' panicked at 'invalid utf-8 ...'
  [LOW   ] accepted-invalid search::schema-invalid input accepted without error: missing required field 'query'
在 CI 中使用(GitHub 代码扫描)
- run: mcp-fuzz run --stdio --sarif mcp.sarif --fail-on high -- node server.js
- uses: github/codeql-action/upload-sarif@v3
  if: always()
  with: { sarif_file: mcp.sarif }

mcp-storm — 掌握你的延迟预算

# 16 workers for 30s against a stdio server
mcp-storm run --stdio --concurrency 16 --duration-secs 30 -- node my-server.js

# fixed request count against HTTP, gate CI on p95 + error rate
mcp-storm run --http https://example.com/mcp --requests 5000 \
  --threshold-p95-ms 250 --max-error-rate 1.0
mcp-storm report
────────────────
server       my-server (protocol 2025-11-25)
workers      16
duration     30.00s
requests     48213 (3 errors, 0.01% error rate)
throughput   1607 req/s

tool                    calls    err%     p50ms     p95ms     p99ms     maxms      req/s
──────────────────────────────────────────────────────────────────────────────────────
search                  31044   0.01%      6.20     14.80     31.10    102.40       1035
fetch                   17169   0.00%      9.10     22.30     58.70    210.00        572

使用 stdio 时,并发是真实有效的:请求会在单条管道上多路复用,并通过 JSON-RPC id 解复用,因此 N 个工作线程确实会并行执行。--threshold-p95-ms / --max-error-rate 会在超出预算时以非零状态码退出 — 可直接将其用作 CI 门禁。使用 --warmup-secs 排除冷启动时间。


工作区布局

mcp-gauntlet/
├── crates/mcp-gauntlet-core   # shared async MCP client (stdio + HTTP), schema gen, mock server
├── crates/mcp-fuzz         # the fuzzer CLI
└── crates/mcp-storm        # the load tester CLI

mcp-gauntlet-core 也已发布——它是一个小巧、支持并发的 MCP 客户端,可独立使用,并提供由架构驱动的值/变更生成器,以及一个进程内 mock 服务(mcp-fuzz mock / mcp-storm mock)。你可以将任一工具指向该服务,无需任何设置即可试用:

mcp-fuzz run --stdio -- mcp-fuzz mock     # fuzz the bundled demo server

开发

cargo fmt --all
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-features

StudioMeyer MCP 工具包的一部分

一组专注、达到生产级别的工具,助你构建和运行 MCP 服务——可自由组合:

  • mcp-armor — 运行时防御侧车:扫描工具调用、验证签名清单、拦截已知的高危 CVE
  • mcp-gauntlet (本项目) — 部署前使用 mcp-fuzz(理解架构的模糊测试工具)和 mcp-storm(负载测试工具)
  • mcp-covenant — 契约与破坏性变更检测器(针对 MCP 接口的语义化版本控制)
  • mcp-herald — 面向 MCP 2026-07-28 规范的静态迁移检查工具
  • mcp-passport — MCP Registry 发布就绪度验证器
  • mcp-otel — W3C Trace Context → OpenTelemetry 桥接工具
  • mcp-cache-kit — 防泄漏的 SEP-2549 缓存(ttlMs + cacheScope)
  • skilldoctor — 面向 Agent 技能文件的检查工具 + 安全扫描器

许可证

MIT © StudioMeyer。详见 LICENSE。

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。