secretsweep-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@secretsweep-mcpscan the current directory for credential leaks"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 # or: uvx 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.
Three steps
pip install secretsweep
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 keyRelated MCP server: MegaLinter MCP Server
What 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
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[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[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.
This server cannot be deployed
Maintenance
Related MCP Connectors
Scan configs, files, or text for leaked secrets and obvious misconfigurations. Nothing stored.
Scan text and git diffs for committed credentials using real vendor key formats plus entropy.
Security scanner for MCP servers and skills: Unicode injection, patterns, secrets.
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceGo-based SBOM, vulnerability, and secret scanner with MCP support.3Apache 2.0
- AlicenseBqualityBmaintenanceEnables running MegaLinter linting, configuration, and analysis through MCP tools. Works with any CI/CD platform or locally.15197 npm3MIT
- 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.5794 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.16 npmMIT