MCP Security Hardening Kit

MCP sunucusunu denetlemek için indirilebilir kit (barındırılan bir uç nokta değildir): kaynakları belirtilmiş 35 maddelik kontrol listesi, TypeScript denetim CLI’ı, güvenli problar ve koruma kitaplıkları. Statik kontroller sezgiseldir; insan incelemesinin yerini tutmaz.

Dokümantasyon

$49

Audit any MCP server before your team or your agents trust it. A 35-check checklist that cites its sources, plus a TypeScript audit CLI. The CLI catches hidden-Unicode tool poisoning, shadowing and rug-pull changes (via a lockfile), and runs safe probes for path traversal, SSRF and command injection. It outputs SARIF for CI and comes with guards that fix what it finds.

MCP servers run with your developers' file system, network and credentials. This kit gives you a repeatable way to review them.

What's inside:

MCP Security Checklist: 35 checks in 8 sections. Each has a severity, a way to verify it, and its source (MCP specification and security best practices, OWASP MCP Security Cheat Sheet, RFC 9728). zh-TW summary included

mcp-audit CLI, built on the official MCP SDK:

- static checks for hidden Unicode (invisible tag-character payloads decoded), hidden markup, instruction-like text, credential-file references, cross-server shadowing, loose schemas and misleading annotations

- a lockfile that pins a SHA-256 of every tool and prompt definition and fails CI when one changes

- opt-in probes that prove exploitability without harm: path traversal, SSRF via a local canary, command injection, oversized input, stack-trace leaks. Destructive tools are skipped by default

- console, JSON, Markdown and SARIF output, plus --fail-on for CI

Guard library: SSRF-safe fetch (DNS-rebinding safe), path confinement with symlink checks, shell-free exec with allowlists, redaction, rate limiting, untrusted-output labelling, structured audit log

A deliberately vulnerable server and a hardened version of it. 24 tests prove the audit flags the first and passes the second

Threat-model template, vendor questionnaire for third-party servers, incident runbook, CI example, sample report

Limits, stated plainly: static checks are heuristics and don't replace a human review or a penetration test.

No credentials included. Remote-server tokens are read from environment variables.

Requirements: Node.js 20.12+ (22 recommended).

在團隊或 AI agent 信任任何 MCP 伺服器之前先做稽核。內含 35 項附出處的檢查清單,以及 TypeScript 稽核 CLI:可抓出隱藏 Unicode 工具投毒、跨伺服器遮蔽、定義遭偷換(lockfile),並安全地探測路徑穿越、SSRF 與指令注入。輸出 SARIF 供 CI 使用,另附可修正這些問題的防護函式庫。

MCP 伺服器會以開發者的檔案系統、網路與帳密權限執行。這套件提供一套可重複的審查方式。

內容:

MCP 安全檢查清單:8 大類共 35 項,每項附嚴重度、驗證方式與出處(MCP 規格與安全最佳實務、OWASP MCP Security Cheat Sheet、RFC 9728),附繁中摘要

mcp-audit CLI(使用官方 MCP SDK):

- 靜態檢查:隱藏 Unicode(解出不可見字元中的內容)、隱藏標記、類似指令的文字、帳密檔案引用、跨伺服器遮蔽、寬鬆的 schema、與實際行為不符的 annotation

- lockfile 鎖定每個工具與 prompt 定義的 SHA-256,定義一變 CI 就失敗

- 需手動開啟、不造成破壞的探測:路徑穿越、以本機 canary 偵測 SSRF、指令注入、超大輸入、堆疊外洩;預設略過具破壞性的工具

- 輸出主控台、JSON、Markdown、SARIF,並可用 --fail-on 控制 CI 結果

防護函式庫:防 SSRF 的 fetch(含 DNS rebinding 防護)、含 symlink 檢查的路徑限制、不經 shell 且有白名單的指令執行、遮蔽、限流、不可信輸出標記、結構化稽核紀錄

一個故意有漏洞的伺服器與修正後的版本;24 個測試證明稽核會抓出前者、放行後者

威脅模型範本、第三方伺服器供應商問卷、事故處理手冊、CI 範例、報告範例

直說限制:靜態檢查是啟發式的,不能取代人工審查或滲透測試。套件內不含任何帳密,遠端伺服器的 token 從環境變數讀取。

需求:Node.js 20.12 以上(建議 22)。