# moxno/privacyscrubber-mcp [Health: Active]

**Category:** 🔒 Security  
**Repository:** https://github.com/moxno/privacyscrubber-mcp  
**GitHub Stars:** 3  
**npm Downloads (last month):** 2887  
**Views:** 10  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/moxno-privacyscrubber-mcp

## Description
Zero-trust local PII and secrets masking server for Cursor, Windsurf, and Claude Desktop. npx pii-masking-run

## Tools
Capabilities this server exposes over MCP:

- **audit_context** — STEP 0 (Pre-Flight): Non-destructive security inspection of raw prompts or document chunks before sending to LLMs. Evaluates PII, secrets, risk severity (CLEAN, LOW, MODERATE, CRITICAL), and triggered regulatory frameworks (GDPR, HIPAA, SOC 2, PCI DSS) with zero text mutation.
- **sanitize_text** — STEP 1: Call this first. You MUST NOT process raw user data before calling this. Locally scrubs PII, secrets, and credentials (like API keys, passwords, emails, phones, names) from code, logs, or text. Replaces them with safe placeholders (e.g., [EMAIL_1], [API_KEY_1]). Keep your data secure before passing it to any LLM. (For in-code backend services or RAG vector pipelines outside of MCP, use '@privacyscrubber/sdk': npm i @privacyscrubber/sdk)
- **scrub_text** — Alias for 'sanitize_text'. Locally scrubs PII and secrets before LLM ingestion.
- **reveal_text** — STEP 3: Call this last. You MUST pass your final generated response through this tool to restore tokens (e.g., [EMAIL_1]) back with the original private data from the local volatile RAM-only session map before showing it to the user.
- **sanitize_file** — Reads a local file, sanitizes its contents using the selected profile, and outputs the safe version for AI analysis. Securely keeps original identifiers in memory.
- **scrub_file** — Alias for 'sanitize_file'. Reads and sanitizes a local file.
- **audit_directory_for_pii** — Scans a local directory for leaks of secrets, keys, and PII. Returns a summary report. Use this tool for Security Auditing.
- **redact_file** — Action/Redact: In-place redaction of a local file. Replaces PII and secrets with tokens and saves the file. By default, creates a .bak backup. Use dry_run=true to test without modifying.
- **create_default_config** — Creates a default 'privacyscrubber.json' configuration file in the active workspace root directory if one does not exist. Includes template structures for custom regex rules and exclusion bypass patterns.
- **generate_compliance_report** — Generates an official Zero-Trust Compliance Audit Certificate (GDPR, HIPAA, EU AI Act, SOC 2) for the current MCP session. Returns cryptographic session hash, masked entities breakdown, and compliance certification.
- **mark_false_positive** — Marks a previously detected token as a false positive. The original plaintext value will be excluded from all future sanitize_text calls in this session. Returns the restored original value and updated ignore list size.
- **check_status** — Returns the current PrivacyScrubber MCP tier, session usage, available profiles, and PRO upgrade instructions. Call this to see your license status or get setup help.
- **guard_exec** — Zero-Trust Agentic Guard: Safely executes a shell/terminal command locally in isolated process, sanitizes stdout and stderr in volatile RAM, tokenizes any API keys, credentials, database URIs, or PII before sending output to LLM. Maps original values in memory for safe local restoration.
- **guard_read_file** — Zero-Trust Agentic Guard: Reads a sensitive local file (.env, config, credentials, source code, database dumps), sanitizes all credentials and PII in volatile RAM, and returns safe tokenized content for AI agent context.
- **guard_git_diff** — Zero-Trust Agentic Guard: Inspects unstaged or staged git diffs locally, sanitizes any newly added or modified credentials, tokens, or PII in RAM, and returns safe diff for AI commit generation or code review.
- **guard_apply_patch** — Zero-Trust Agentic Guard: Reverses token placeholders ([API_KEY_1], [SECRET_1]) in AI-generated code or text, restores authentic values from local volatile RAM, and writes real content directly to target file on disk. Remote LLM never learns actual secrets.
- **create_agent_rules** — Zero-Trust Agentic Guard: Scaffolds CISO-grade AI Agent Rules in workspace (.cursorrules, .windsurfrules, CLAUDE.md, .github/copilot-instructions.md, .clinerules). Guides autonomous agents to route all file reads, git diffs, and shell commands through PrivacyScrubber Guard tools.
- **guard_unmask_args** — Zero-Trust Agentic Guard: Detokenizes parameters, JSON objects, or arguments in local RAM before dispatching to local tools or APIs without sending cleartext secrets back to the LLM.
- **guard_session_info** — Zero-Trust Agentic Guard: Returns diagnostic metrics on active in-memory sessions, token counts, and memory footprint with zero plaintext leakage.
- **guard_session_reset** — Zero-Trust Agentic Guard: Explicitly purges the in-memory token map for a specific session_id or all sessions upon agent task completion.
- **guard_rag_chunk** — Zero-Trust Agentic Guard: Sanitizes an array of document chunks or knowledge base records before sending to embedding models or vector databases (Chroma, Pinecone, Qdrant). Keeps authentic data in local RAM with zero network leakage.
- **guard_rag_restore** — Zero-Trust Agentic Guard: Re-hydrates retrieved vector search results or chunks by restoring token placeholders with authentic data from the volatile RAM session before presenting to the user.
- **export_audit_log** — Zero-Trust Enterprise Compliance: Exports an immutable, tamper-evident audit log in SIEM standard formats (CEF / ArcSight, RFC 5424 Syslog, JSONL, or JSON) with zero plaintext PII leakage. Can write directly to a local log file or stream.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "privacyscrubber-mcp": {
    "command": "npx",
    "args": ["-y","@privacyscrubber/mcp-server"]
  }
}
```

## Documentation

## What moxno/privacyscrubber-mcp does

moxno/privacyscrubber-mcp adds a local privacy boundary between MCP clients and remote language models. It detects PII, secrets, credentials, and configurable patterns in prompts, files, command output, source changes, and document chunks. Detected values are replaced with labels such as `[EMAIL_1]` or `[API_KEY_1]`, allowing an agent to process the surrounding content without receiving the original values.

The server also supports inspection and governance workflows. It can classify input as CLEAN, LOW, MODERATE, or CRITICAL, identify applicable frameworks including GDPR, HIPAA, SOC 2, and PCI DSS, scan directories for exposed data, create compliance reports, and export tamper-evident audit logs in CEF, RFC 5424 Syslog, JSONL, or JSON formats.

## How it works

A typical exchange has three stages. First, `audit_context` can inspect raw content without changing it. Next, `sanitize_text`, `sanitize_file`, or a Guard tool replaces sensitive values and retains the mapping in a local volatile-memory session. After the model produces an answer, `reveal_text` can substitute the tokens with their original values before the result is shown locally.

The same token flow applies to agent operations. `guard_exec` sanitizes command output, `guard_read_file` protects sensitive files, and `guard_git_diff` returns a masked diff. `guard_apply_patch` and `guard_unmask_args` restore values locally when writing files or dispatching parameters. RAG-specific tools sanitize chunks before embedding or storage and restore retrieved results for presentation.

## Setup and configuration

Run the server directly with:

```bash
npx -y @privacyscrubber/mcp-server
```

The automatic installer can configure detected clients:

```bash
npx -y @privacyscrubber/mcp-server install --all
```

It also accepts targeted options such as `--cursor`, `--claude`, `--claude-code`, `--vscode`, or `--zed`. Smithery installation is available through:

```bash
npx -y @smithery/cli install @privacyscrubber/mcp-server --write-to-clients
```

A Python-based launch path is available with `uvx privacyscrubber-mcp` or a PyPI installation. `create_default_config` creates `privacyscrubber.json` in the active workspace when that file does not exist; the generated structure includes areas for custom regular-expression rules and exclusion patterns.

## Tools and capabilities

- Inspect text without mutation using `audit_context`.
- Sanitize or restore text with `sanitize_text`, `scrub_text`, and `reveal_text`.
- Mask, scan, or redact files and directories with `sanitize_file`, `scrub_file`, `audit_directory_for_pii`, and `redact_file`.
- Protect shell commands, files, Git diffs, patches, arguments, and agent instruction files through the Guard tools.
- Process RAG chunks and retrieved results with `guard_rag_chunk` and `guard_rag_restore`.
- Create compliance certificates, export audit logs, inspect session status, mark false positives, and reset sessions.
- Check licensing and available profiles with `check_status`.

## Limitations and notes

Token restoration depends on the local volatile-memory session map, so the relevant session must remain available when `reveal_text`, `guard_apply_patch`, or another restoration operation is used. `mark_false_positive` changes future sanitization behavior for the current session by excluding the selected plaintext value. `redact_file` modifies files in place and creates a `.bak` backup by default; `dry_run=true` can be used to test the operation without modifying the file.

For backend services, ETL pipelines, or non-MCP RAG integrations, the project points to the separate `@privacyscrubber/sdk` package rather than these MCP tools.

_Full upstream README: https://allmcps.com/mcp/moxno-privacyscrubber-mcp/readme_

