
shadow-mcp
io.github.saagpatel由 GitHub 帳號 saagpatel 發布v0.2.0更新於 Oct 24, 2026
Local MCP server that inventories and risk-grades MCP servers configured on this machine.
概覽
本機 MCP 伺服器,用來找出這台機器上已設定的 MCP 伺服器、彙整清單並進行風險評級。
- 可以做什麼
- 執行探索、彙整、評級、報告的完整流程並回傳 JSON
- 在不評級的情況下清點本機設定檔與行程表中的所有 MCP 伺服器
- 對指定伺服器或全部伺服器進行以設定為基礎的靜態評級
- 顯示各收集器在一次探索執行中的來源計數
- 合併跨主機重複出現的同一伺服器,並標出執行中但未設定或權限過大的伺服器
- 適用情境
- 適合讓助理不必離開對話,就能查核開發機上實際安裝了哪些 MCP 伺服器、來源為何、風險如何。適用於本機影子 MCP 的衛生檢查,而非遠端或全組織範圍的掃描。
- 執行需求
- 以 stdio 本機行程執行,透過 uvx 從 PyPI 的 shadow-mcp 套件啟動,需要 Python 3.11 以上版本;評級引擎在執行時從 PyPI 取得。未宣告帳號、API 金鑰或環境變數。會讀取本機設定檔與行程表。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 shadow-mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
shadow-mcp
Discover and risk-grade the MCP servers actually present on this machine.
Most MCP security tooling assumes you already have a list of servers to audit.
On a real developer machine you don't: servers are scattered across Claude Code,
Codex, Claude Desktop, project-local .mcp.json files, DXT extensions, and live
processes that bind no port. shadow-mcp finds them first, then grades them.
This is the local-first answer to OWASP MCP09:2025 — Shadow MCP Servers.
What it does
- Discover (read-only) MCP servers from supported configuration and runtime sources:
Claude Code (
~/.claude.json, user + project scope),claude mcp list(catches remote + plugin servers no file contains), Codex (~/.codex/config.toml+ profiles), project.mcp.json, Claude Desktop config + DXT extension manifests, and the live process table. - Inventory: merge sightings into one entry per logical server, even when a
server appears under different names across hosts (
personal-opsvspersonal_ops), tracking every provenance. - Risk-grade by delegating to the existing engines rather than reimplementing them:
- Report: a ranked terminal table, a machine-readable JSON inventory, or markdown — plus a Shadow & attention section for the deltas that matter (running-but-unconfigured, broad blast radius, capable-but-ungraded).
The risk model and its OWASP mapping live in docs/risk-model.md.
Install
From this repository root, use uv:
The grading engines (mcp-audits and mcp-trust) are runtime dependencies
resolved from PyPI, not editable sibling checkouts or an engines group.
The installed mcp-trust package supplies its seed catalog; --registry-db or
SHADOW_MCP_MCPTRUST_DB selects an explicitly chosen local registry instead.
Use
Useful flags: --no-processes (skip the live process scan), --no-cli (skip
claude mcp list), --no-mcpaudit (inventory + mcp-trust only), --home PATH
(point discovery at a fixture tree).
Static vs connected grading
By default grading is static (config-only): no server is spawned, so grades reflect what's visible in the config. That's safe but coarse — a server's real capability only shows once you connect and list its tools.
shadow-mcp scan --connect (or deep-scan [names...]) spawns each stdio
server and enumerates its real tools, delegating to MCPAudit's connected engine
for a capability grade that actually differentiates (a filesystem server jumps
from a static A to a connected D). This is opt-in because connecting
executes the server; remote endpoints are never spawned (that's the network-scan
tier), and a server that needs real secrets to start falls back to its static
grade.
Development and safe verification
The committed uv.lock fixes the PyPI runtime and development graph. From the
repository root, run:
The suite uses synthetic homes. Keep SHADOW_MCP_RUN_CONNECT unset: the
explicitly opted-in connected test is a separate server-execution lane. CI runs
the same aggregate gate on Python 3.11 through 3.15; see
the workflow. make build creates the wheel and
sdist used by the release workflow.
Do not use the normal scan, discover, sources, grade-missing or MCP tool
calls as a development smoke: they inventory the machine by default. CLI
deep-scan and scan --connect additionally execute servers. For changed JSON
or Markdown reports, check the corresponding fixture tests (tests/test_report.py)
and inspect synthetic output; this CLI has no browser UI. Actual workstation or
connected behavior requires its own explicitly authorized qualification.
Safety
- Read-only discovery. Collectors parse configs, invoke
claude mcp list(unless--no-cliis set), and list processes; nothing they find is ever mutated. (--connect/deep-scanis the one path that executes servers, and only when you explicitly ask.) - Secrets stay out. We record env variable names (to flag secret-bearing
servers per MCP01) but never their values. Inline credentials in command
arguments, URLs, and process parent commands are redacted before storage. A
captured inventory still contains local paths and hostnames, so treat
*.inventory.jsonas private (it is git-ignored by default).
Use as an MCP server
shadow-mcp can serve its own inventory tools as an MCP server so an agent can query your local MCP surface without leaving the conversation.
Tools
Run the server
LOCAL only. MCP tools read local configs and the process table, skip
claude mcp list, and never connect to hosted MCP endpoints or spawn servers.
Grading is static (config-based); connect=False is enforced unconditionally.
Scope
This is the local-first tool: it inventories one machine from its configs
and processes. A later network-scan expansion (probing hosts/ports for remote
MCP endpoints, org-wide fleet inventory, typosquat-distance provenance checks)
is deliberately out of scope here — see the bottom of docs/risk-model.md and
the project notes for what that would add.
Status
Stack
Python 3.11+; uv-managed locked dependencies; Ruff, mypy, and pytest checks; Hatchling wheel and sdist builds.
Known risks
- The minimum Python version remains 3.11 pending an owner decision about raising it to 3.12.
- The MCP tool name
deep_scanremains unchanged pending an owner decision; the similarly named CLI command can connect to servers. - Identity collisions in identity and inventory matching.
- Process sightings are deduplicated by name before owner classification.
- Grading evidence is limited to eight findings, and
criticalranks belowlow. - Collector failures can be silent.
--jsonis ignored bysourcesandgrade-missing.- Report writes are not atomic.
- Markdown and Rich output escaping differs.
- Dependency major upgrades, moving off Hatchling, a coverage threshold, package publishing, tags, and releases remain out of scope.
Next steps
Resolve the Python floor and MCP tool naming decisions, then address the listed behavior risks in a follow-up wave.
來源:README.md,提交 f6e3b69
工具
0版本歷史
1- v0.2.0最新Sep 16, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。