
Heimdall
io.github.caglarbozkurt由 GitHub 帳號 caglarbozkurt 發布v0.5.1更新於 Oct 24, 2026
Scan an MCP server or agent config for injection, exfiltration, and risky capabilities.
概覽
本機預檢安全掃描器,讓助理在接入前靜態審查 MCP 伺服器或代理設定中的注入、資料外洩與高風險能力。
- 可以做什麼
- 掃描目標(npm 或 PyPI 套件、本機目錄、git 儲存庫、tools.json 匯出或 MCP 用戶端設定),產出附 file:line 或 tool:name 證據的評分報告。檢查工具描述中的注入與工具投毒,並盤點檔案系統、網路、shell、eval 與憑證存取能力。追蹤從密鑰到網路、從 fetch 到 eval 的已證實資料流路徑。稽核整個代理設定中的跨伺服器外洩鏈與工具名稱衝突,並比對基準偵測漂移。依預設、嚴格或自訂政策將結果判定為通過、警告或失敗,可選輸出 JSON 或 SARIF。
- 適用情境
- 在安裝或連線不熟悉的 MCP 伺服器之前使用,或用於稽核現有代理設定。也適合在 CI 中把關 MCP 設定,讓有風險的伺服器使建置失敗。
- 執行需求
- 透過 npm 套件 mcp-heimdall-scan 以 npx 在使用者機器上作為本機程序執行;未宣告需要帳號、API 金鑰或環境變數。預設離線運作;可選的線上 CVE 檢查會連線 OSV.dev。僅限桌面端。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Heimdall,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Heimdall
The watchman at your agent's gate.
A local, pre-flight security scanner for Model Context Protocol (MCP) servers — vet a server, or a whole agent config, before your agent trusts it. No account, no backend, and it never runs the server by default.
[npm] [CI] [downloads] [license] [node] [try in your browser]
MCP servers are unvetted code with a natural-language attack surface: their tool descriptions go straight to your model, and the server runs with your machine's access. Heimdall scores what a server can actually do — not what it claims — and cites the exact evidence. It runs entirely on your machine, needs no account, and never executes the server by default, so you can vet a package before you install it and gate it in CI.
Quickstart
No install, runs locally, nothing leaves your machine.
Or try it in your browser: caglarbozkurt.github.io/mcp-heimdall
— the full scanner runs 100% client-side (npm packages are fetched via jsDelivr; or paste a
tools.json / MCP config). No backend, nothing uploaded. Local paths and --handshake need the CLI.
What it checks
Every finding cites file:line or tool:name. Capability ≠ risk: raw power is shown as
an informational profile and never fails the scan — only hard gates and real anomalies do.
What makes it different
- Local, and it doesn't run the server. Everything is static and offline by default — no
account, no backend, nothing uploaded — and it never executes untrusted code unless you opt
into
--handshake(documented for a disposable VM only). You vet a package before installing. - Proves the path. Taint/data-flow turns "reads files AND has network = fail" into a concrete, located flow — so it doesn't cry wolf on a config read plus an unrelated API call.
- Sees the whole gate. It reasons across the set of servers you've configured — the cross-server exfil path neither server shows alone. Most scanners look at one at a time.
- A gate you control. Detectors emit facts; a policy you define turns them into pass / warn / fail. Deny capabilities, require provenance, add audited waivers, gate CI.
Usage
Options
Policies
Detectors emit facts; a policy turns them into the verdict. Ship the default, pick
strict, or write your own procurement/security criteria:
Example policy (policy.example.json)
Waivers carry a reason and optional expiry — an expired waiver lapses and re-flags.
Library
Also ships as a Claude Code skill (skill/) — vet a server in-conversation before installing.
Use it as an MCP server
Give your agent a scan_mcp_server tool so it can vet a server before connecting to it —
"scan this before you add it." Add Heimdall to your MCP client config:
The tool takes target (npm package, pypi:<name>, path, GitHub URL, tools.json, or a client
config), plus optional policy and online. It's static-only — it downloads but never
executes the server, and the code-execution modes (--handshake, validate) are intentionally
not exposed to the agent.
Use it in CI (GitHub Action)
Gate every pull request — scan your MCP config (or a server) and fail the build if it's
risky. Add this to .github/workflows/:
Runs entirely on your own CI runner — no backend, and free on public repos.
Validate (behavioral cross-check)
Static analysis says what a server can do. heimdall validate checks that against what it
actually does — it runs the server with a capability recorder preloaded (hooking
fs / net / http(s) / child_process / vm / fetch / process.env), drives each tool,
and diffs observed runtime behavior against the static flags:
- confirmed — flagged and observed (the static claim held up).
- not exercised — flagged but not triggered by naive args (a lower bound, not proof the flag is wrong).
- missed — observed but not flagged → a real static gap to review (or an incidental library side effect).
So it's trustworthy for finding false negatives (static misses); it does not disprove a flag.
Each server runs in a throwaway HOME + working directory with no inherited secrets, but it
still runs the server and calls its tools (network/exec side effects) — use a disposable VM/container.
Behavioral run over 200 real packages (benchmarks/validate-run.md):
55 booted, 34 exercised an observable capability. Of the capabilities servers actually
exercised at runtime, the static scan flagged 80.9% (55/68) — up from 75.8% after the
first run's misses became a fix-list (we widened dependency-based network detection, which
roughly halved the network misses). The misses that remain are structural: a capability
exercised inside a dependency's internals or a subprocess, which static analysis fundamentally
can't see — which is exactly why validate exists as the backstop. Honest recall, openly
reported, improving run over run.
Tested at scale
Run against 2,500 real MCP packages from the npm registry (benchmarks/): 1,726 scanned
in ~5 minutes, 0.7% flagged — robust on messy real-world code. Separately, it scores
100% on the small labeled fixture corpus (npm run eval, ~10 benign/malicious fixtures
including the Damn Vulnerable MCP project) — a calibration check, not a broad real-world
accuracy number; the field scans above are unlabeled and used only for robustness. Full log:
benchmarks/field-run.md.
What that scan says about the ecosystem your agent trusts:
The 0.7% flagged were driven by install-time code execution and prompt-injection — including real servers with hidden zero-width characters embedded in their tool descriptions, the kind of stealth tool-poisoning a keyword scanner sails past.
A robustness + distribution run is not an accuracy benchmark — the 2,500 servers are unlabeled. A flag means review this, not proven malicious.
Security & limitations
Heimdall is a heuristic pre-flight check, not a guarantee — a PASS isn't proof of safety.
Capability, provenance, and CVE analysis cover JS/TS and Python; injection is
language-agnostic. Proven taint/data-flow is JS/TS only — Python falls back to
capability co-presence (a conservative gate, not a proven flow).
Everything runs offline by default; --online is the one network call (it sends dependency
names + versions to OSV.dev, never your source), and the CVE match is against the declared
range, not a lockfile. --handshake runs untrusted code and is not a real sandbox. See
SECURITY.md for the full threat model and how to report a vulnerability.
Contributing
New detection rules are the highest-value contribution — see
CONTRIBUTING.md. By participating you agree to the
Code of Conduct.
License
MIT · built by Çağlar Bozkurt
來源:README.md,提交 1844fb2
工具
0版本歷史
1- v0.5.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分