secretsweep-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
secretsweep
[English] · 简体中文
Zero-dependency credential leak scanner. 86 provider rules, entropy detection, placeholder triage, and baseline diffs that make it usable as a PR gate instead of a one-off report.
pip install secretsweep-audit # or: uvx --from secretsweep-audit secretsweep
secretsweep scan .The leading tools in this space are excellent and written in Go (gitleaks ~30k★, trufflehog ~28k★). The Python slot is served by detect-secrets, which carries dependencies and a plugin architecture. secretsweep is the other shape: one import-free package, deterministic, fast enough to run on every commit.
Contents
Related MCP server: Codna
Three steps
pip install secretsweep-audit
secretsweep demo # 1. see it work on a repo that leaks on purpose
secretsweep scan . # 2. scan your own tree$ secretsweep scan .
src/config.py
CRITICAL 4:17 github-pat ghp_************7g
GitHub personal access token | confidence=likely entropy=5.17
classic personal access token (repo + org scopes possible)
CRITICAL 5:31 postgres-uri R7kQ******Zx
PostgreSQL URI with password | confidence=likely entropy=3.58
HIGH 2:22 aws-access-key-id AKIA************PU
AWS access key id | confidence=likely entropy=4.22
long-lived IAM user keyWhat it does differently
1. It separates real leaks from documented examples
Most false positives are not "strings that look like keys" - they are
documented keys. AKIAIOSFODNN7EXAMPLE matches every AWS regex ever written.
secretsweep scores each candidate:
confidence | meaning | default |
| nothing says it is fake | reported |
| known example value, template reference, repeated/sequential bytes, | hidden ( |
2. It reads the room, not just the string
The same 40 characters mean different things in docs/example.env and in
.github/workflows/deploy.yml. Every finding carries the bucket it was found in
(source, config, ci, test, example, docs, vendor, lockfile) and
the severity is adjusted from there:
tests/fixtures/tokens.json
INFO 2:13 generic-token-assignment R7kQ************7g
Generic token assignment | confidence=likely | bucket=test
bucket:test3. It tells you what the credential can do
Offline inference from the shape of the value - no network calls, nothing leaves the machine:
AKIA…is a long-lived IAM user key;ASIA…is a temporary STS session that expires on its own;AGPA…cannot sign requests at all.ghp_…is a classic token that cannot be scoped to one repo;github_pat_…is fine-grained.sk_live_…moves real money;sk_test_…does not.A JWT is decoded (not verified) to report
alg,sub, andexp- an expired token is downgraded a level because it is not what you rotate first.
4. Baselines: the only way this survives an old repository
secretsweep baseline . # snapshot what is already there
secretsweep scan . --baseline .secretsweep-baseline.jsonFingerprints are path|rule|value-hash, so a baseline survives line drift but a
new secret in a baselined file still fails the build. --prune shrinks the
baseline as leaks get fixed.
Commands
command | what it does |
| scan a file or a tree; |
| write a baseline so only new leaks fail CI |
| show new / resolved without writing anything |
| list the 86 rules and their entropy gates |
| explain one string: length, charset, bits/char |
| write a leaky repo and scan it |
Exit codes: 0 clean, 1 findings at or above --fail-on (default high),
2 usage error.
Useful scan flags: --min-severity, --entropy-min (raise every gate),
--tag, --exclude-rule, --ignore-glob, --skip-dir, --show-placeholders,
--no-inline-ignore, --no-evidence.
Inline suppressions
TOKEN = "ghp_..." # secretsweep:ignore
KEY = "AKIA..." # secretsweep:ignore[aws-access-key-id].secretsweepignore
gitignore-style globs, read from the scan root:
# the rule library carries one sample per rule - fixtures, not leaks
src/secretsweep/samples.py
tests/**CI
- name: secret scan
run: |
pip install secretsweep-audit
secretsweep scan . --baseline .secretsweep-baseline.json --sarif secrets.sarif.json
- uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: secrets.sarif.jsonSARIF 2.1.0 output includes security-severity, so findings land in code
scanning with the right ranking.
GitHub Action
- uses: xuange-hu/secretsweep@v1
with:
path: .
fail-on: high
baseline: .secretsweep-baseline.json # optional
sarif: secrets.sarif.json # optionalThe action installs nothing: it runs the checked-out Python source with the runner's interpreter. A credential scanner that pulled a dependency tree into your CI would be working against its own purpose.
input | default | purpose |
|
| file or directory to scan |
|
|
|
| — | only fail on findings absent from the baseline |
| — | write SARIF 2.1.0 for code scanning upload |
|
| hide findings below this level |
| — | comma separated rule selection |
|
| scan |
| — | any CLI flag, passed through verbatim |
Outputs: findings, max-severity, files-scanned, exit-code, report,
sarif. The report is also written to the job summary, capped at 64 KB so a
noisy run cannot drown the log.
- uses: xuange-hu/secretsweep@v1
id: sweep
continue-on-error: true
with:
path: .
- name: Upload
if: always()
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.sweep.outputs.sarif }}action-test.yml runs the action against a tree that leaks on purpose and
asserts that it fails, so a regression in the action breaks CI here rather than
in your workflow.
MCP server
pip install "secretsweep-audit[mcp]"
secretsweep-mcptool | purpose |
| scan a path; summary + masked findings |
| scan a pasted snippet, log line, or diff |
| build a baseline document |
| diff a scan against a baseline |
| list rules and their gates |
| is this string random-looking? |
| SARIF for dashboards |
| scan the built-in demo repo |
Claude Code / Cursor / Cline config:
{
"mcpServers": {
"secretsweep": {
"command": "uvx",
"args": ["--from", "secretsweep-audit[mcp]", "secretsweep-mcp"]
}
}
}Pinned to mcp>=1.2,<2 on purpose: 2.x renames FastMCP to MCPServer.
Zero dependencies
The runtime package imports nothing outside the standard library. mcp is an
optional extra and is the only entry in it.
module | responsibility |
| 86 rules with entropy gates and validators |
| Shannon entropy, charset classification, token windowing |
| real / likely / placeholder triage |
| path bucketing and severity adjustment |
| offline inference: what can this credential do |
| the pipeline, overlap resolution, dedupe |
| fingerprint baselines and diffs |
|
|
|
|
| SARIF 2.1.0 |
| text and JSON rendering |
| one trigger sample per rule |
| GitHub Action entrypoint (reuses the CLI parser, no deps) |
Coverage
86 rules across cloud (AWS/GCP/Azure), git hosting, package registries, chat, payments, LLM providers, observability, SaaS, databases, and key material - plus entropy-gated generic assignments.
Connection URIs: postgres, mysql, mongodb, redis, amqp, basic-auth URLs.
Key material: PEM blocks, inline SSH keys, JWTs, Kubernetes service account tokens.
History:
secretsweep scan --historywalksgit log -p.
Scope
Secret detection - finding credentials that are already sitting in a tree so they can be rotated. It never calls out to a provider, never verifies a credential, and does nothing about bypassing access controls.
License
MIT. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Scan configs, files, or text for leaked secrets and obvious misconfigurations. Nothing stored.
Static MCP server scan: injection, secrets, tool poisoning. SARIF + rules catalog.
Scan text and git diffs for committed credentials using real vendor key formats plus entropy.
IaC, CI and dependency security review for coding agents: local scan CLI plus hosted OAuth MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceGo-based SBOM, vulnerability, and secret scanner with MCP support.3Apache 2.0
- AlicenseAqualityBmaintenanceOfficial Codna MCP server with Mojo-powered risk simulation. Maps repos with zero LLM tokens. 5 stdio tools: triage, root-cause analysis and fix plans (optional PRs), SARIF reachability proof, on-device code memory and bug reporting. Introspection needs no credentials; execution requires a one-time free codna login. Source: cli/codna/mcp_server.py. Registry: io.github.thyn-ai/codna.5624 PyPIApache 2.0

yotta-dev-mcpofficial
AlicenseNot gradedqualityBmaintenanceProvides deterministic local development tools over stdio MCP, including repository mapping, code review, secret and dependency scanning, release checks, whitelisted checks, scaffolding, and workflow state tracking.29 npmMIT- AlicenseNot gradedqualityBmaintenanceRead-only MCP server that exposes the scan_text and scan_paths tools so AI coding agents can scan text, files, staged Git changes, local history and archives for secrets entirely offline, returning redacted findings with rules, positions and fingerprints and flagging incomplete scans. Results can be emitted as JSON, JSONL or SARIF without ever serializing raw secret values or source snippets.Apache 2.0