Context-aware secret scanner: lets an AI agent scan, verify, and rewrite secrets before committing.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
MCP-native secret scanner β verified findings, agent-applied rewrites.
leakferret is one fast Rust binary that is engine, CLI, and MCP server. It finds hardcoded secrets in your code, calls the provider to confirm which ones are actually live, and rewrites the leak in place to read from an environment variable. It runs in your terminal, in CI, and as a tool your coding agent calls before it commits β and the raw secret never leaves your machine.
Say you accidentally commit a real key, plus the usual noise:
leakferret verify calls each provider and tells you what is real and live β
and stays quiet on the rest:
The keys above are fabricated, so the VERIFIED line illustrates what a
genuinely live key reports β on these examples both would be UNKNOWN.
The ${SENDGRID_API_KEY} reference, the changeme placeholder, and the
well-known AKIAIOSFODNN7EXAMPLE example are recognized and left out β that
precision is the point. Then leakferret rewrite --apply rewrites the
hardcoded key in your code (it leaves .env files alone β there's nothing
sensible to rewrite a secret to there):
β¦and appends STRIPE_API_KEY= to .env.example with a seed command for your
secret manager. Find β confirm live β fix, with almost no false alarms.
The full secret value never leaves your machine. Only a redacted
AKIA...4XYZpreview is ever written to a report, log, or network message.
Install however you like β every package ships the same prebuilt binary.
Then scan the current directory:
scan respects .gitignore and also reads dotfiles such as .env. Add
--git to walk commit history instead of the working tree.
Every wrapper honors a
LEAKFERRET_BINenvironment variable pointing at a local binary, for offline or development use.
leakferret runs findings through a five-station pipeline. Each station only sees what it needs, and the raw secret never advances past disk.
.gitignore, reads dotfiles like .env, and (with
--git) walks history.AKIAIOSFODNN7EXAMPLE, jwt.io samples, RFC examples. Matches are marked
FIXTURE so documented examples never raise a false alarm. The catalog is
bundled with the binary and can be refreshed and signature-verified.ENV.fetch / os.environ / process.env), appends a line to
.env.example, and prints seed commands for your secret manager (env,
Vault, Doppler, AWS Secrets Manager, or Infisical).A baseline stores one-way HMAC fingerprints of known findings β never the raw secret β so CI can fail only on new leaks.
MCP (Model Context Protocol) is the open standard for giving coding agents tools. Agents hardcode secrets too, and nobody reviews their diffs line by line β leakferret lets the agent self-check before it commits.
Start the server over JSON-RPC on stdio:
Add it to your mcpServers config (Claude Desktop, Cursor, Continue,
Claude Code):
For Claude Code, save that block as .mcp.json in your project root, or add
it with one command:
If you installed the native binary, you can point at it directly instead:
leakferret is also listed in the MCP Registry
as io.github.leakferrethq/leakferret, so registry-aware clients can discover it.
Tools exposed: scan_repository, classify_candidates, verify_finding,
propose_rewrite, and baseline_diff. A classify prompt is also provided so
an agent can classify candidates inline using the model it already has. Two
read-only resources expose the engine's catalog as context: leakferret://secret-types
(every detectable pattern) and leakferret://verifiers (the live-verification providers).
| gitleaks | trufflehog | detect-secrets | GitGuardian | leakferret | |
|---|---|---|---|---|---|
| Live provider verification | β | β | β | β | β |
| In-place env-var rewrite | β | β | β | β | β |
| MCP server for AI agents | β | β | β | β | β |
| Baseline (fail only on new) | β | β | β | β | β |
| SARIF / Code Scanning | β | β | β | β | β |
| Free, local, no account | β | β | β | β | β |
gitleaks is the fastest pre-commit regex blocker. trufflehog set the bar for live verification. detect-secrets owns the baseline-a-legacy-repo workflow. GitGuardian is the paid platform with the broadest detectors and a dashboard. leakferret does the regex pre-filter, verifies which keys are live, rewrites the leak to an env var, and runs as an MCP server so coding agents check their own diffs. Full writeup: leakferret.com/compare.
Scan a whole GitHub account or org in one go (handy for finding leaks across all your public repos before someone else does):
Common flags:
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/leakferret)<a href="https://allmcps.com/mcp/leakferret"><img src="https://allmcps.com/api/badge/leakferret?style=directory" alt="Leakferret on AllMCPs" /></a>