Mcp Secret Scrub

io.github.sudo-ai-git由 GitHub 帳號 sudo-ai-git 發布v1.0.0更新於 Oct 24, 2026

Deterministic no-LLM MCP server that scrubs secrets before they reach an agent. Never leaks values.

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

概覽

AI 產生的概覽

一個本機 MCP 伺服器,在文字進入代理上下文之前,以確定性方式偵測並遮蔽其中的機密。

可以做什麼
它會掃描文字、日誌與對話紀錄中的機密樣式,例如 AI 供應商金鑰、雲端與 GitHub 權杖、JWT、PEM 私密金鑰、Bearer 與 Basic 認證標頭、鍵值指派以及連線字串。工具包括 scrub_text(以遮蔽、遮罩或雜湊方式處理符合項目)、scan_text(只回報存在哪些機密類型而不做修改)、report_full(一次呼叫完成掃描與遮蔽)以及 secret_profiles(列出支援的偵測設定)。偵測為純樣式比對,不使用大型語言模型,也不存取網路,相同輸入的結果是確定的。
適用情境
當你經常把日誌、設定檔或對話紀錄貼給代理,並希望先移除憑證時,值得加入。它適合需要可重複、離線遮蔽步驟而非依賴模型猜測的情境,也適合只想了解出現了哪些機密類型而不暴露其值的情境。
執行需求
以本機程序透過 stdio 執行,從 PyPI 安裝 mcp-secret-scrub(pip、pipx 或 uv)。未宣告需要帳號、API 金鑰、環境變數或網路存取。可手動以連接埠參數啟動選用的 HTTP 模式。
安裝前請注意
它會處理你送出的任何文字,因此即使伺服器只回報機密類型、數量與位置,也應把輸入視為敏感資料。遮罩模式會顯示符合項目的前四個與後兩個字元,雜湊模式輸出確定性的無鹽 SHA-256 前綴,結果可重現,可能被用於與已知值比對。遮蔽基於樣式比對,可能漏掉不符合已知設定的機密。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

mcp-secret-scrub

mcp-name: io.github.sudo-ai-git/mcp-secret-scrub

Deterministic, no-LLM MCP server that scrubs secrets from text, logs, and transcripts before they enter agent context — and never leaks the value.

No LLM. No network. Pure structural detection. MIT. Crown-jewel-free.


The problem it solves

Before you hand raw text to an agent (or store it, or pass it to a tool), you often don't know whether it contains a live secret. Platform scrubbers miss patterns all the time — a private key, an nvapi- token, a github_pat_ token, an api_key= assignment mid-log. If that text reaches an LLM context or a persisted transcript, the secret is effectively exfiltrated.

This server answers, deterministically:

Which secrets are in this text, and can you redact them safely before it goes anywhere?

Detection coverage (deterministic profiles)

familyexamples
AI provider keyssk-proj-…, sk-ant-api…, sk-or-v1-…, sk-…, nvapi-…
Cloud / GitHubAKIA…, aws_secret_access_key=, ghp_…, gho_…, ghu_…, ghs_…, ghr_…, github_pat_…
Identity / authJWTs (eyJ…), PEM private keys, Bearer …, Basic …, OAuth client secrets
Assignmentsapi_key=, token=, secret=, password=, client_secret=, webhook_secret=
Endpoints / DSNsDiscord webhooks, Slack xox…, SQL/Redis/Mongo/AMQP connection strings

The scan never returns the secret value — only its type, count, and position. That is a hard safety contract, enforced by test.

Tools (MCP)

toolpurpose
scrub_text(text, mode, keep_label)redact / mask / hash secrets; returns scrubbed text (never the value)
scan_text(text)detect which secret types are present (no mutation)
report_full(text)scan + redact in one call, scrubbed preview + findings
secret_profiles()list all supported detection profiles

Modes:

  • redact (default) → [REDACTED:TYPE]
  • mask → shows first 4 + last 2 chars
  • hash → deterministic SHA-256 prefix (reproducible across calls)

Quick start (stdio)

bash
pip install mcp-secret-scrubmcp-secret-scrub          # stdio (default)

Or via uv/pipx for an installable console entry:

bash
pipx install mcp-secret-scrub

MCP client config:

json
{ "mcpServers": {    "secret-scrub": { "command": "mcp-secret-scrub" }}}

Streamable HTTP (remote / Smithery-publishable)

bash
python3 mcp_server.py --http --port 8138   # serves on http://<host>:8138/mcp/

Determinism & safety guarantees

  • Deterministic: same input → identical output in every mode, every call.
  • Never leaks: scan_text and scrub_text never emit the original token; _deterministic_hash is SHA-256 (no salt) so output is reproducible.
  • No LLM, no network: pure regex + reachable structure detection.
  • Input-safe: non-string input returns a clean error, not a traceback.

Verification

  • python3 test_detector.py — 14/14 core checks (detection, redaction, determinism, no-leak contract, benign/unicode/empty input, bad-mode)
  • python3 test_e2e.py — drives the real MCP stdio transport and asserts the secret does NOT cross the wire

License & provenance

MIT. Part of the sudo-ai-git deterministic no-LLM agent-trust MCP family (mcp-skill-sec · mcp-verify-claim · mcp-benchmark-hygiene · mcp-secret-scrub).

來源:README.md,提交 c5b3a04

工具

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

版本歷史

1
  1. v1.0.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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