
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 分