Mcp Slim Guard

io.github.lennney由 GitHub 帳號 lennney 發布v0.1.1-alpha.1更新於 Oct 24, 2026

76% fewer MCP tokens in our standard benchmark. Same upstream call. Exact recovery.

已驗證STDIO僅桌面開發者工具安全與監控

概覽

AI 產生的概覽

本機 MCP 代理:以精簡目錄向助理暴露已授權的上游工具,呼叫前驗證參數,並可依參照精確取回過大結果。

可以做什麼
以 Native、Compact 或 Extreme 模式向宿主暴露已授權的上游 MCP 工具,所有模式都套用同一套允許/拒絕規則。在 Compact 與 Extreme 模式下依名稱尋找工具,最多回傳三個相符項目及其完整原始 schema。在聯絡上游伺服器之前依原始 schema 驗證呼叫參數,不符時回傳結構化錯誤。透過結果參照精確取回大結果,可依查詢讀取有限的本機片段,或依游標繼續讀取,且不會再次呼叫上游工具。檢視並套用針對 Codex 與 Claude Code 的宿主安裝方案,並驗證已設定的執行環境。
適用情境
當助理連接大量上游 MCP 工具、工具目錄或大結果佔用過多上下文時適用。也適合希望在特權上游工具前設置單一入口、允許/拒絕規則、schema 驗證與稽核日誌的情境。
執行需求
以本機 Node.js 程序執行,從 npm 套件安裝;README 說明目前版本為 alpha 原始碼候選,尚未發佈到 npm,需從審閱過的程式碼檢出建置。需要由 init 指令產生的專案設定檔來列出上游伺服器,並需要 Codex 或 Claude Code 的宿主設定。
安裝前請注意
專案處於 alpha 階段,用於特權工具前應審閱授權規則與上游設定。設定可允許或拒絕工具模式、封鎖私有 IP 與網域、限制呼叫頻率並寫入稽核日誌,設定錯誤會影響助理可存取的範圍。它轉送的上游工具本身仍可能執行寫入或刪除操作。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mcp Slim Guard,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

MCP Slim Guard

MCP Slim Guard gives a host one deliberate way to reach authorized upstream tools. It keeps input schemas intact, validates calls before the upstream is invoked, and can recover an oversized result exactly without repeating that invocation.

Choose a mode

ModeWhat the host seesBest fit
NativeAuthorized original tool names and full schemas, plus read_resultHosts that work well with a normal MCP catalog, including Codex
Compactfind_tool, call_tool, and read_result; discovery returns each match's full original schemaA small, predictable host surface
ExtremeThe Compact tool surface and schemas; only sufficiently large results receive a shorter recoverable first deliveryContext-sensitive hosts where a smaller first result is valuable

Compact is the default for start. Native is the default installation plan for Codex. Compact is the default for Claude Code; Claude Code supports Compact and Extreme installation plans, not Native.

All modes apply the same allow/deny authorization. Compact and Extreme return at most three discovery matches, each with the original required fields, enums, and nested schema. A call is validated against that original schema before the upstream server is contacted.

find_tool rejects unknown fields and queries longer than 256 Unicode code points locally. It searches only the current authorized catalog and never falls back to an unauthorized entry.

Quick start

0.1.1-alpha.2 is a source candidate and is not published to npm yet. From a reviewed checkout of this candidate:

bash
npm cinpm run buildnpm linkcd /path/to/project-with-mcp-configmcp-slim-guard initmcp-slim-guard validate
# Run the default Compact mode.mcp-slim-guard start

init writes mcp-slim-guard.yml with version 2. The file contains upstream and security settings only. Select a mode in the host command, not in YAML.

bash
# Inspect a host-specific plan without changing host files.mcp-slim-guard plan --host codexmcp-slim-guard plan --host claude-code --mode extreme
# Verify the configured runtime without changing Host configuration or calling a business Tool.mcp-slim-guard verify --host codex
# Apply a reviewed plan.mcp-slim-guard install --host codex --mode native

Host entries

For Codex, use Native when you want the normal authorized MCP catalog:

toml
[mcp_servers.slim_guard]command = "mcp-slim-guard"args = ["start", "--mode", "native"]cwd = "/absolute/path/to/project"

For Claude Code, use Compact by default:

json
{  "mcpServers": {    "slim-guard": {      "command": "mcp-slim-guard",      "args": ["start", "--mode", "compact"],      "cwd": "/absolute/path/to/project"    }  }}

See host setup for the full configuration and verification steps.

Configuration

yaml
version: 2tools:  allow:    - "upstream_*"  deny:    - "*_delete_*"ssrf:  mode: block  block_private_ips: true  allow_domains: []  block_domains: []rate_limit:  default: "60/min"injection_detection:  enabled: true  sensitivity: medium  mode: blockaudit:  output: file  filePath: mcp-slim-guard-audit.logservers:  upstream:    command: npx    args: ["-y", "@your/mcp-server"]

Version 1 configuration is intentionally unsupported. The removed compressor section is rejected rather than migrated automatically.

Repair an invalid call

If arguments do not match an authorized tool's original schema, Slim Guard returns a normal MCP tool error with structuredContent that identifies the schema failure and confirms that the upstream tool was not invoked. Correct the arguments and retry; submitted argument values are not echoed in that error.

Result recovery

When a response needs recoverable delivery, the first response includes a result_ref. Use read_result with query to locate up to three bounded local fragments, or omit query and follow next_cursor to recover the exact snapshot. Both paths use the same immutable capture and never invoke the upstream tool again. Do not combine query with cursor. Native and Compact use the standard delivery boundary. Extreme uses a smaller boundary only when the initial delivered response is at least half the size of the exact response; otherwise it passes the exact response through unchanged.

Evidence and checks

The repository includes a 24-task mode comparison, result-recovery fixtures, and a 100-tool / 8,000-row stress fixture. Run the current artifacts with:

bash
npm run buildnpm run bench:tasknpm run bench:compressionnpm run bench:stressnpm run bench:compression:verify

Their reports are mode-specific and are generated locally; do not treat older alpha benchmark figures as claims for this product line.

Development

bash
npm run buildnpm run typechecknpm run lintnpm testnpm run verify:package-boundarynpm run smoke:package

This project is an alpha. Review authorization patterns and upstream settings before using it with privileged tools.

來源:README.md,提交 a5596a0

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.1-alpha.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分