Redact MCP — Claude Code MCP server: what it does, how to install
Replaces sensitive records with deterministic dummy values before an LLM inspects them. Built for security audits on external systems.
claude mcp add --env REDACT_AUDIT_LOG=<REDACT_AUDIT_LOG> --env REDACT_DATA_DIR=<REDACT_DATA_DIR> --transport stdio redact-mcp -- npx -y @mattzam/redact-mcpWhat Redact MCP does
The server scrubs sensitive records using nineteen regex patterns paired with a local Xenova/bert-base-NER model. It detects hostnames, connection strings, and names. If model loading fails, it silently falls back to regular expressions.
Each original value receives a persistent fake substitute across the session via a bidirectional lookup table. Eight MCP tools handle file reading, manual mapping adjustments, and HTTP proxying. The proxy tool dispatches real HTTP calls, sanitizing both headers and payload before the assistant receives the output.
Initial execution downloads an ONNX model file of roughly 110MB. Without network access, entity recognition will not work.
What it helps with
- strip credentials and private keys from model inputs
- mask target IP addresses and customer hostnames
- send sanitized HTTP requests using an outbound proxy tool
- log replacement history into local JSONL files
Example prompts for the agent
- Read
client_scan.logusingredact_read_fileand summarize the open ports. - Query the endpoint through
redact_proxy_requestwithout exposing target tokens. - Display active token replacements via
redact_show_mappings.
How to install Redact MCP
Platform CLI
claude mcp add --env REDACT_AUDIT_LOG=<REDACT_AUDIT_LOG> --env REDACT_DATA_DIR=<REDACT_DATA_DIR> --transport stdio redact-mcp -- npx -y @mattzam/redact-mcpReplace <…> with your own values
Platform CLI
codex mcp add redact-mcp --env REDACT_AUDIT_LOG=<REDACT_AUDIT_LOG> --env REDACT_DATA_DIR=<REDACT_DATA_DIR> -- npx -y @mattzam/redact-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"redact-mcp": {
"command": "npx",
"args": [
"-y",
"@mattzam/redact-mcp"
],
"env": {
"REDACT_AUDIT_LOG": "<REDACT_AUDIT_LOG>",
"REDACT_DATA_DIR": "<REDACT_DATA_DIR>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"redact-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@mattzam/redact-mcp"
],
"env": {
"REDACT_AUDIT_LOG": "<REDACT_AUDIT_LOG>",
"REDACT_DATA_DIR": "<REDACT_DATA_DIR>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e REDACT_AUDIT_LOG=<REDACT_AUDIT_LOG> -e REDACT_DATA_DIR=<REDACT_DATA_DIR> redact-mcp npx -y @mattzam/redact-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Redact MCP
How to install Redact MCP in Claude Code?
Run claude mcp add redact-mcp -- npx -y @mattzam/redact-mcp in your terminal.
What does Redact MCP do?
It intercepts private identifiers and substitutes them with deterministic placeholders. The model receives safe data, while original values remain in a local mapping table.
What happens if the NER model fails to load?
The server switches to regex mode automatically without throwing an error. Regular expressions still catch 19 pattern types, including IPs, emails, and cloud tokens.