mcp-secret-scrub
mcp-name: io.github.sudo-ai-git/mcp-secret-scrub
Deterministic, no-LLM MCP server that scrubs secrets from text, logs, and transcripts before they enter agent context — and never leaks the value.
No LLM. No network. Pure structural detection. MIT. Crown-jewel-free.
The problem it solves
Before you hand raw text to an agent (or store it, or pass it to a tool), you
often don't know whether it contains a live secret. Platform scrubbers miss
patterns all the time — a private key, an nvapi- token, a github_pat_
token, an api_key= assignment mid-log. If that text reaches an LLM context
or a persisted transcript, the secret is effectively exfiltrated.
This server answers, deterministically:
Which secrets are in this text, and can you redact them safely before it goes anywhere?
Detection coverage (deterministic profiles)
| family | examples |
|---|---|
| AI provider keys | sk-proj-…, sk-ant-api…, sk-or-v1-…, sk-…, nvapi-… |
| Cloud / GitHub | AKIA…, aws_secret_access_key=, ghp_…, gho_…, ghu_…, ghs_…, ghr_…, github_pat_… |
| Identity / auth | JWTs (eyJ…), PEM private keys, Bearer …, Basic …, OAuth client secrets |
| Assignments | api_key=, token=, secret=, password=, client_secret=, webhook_secret= |
| Endpoints / DSNs | Discord webhooks, Slack xox…, SQL/Redis/Mongo/AMQP connection strings |
The scan never returns the secret value — only its type, count, and position. That is a hard safety contract, enforced by test.
Tools (MCP)
| tool | purpose |
|---|---|
scrub_text(text, mode, keep_label) |
redact / mask / hash secrets; returns scrubbed text (never the value) |
scan_text(text) |
detect which secret types are present (no mutation) |
report_full(text) |
scan + redact in one call, scrubbed preview + findings |
secret_profiles() |
list all supported detection profiles |
Modes:
redact(default) →[REDACTED:TYPE]mask→ shows first 4 + last 2 charshash→ deterministic SHA-256 prefix (reproducible across calls)
Quick start (stdio)
pip install mcp-secret-scrub
mcp-secret-scrub # stdio (default)
Or via uv/pipx for an installable console entry:
pipx install mcp-secret-scrub
MCP client config:
{ "mcpServers": {
"secret-scrub": { "command": "mcp-secret-scrub" }
}}
Streamable HTTP (remote / Smithery-publishable)
python3 mcp_server.py --http --port 8138 # serves on http://<host>:8138/mcp/
Determinism & safety guarantees
- Deterministic: same input → identical output in every mode, every call.
- Never leaks:
scan_textandscrub_textnever emit the original token;_deterministic_hashis SHA-256 (no salt) so output is reproducible. - No LLM, no network: pure regex + reachable structure detection.
- Input-safe: non-string input returns a clean error, not a traceback.
Verification
python3 test_detector.py— 14/14 core checks (detection, redaction, determinism, no-leak contract, benign/unicode/empty input, bad-mode)python3 test_e2e.py— drives the real MCP stdio transport and asserts the secret does NOT cross the wire
License & provenance
MIT. Part of the sudo-ai-git deterministic no-LLM agent-trust MCP family
(mcp-skill-sec · mcp-verify-claim · mcp-benchmark-hygiene ·
mcp-secret-scrub).
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_secret_scrub-1.0.0.tar.gz.
File metadata
- Download URL: mcp_secret_scrub-1.0.0.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24508d3d1c55b52891255d94e22de134169bd6b364f8dcedf0b5f1867a4f5170
|
|
| MD5 |
c54c30eaf70ed91deedc136bc5048cf7
|
|
| BLAKE2b-256 |
b4aaa3c27509ea751037bc4cd22d20e94eb2383978b0b111bb273da9bc0dc87a
|
File details
Details for the file mcp_secret_scrub-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mcp_secret_scrub-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23c16cc0e9469ac758389a0affcd7b5b2da4a6b135e4bb9b0990fe81c657585a
|
|
| MD5 |
3d1875a51b08a5482dd93711ea5fbc76
|
|
| BLAKE2b-256 |
287b5dba1dec21340d9d874b86f667a162ba487862e2ae27eafde63310a8f07a
|