This is a lightweight secret scanner that runs as an MCP stdio server, exposing three tools: scan inline text, scan a single file, or scan an entire directory recursively. It detects 32+ credential patterns including AWS keys, GitHub tokens, Stripe secrets, OpenAI and Anthropic API keys, private PEM blocks, and Ethereum wallet keys. Every match gets redacted before returning to the LLM, so your agent gets a risk score and line numbers without leaking the actual secret downstream. It's a 500-line Python file with zero dependencies, purpose-built for agent-driven code review, pre-commit checks, or auditing repos before you clone them into your shell. Ships alongside a sister project for behavioral malware patterns if you want full static coverage.
MCP server that detects leaked credentials in source code. Zero dependencies. Single file.
Detects API keys, OAuth tokens, private keys, webhooks, and crypto wallet secrets across 30+ providers (AWS, GCP, GitHub, Stripe, OpenAI, Anthropic, Slack, Discord, Telegram, Twilio, SendGrid, Heroku, DigitalOcean, npm, HuggingFace, Replicate, Cloudflare, and more).
Companion to skill-audit-mcp (behavioral patterns) — together they cover secrets + behaviors in one MCP toolchain.
Most secret scanners are giant Go binaries (trufflehog, gitleaks). This is
a 500-line Python file that runs as an MCP stdio server, so any LLM agent
(Claude Desktop, Cursor, Windsurf, Cline) can ask it scan_directory and
get a structured report in their tool-call response.
Use cases:
# Python (recommended)
git clone https://github.com/eltociear/secrets-audit-mcp.git
python3 secrets-audit-mcp/server.py # stdio MCP server
# Or via npm wrapper (TBD)
npm install -g @eltociear/secrets-audit-mcp
{
"mcpServers": {
"secrets-audit": {
"type": "stdio",
"command": "python3",
"args": ["/path/to/secrets-audit-mcp/server.py"]
}
}
}
| Tool | Use case |
|---|---|
scan | Scan inline text/content |
scan_file | Scan a single file |
scan_directory | Scan a directory recursively (skips .git, node_modules, __pycache__, etc.) |
All return a risk score (0-100), severity bucket (CRITICAL/HIGH/MEDIUM/LOW/SAFE),
and per-finding details with line numbers and redacted matches.
Providers (32 rules total):
apikey="..." heuristic, generic secret assignmentsEach match is redacted (AKIA***MPLE) before being returned, so the report
itself doesn't leak the secret to the next LLM hop.
- name: Secrets audit
run: |
python3 server.py <<EOF | jq -r '.result.content[0].text'
{"jsonrpc":"2.0","id":1,"method":"tools/call",
"params":{"name":"scan_directory","arguments":{"path":"."}}}
EOF
A first-class GitHub Action will ship as eltociear/secrets-audit-action@v1.
skill-audit-mcp covers behavioral malware patterns (download-and-execute, prompt injection, credential exfiltration). Run both for full coverage:
| Layer | Tool | Detects |
|---|---|---|
| Static behaviors | skill-audit-mcp | curl-pipe-sh, exfiltration, prompt injection (68 patterns) |
| Static secrets | secrets-audit-mcp | leaked keys/tokens/PEMs (32 rules) |
Polar.sh — Security Pulse Monthly ships a monthly briefing on new MCP server vulnerabilities, secrets-audit-mcp rule updates, and mitigation playbooks. $5/mo.
Polar.sh — Pro Audit Stack adds 50 paid scan credits + Discord + custom rule submission. $20/mo.
MIT. See LICENSE.
This MCP server is free. For server-side / batch / no-install use, the same scanner is a pay-per-call x402 HTTP API: POST https://eltociear-secrets-audit.hf.space/audit ($0.01 USDC on Base) and /audit/url ($0.03). In the official MCP Registry as io.github.eltociear/secrets-audit-mcp.
silenceper/mcp-k8s
azure/containerization-assist
io.github.evozim/aws-builder
reza-gholizade/k8s-mcp-server
flux159/mcp-server-kubernetes