
Shield
io.github.bolyra由 GitHub 账号 bolyra 发布v0.1.0更新于 Oct 24, 2026
Stdio MCP auth proxy: wrap any MCP server with per-tool permission enforcement.
概览
一个本地 stdio 代理,可包裹任意 MCP 服务器,对工具调用实施逐工具权限控制、重放防护和审计回执。
- 可以做什么
- 将目标 MCP 服务器作为子进程启动,在转发前拦截其工具调用,无需修改服务器代码。校验代理凭据,并按权限策略检查每次工具调用,拒绝不合规的调用。支持默认拒绝模式,未配置策略的工具一律被拒绝。学习模式可根据服务器自身的工具列表生成初始 shield.yaml,默认拒绝并采用最小权限。将审计回执输出到 stderr,并用 nonce 存储拒绝重放的证明。也可作为库嵌入代码使用。
- 适用场景
- 当你运行本地 stdio MCP 服务器(例如在 Claude Desktop 或 Cursor 中),希望限制代理可调用的工具、按工具要求凭据,或保留工具调用审计记录而不修改服务器时使用。
- 运行要求
- 通过 npm 包在本地以 stdio 运行,通常用 npx 启动,需要 Node.js。需要一个要包裹的目标服务器命令和 shield.yaml 配置文件,学习模式可生成该文件。未声明环境变量或请求头。
安装
在 SourceWeft 中
- 打开 控制台中的 Shield,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
@bolyra/shield
Stdio MCP auth proxy. Wrap any MCP server with per-tool permission enforcement, replay protection, and audit receipts. No code changes to the server.
Quick Start
Shield spawns the target server as a child process, intercepts tools/call requests, verifies agent credentials, and enforces tool policies before forwarding.
Config
Create shield.yaml:
Then:
Default Deny
By default, tools without a policy entry are allowed through (only authentication is checked). Set defaultDeny: true to reject any tools/call for tool names not listed in the tools: map.
Learn Mode
Don't write the config by hand — generate a safe starting point from the server's own tool list:
Learn mode spawns the server, performs the MCP handshake (initialize → notifications/initialized → tools/list, following pagination), then writes shield.yaml (or the --config path) with:
defaultDeny: true— anything the server adds later is rejected until you allow it- every discovered tool at
requireBitmask: 1(READ_DATA) — the least-privilege floor - a
_generatedprovenance block (source command + timestamp)
It never overwrites an existing config file, caps pagination at 50 pages, and times out after 30 seconds. The output is a starting point: review each tool and raise its requireBitmask (e.g. write_file → 2) before production use.
How It Works
initialize,tools/list,ping— forwarded without authtools/call— proof extracted fromparams._meta.bolyra, verified, policy checked, then forwarded or rejected- Receipts emitted to stderr (stdout is the MCP transport)
Permission Bitmask
Shield vs Gateway
Both use the same verifyBundle() and checkToolPolicy() from @bolyra/mcp.
Library Usage
Links
- Gateway (HTTP) — for HTTP MCP servers
- MCP Middleware — for embedding auth in your server code
- Bolyra docs
来源:integrations/shield/README.md,提交 5e9de85
工具
0版本历史
1- v0.1.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分