
Env Secret Exposure Analyzer Mcp
io.github.vola-trebla由 GitHub 帳號 vola-trebla 發布v0.2.0更新於 Oct 24, 2026
Scans projects for secret exposure: leaked API keys, unprotected .env files, and secrets in logs.
概覽
本機 MCP 伺服器,掃描專案中的密鑰外洩風險:硬編碼 API 金鑰、未受保護的 .env 檔案,以及會印出憑證的日誌呼叫,結果僅顯示遮罩預覽。
- 可以做什麼
- 掃描原始碼、設定檔與 .env 檔案中的 20 多種密鑰樣式(雲端服務、支付、聊天、AI 供應商金鑰、私鑰、含憑證的資料庫 URL),回傳路徑、行號、嚴重程度與遮罩預覽
- 檢查 .env、secrets.json、私鑰與憑證等敏感檔案是否被 .gitignore 涵蓋
- 掃描原始碼中會印出環境變數或名稱含密鑰字樣物件的 console.log 或 logger 呼叫
- 依嚴重程度彙整發現項目,讓助理在動程式碼前先說明外洩風險
- 適用情境
- 適合在助理於程式碼庫中工作、可能讀取設定或環境檔案時使用,先做一次檢查,了解哪些內容被硬編碼、未被忽略或被印出,避免密鑰進入模型上下文或被提交。
- 執行需求
- 透過 stdio 在本機執行,以 npx 啟動 npm 套件 env-secret-exposure-analyzer-mcp,需要 Node.js,首次安裝需要網路連線。未宣告驗證、環境變數或標頭。僅支援桌面端。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Env Secret Exposure Analyzer Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
🔐 env-secret-exposure-analyzer-mcp
Your AI agent is one debug session away from leaking your secrets.
MCP server that scans your project for secret exposure risks — hardcoded API keys, unprotected .env files, and console.log calls that print credentials at runtime. Before your agent accidentally reads them out loud.
🤔 The problem
You ask your AI agent to debug a config issue. It reads src/config.ts. Inside:
The agent now has your database password in its context. It might log it, include it in a summary, or pass it to another tool. And your .env isn't in .gitignore, so the next git push will do the rest.
None of this requires the agent to be malicious. It just needs to be helpful.
env-secret-exposure-analyzer-mcp catches this before it happens. 🔐
🛠️ Tools
scan_for_secrets
Scans source files, config files, and .env files for 20+ secret patterns. Returns file path, line number, severity, and a masked preview — never the full value.
Detects:
- AWS access keys + secret keys
- GitHub tokens (
ghp_,gho_,ghs_) - Stripe secret/publishable keys + webhook secrets (
whsec_) - Anthropic, OpenAI API keys
- SendGrid (
SG.xxx), Twilio auth token + account SID - Google API keys + OAuth client secrets (
GOCSPX-) - Slack tokens (
xox*) - Private keys (
-----BEGIN ... PRIVATE KEY-----) - Database URLs with embedded credentials (
postgres://user:pass@host) - JWT secrets, session secrets, encryption keys
- Sentry DSN, Datadog API key
- Generic hardcoded passwords, secrets, tokens
check_gitignore_coverage
Checks whether sensitive files (.env, .env.local, secrets.json, private keys, certificates) are covered by .gitignore. Flags files that could be accidentally committed.
scan_for_log_leaks
Scans source files for console.log / logger calls that print process.env variables or objects with secret-sounding names at runtime. Catches the most common "it's just a debug line" mistakes.
🧪 What it looks like in practice
A realistic .env with 20 secrets — database URLs, AWS, Stripe, Twilio, SendGrid, Google OAuth, Sentry, JWT secrets, encryption keys. Before this MCP: an AI agent reads the file, has no idea what's sensitive, and proceeds to use those values in generated code or responses.
After one scan_for_secrets call: 16 findings, all categorized by severity, all previews masked. The agent knows exactly what's dangerous before it touches anything.
⚡ Setup
🚀 Usage
"Scan this project for any secrets or API keys that might be exposed. Check if .env files are in .gitignore, and look for any console.log calls that might be leaking credentials."
The agent runs all three tools in sequence and reports a full picture: what's hardcoded, what's not protected, what's being logged.
Works great alongside:
- tsconfig-inheritance-flattener-mcp — for TypeScript config analysis
- release-readiness-triage-mcp — for CI triage before release
- ast-impact-mapper-mcp — for code→test correlation
📦 Links
- npm: npmjs.com/package/env-secret-exposure-analyzer-mcp
- GitHub: github.com/vola-trebla/env-secret-exposure-analyzer-mcp
License
MIT
來源:README.md,提交 5c1970f
工具
0版本歷史
1- v0.2.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分