
Redact MCP
io.github.r3352Published by GitHub account r3352v2.0.4Updated Oct 24, 2026
Auto-detects and obfuscates PII (IPs, emails, API keys, names) so Claude never sees real client data
Overview
Locally obfuscates PII and secrets in text, files, and HTTP responses so an assistant only ever sees fake replacement values.
- What you can do
- Detects sensitive data with 19 regex pattern types plus an AI NER model, covering IPs, hostnames, emails, API keys, tokens, private keys, connection strings, card numbers, addresses, and person, organization, and location names. Each unique value gets a deterministic fake replacement held in a bidirectional mapping table, so obfuscation can be reversed losslessly. Eight tools include obfuscate, deobfuscate, file read with obfuscation, mapping add/remove/show, audit log viewing, and an HTTP proxy that deobfuscates a request, makes the real call, and obfuscates the response.
- When to use it
- Useful when an assistant needs to analyze sensitive material, such as penetration test data or client records, without exposing the real values to the model or a third party. Also fits workflows where a final report must be restored to real values before delivery.
- Requirements
- Runs locally over stdio, typically launched with npx from the npm package. Node.js is required. The NER model (about 110MB) downloads on first use and is cached; without it the server falls back to regex-only mode. Optional environment variables: REDACT_DATA_DIR for mapping and audit storage, REDACT_AUDIT_LOG to enable JSONL logging. No authentication is declared.
Installation
In SourceWeft
- Open Redact MCP in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
Redact MCP — Automatic PII Obfuscation for Claude Code
An MCP server (and Claude Code plugin) that automatically detects and obfuscates sensitive data before Claude ever sees it. Uses regex pattern matching and AI-powered Named Entity Recognition (NER) to catch IPs, hostnames, emails, API keys, person names, organization names, locations, private keys, connection strings, and more.
Built for penetration testers who need Claude's analysis capabilities without exposing client data to a third party.
How It Works
The server maintains a bidirectional mapping table. Every sensitive value gets a consistent, deterministic fake replacement that persists across the entire session:
Same real value always maps to the same fake value. obfuscate(text) -> deobfuscate(result) === text is guaranteed.
Install
Quick install via npx (recommended)
That's it. Claude Code will launch the server via npx on each session. The NER model (~110MB) downloads automatically on first use and is cached for subsequent runs.
To enable audit logging:
As a Claude Code plugin (full features: hooks + skills)
The plugin mode adds hooks (automatic leak detection on raw tool output) and skills (/redact:status, /redact:add, /redact:export) on top of the MCP server.
Manual MCP configuration
Add to your Claude Code MCP config (~/.claude/mcp.json or project .mcp.json):
Environment Variables
What Gets Detected
Regex Patterns (19 types)
Zero configuration required. Detected automatically:
NER Detection (AI-powered)
When @huggingface/transformers is installed (included by default), the server loads Xenova/bert-base-NER (~110MB ONNX model, downloaded on first use) to detect:
NER catches entities that regex misses — names and organizations outside of JSON context, arbitrary location names, etc. Regex results always take priority when both detect the same span (regex is more precise for structured patterns).
Graceful fallback: If the model fails to load or the package is missing, the server continues in regex-only mode with no errors.
Smart Passthrough
These values are never obfuscated:
- Loopback/reserved:
localhost,127.0.0.1,::1,0.0.0.0 - RFC documentation ranges:
192.0.2.x(TEST-NET-1),198.51.100.x(TEST-NET-2),203.0.113.x(TEST-NET-3),2001:db8::(IPv6 docs) - Example domains:
example.com,example.org,example.net - Dev domains:
github.com,npmjs.com,nodejs.org,googleapis.com, etc. - Security testing:
burpcollaborator.net,oastify.com - Code patterns:
console.log,process.env,package.json,webpack.config,jest.config,tailwind.config, and 30+ other common false positives - Broadcast MACs:
FF:FF:FF:FF:FF:FF,00:00:00:00:00:00
MCP Tools
The server registers 8 tools via MCP:
redact_proxy_request — The Key Tool
For pentest workflows, this is the critical tool. Claude calls it instead of curl/fetch:
- Claude provides URL/headers/body (may contain already-obfuscated values)
- Server deobfuscates the request (restores real hostnames/IPs/tokens)
- Makes the real HTTP request to the target
- Obfuscates the entire response (headers + body)
- Returns sanitized response to Claude
Claude never sees the real response data. All deobfuscation and obfuscation steps are audit-logged.
redact_audit_log — Compliance Audit Trail
When REDACT_AUDIT_LOG=true, every obfuscation and deobfuscation operation is logged to ${REDACT_DATA_DIR}/audit.jsonl. Each entry records:
- Timestamp and operation type (
obfuscate,deobfuscate,proxy_request,file_read) - Full input text (raw data before transformation)
- All detections with type, real value, fake replacement, and source (
regexorner) - Full output text (transformed result)
This provides a complete audit trail: what went in, what was modified, and what came out.
View entries via the redact_audit_log tool or read audit.jsonl directly:
Security note: The audit log contains real sensitive data by design (that's its purpose — proving what was redacted). Protect it accordingly.
Skills (Slash Commands)
Hooks
The plugin uses two hooks (automatic, no user interaction):
- SessionStart — Injects instructions telling Claude to route all data through redact tools
- PostToolUse — Warns if Claude uses raw
Bash/Read/Grep/WebFetchand the output contains known sensitive values (leak detection)
How the Pipeline Works
Detection
- Regex pass — 19 pattern types scanned synchronously via compiled RegExp
- NER pass —
Xenova/bert-base-NERruns in parallel (async), catches person/org/location entities - Merge — Results combined; regex matches win on overlapping spans (more precise for structured data)
- Deduplication — Overlapping NER results that cover the same span as a regex match are dropped
Mapping
- Each unique real value gets a deterministic fake via counter-based generation
- Fake values use safe ranges: TEST-NET-2 for IPv4, RFC 3849 for IPv6,
example.comfor domains,555prefix for phones, locally-administered range for MACs - Mappings persist to
${REDACT_DATA_DIR}/mappings.jsonwith debounced writes (500ms) - Longest-first replacement prevents partial match corruption (e.g.,
10.50.1.100before10.50.1.10)
Round-trip Guarantee
deobfuscate(obfuscate(text)) === text for all inputs. The bidirectional mapping table ensures lossless restoration.
Architecture
Runtime Flow
Development
Changelog
v2.0.0
- NER detection — AI-powered entity recognition via
@huggingface/transformers+Xenova/bert-base-NER. Catches person names, organizations, and locations outside structured JSON context. - Audit logging — Opt-in JSONL audit trail (
REDACT_AUDIT_LOG=true) records full input/output text, all detections with sources, and timestamps for every obfuscation and deobfuscation operation. - 7 new pattern types —
organization,location,private_key,connection_string,generic_secret,mac_address,street_address - 8th tool —
redact_audit_logfor viewing audit entries - Improved phone detection — International format support (
+CC-XXXX-XXXX) - Expanded false positive list —
webpack.config,jest.config,tailwind.config, and 9 other config file patterns
v1.0.0
- Initial release with regex-only detection (12 pattern types), 7 MCP tools, bidirectional mapping, persistence, hooks, and skills.
License
MIT
Source: README.md at commit 36b0fe8
Tools
0Version history
1- v2.0.4LatestSep 16, 2026
Score
40% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Declare a license in the repository or the registry entry.