
Secret Scanner
io.github.4hmetuyar由 GitHub 账号 4hmetuyar 发布v0.2.10更新于 Oct 24, 2026
Scans files for leaked secrets and API keys
概览
本地 MCP 服务器,扫描文件、目录、Git 历史与编码代理会话记录,查找泄露的 API 密钥、令牌和密码,结果部分脱敏。
- 可以做什么
- 扫描文本、单个文件或整个目录树中的密钥
- 扫描 Git 仓库:暂存改动或历史提交中新增的每一行
- 扫描本机编码代理的会话记录(Claude Code、Codex、Gemini CLI、Continue)
- 列出当前启用的密钥规则(76 条服务商规则及高熵值检测)
- 以部分脱敏方式报告命中项,并给出严重级别与可选的基线过滤
- 适用场景
- 适合让助手检查项目、.env 文件或粘贴的代码片段是否泄露凭据,也适合审计 Git 历史与代理会话日志中曾被提交或粘贴到对话里的密钥。
- 运行要求
- 以本地 stdio 进程运行,来自 npm 包 @guardbee/mcp-secret-scanner(需要 Node.js,通常用 npx 启动)。未声明账号、API 密钥或请求头。可选遥测由环境变量 GUARDBEE_TELEMETRY 控制。
安装
在 SourceWeft 中
- 打开 控制台中的 Secret Scanner,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
@guardbee/mcp-secret-scanner
🇬🇧 English | 🇹🇷 Türkçe | 🇨🇳 中文 | 🇯🇵 日本語 | 🇰🇷 한국어 | 🇧🇷 Português | 🇪🇸 Español | 🇩🇪 Deutsch
[npm version] [npm downloads] [License: MIT]
An MCP server that scans your source files, directories, and environment configs for exposed API keys, passwords, tokens, and other secrets. Ask Claude directly whether your project is leaking secrets.
Telemetry is off by default. With
GUARDBEE_TELEMETRY=1it sends the server, tool, success, duration and short parameter values such as a file path; longer strings and fields likecontent,tokenorpasswordare replaced with a placeholder. See@guardbee/mcp-telemetry.
Features
- 76 Secret Patterns — AWS, Azure, GCP, GitHub, GitLab, Stripe, OpenAI, Anthropic, OpenRouter, Groq, Hugging Face, Slack, Twilio, SendGrid, DigitalOcean, Cloudflare, Supabase, Vault, PyPI, Shopify, Linear, Notion, Atlassian and more — plus the Turkish providers iyzico, PayTR, Netgsm and İleti Merkezi, matched on their variable names since their keys have no prefix. The rules live in
@guardbee/guard-core, so@guardbee/mcp-security-proxymasks the same formats in tool results at runtime - File & Directory Scanning — a single file or an entire project tree
- Git History & Staged Scanning —
--historyscans every line any commit added, so a key deleted from the files but still in the repository is found, reported once at the commit that added it (with author and date);--stagedscans only what you are about to commit - Baseline —
--write-baselinerecords today's findings as hashes (never the secrets, safe to commit);--baselinethen reports only new ones, so an existing repo can adopt the scanner in CI without fixing everything first. SARIF results carry a stablepartialFingerprintsvalue - High-Entropy Values — a random-looking value assigned to a secret-like name (
WEBHOOK_SIGNING_SECRET=…in.env,client_secret:in YAML,"internalApiKey"in JSON) is reported even when no provider rule knows its format. Randomness is measured as Shannon entropy (hex values need 32+ characters; values without digits need more bits, so a camel-case passphrase does not count);public/publishable,*_hash,*_idand*_urlnames, placeholders and${VAR}references are left alone, and a value a provider rule already reported is not reported twice. Medium severity, low in test files;--no-entropy(orentropy: falsein the MCP tools) turns it off - Agent Transcripts —
scan --agent-history(MCP:scan_agent_history) scans what coding agents keep on your machine: Claude Code (~/.claude/projects,~/.claude.json), Codex (~/.codex), Gemini CLI (~/.gemini/tmp) and Continue (~/.continue/sessions). A key pasted into a chat or printed by a command the agent ran stays there — and was already sent to the model provider, so rotate it. Each secret is reported once per agent with how often it appears; the entropy check is off here unless--entropy, since transcripts are full of code the agent read - Large Line Files —
.jsonl,.ndjson,.ipynband.logfiles over 1 MB (transcripts, notebooks with outputs, logs) are read line by line instead of being skipped - Live Verification (CLI only) —
--verifyasks each provider whether a found key still works, through a read-only identity endpoint (GitHub/user, OpenAI/models, Slackauth.test, …): GitHub, GitLab, OpenAI, Anthropic, Slack, Stripe, Hugging Face, npm, SendGrid, Groq, OpenRouter and DigitalOcean. Each key goes only to its own provider, once, and never appears in the output; findings are markedlive/invalid/unknownand live ones are listed first.--fail-on=livefails CI only for keys that still work. The MCP tools never verify, so an agent cannot send your secrets anywhere on its own - Smart Skipping — directories like
node_modules,.git,dist,build,.nextare skipped automatically - Safe Redaction — matches are shown as first 4 + stars + last 4 characters
- Allowlist Support — allowlist known test/fake values
- 71 Unit Tests — 100% passing test suite
Quick Start
Add to claude_desktop_config.json:
MCP Tools
Example Usage
You can ask Claude:
"Scan my project for secrets:
/Users/me/my-app"
"Are there any secrets in this
.envfile?"
"Is this text safe:
export API_KEY=sk-abc123..."
Detected Secret Types
Security Note
This tool partially redacts matched values in scan results (e.g. sk_live_abc1...xyz9). Full values are never logged or exported.
CLI — CI/CD Integration
In addition to MCP server mode, this can also be used directly as a CLI:
Exit codes: 0 = no secrets found · 1 = secrets found · 2 = error
GitHub Actions
GitLab CI
Pre-commit Hook
Development
License
MIT — GuardBee
Feedback
Questions, ideas, or a false positive? Start a thread in GitHub Discussions or open an issue. If GuardBee is useful to you, a ⭐ on the repository helps others find it.
来源:packages/secret-scanner/README.md,提交 ae591f4
工具
0版本历史
3- v0.2.10最新Oct 2, 2026
- v0.2.9Sep 30, 2026
- v0.2.7Sep 29, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
