mcp-stdio-guard
活跃·★ 47·MIT·更新于 2026-05-24
★ 时下流行★ 安全与合规★ 可观测性
在客户端之前捕获MCP stdio服务器中的stdout污染和握手失败。
mcp-stdio-guard是一个工具,通过在影响客户端之前捕获stdout污染和握手失败来验证MCP stdio服务器。它启动服务器,执行真实的MCP初始化握手,可选地发送诸如tools/list之类的初始化后请求,验证每个stdout帧,并扫描源代码中危险的stdout调用。它有助于确保MCP服务器符合stdio传输协议。
#命令行工具#调试#开发者工具#json-rpc#MCP 协议#MCP 服务器#MCP 工具#模型上下文协议
01
功能特性
01验证MCP初始化握手
02捕获stdout污染(非JSON-RPC输出)
03可选的初始化后请求(如tools/list)
04静态源代码扫描危险stdout写入
05CI友好的JSON输出
02
兼容性
Node.js
Node.js >=18
已通过文档验证
03
快速开始
1
$ npm install mcp-stdio-guard
04
使用场景
↳CI/CD流水线在部署前验证MCP stdio服务器
↳开发调试以捕获常见错误,如服务器代码中的console.log
↳注册表验证以确保发布的MCP服务器符合协议
05
同类工具
相关搜索
评论
登录后发表评论
- DDylan Patel2026年4月3日
MCP stdio handshake failures are hard to debug without this kind of guard
- JJamie Jackson2026年3月22日
Used during MCP server development to catch protocol violations early
- SSpencer White2026年3月16日
Saved hours of debugging by catching a logging statement that was polluting stdout
- AAlex Lewis2026年3月5日
Catching stdout pollution before it reaches clients is an underappreciated debugging need