Local AI Security

Zero-Trust Local PII MCP Server

Stop sending sensitive corporate databases and API keys to the cloud. Deploy a local PII MCP server that automatically masks data "on the fly" directly on your developers' machines before the data ever reaches Claude Desktop, Cursor, or Antigravity. Full compliance with zero data leaks.

Enterprise DLP: Your Code Never Touches Our Network

PrivacyScrubber MCP is built from the ground up for zero-friction developer integration and absolute enterprise compliance.

Auto-Profile Switching

The PII MCP reads all 22 custom profiles from tool schemas. Based on your prompt (e.g. database query, medical log), it automatically applies the correct specialized ruleset.

Custom Local Rules

Declare proprietary database ID structures, custom ticket patterns, and internal company naming formats in a local privacyscrubber.json config file.

Offline Validation

License verification is performed 100% locally using RSA signatures. Trial expirations are verified locally against your system clock. Zero data is sent to external APIs.

IDE & SDK Ready

Connects out of the box with Claude Desktop, Cursor IDE, Windsurf, or custom developer pipelines like the Antigravity SDK using a single-line command.

TEAMSENTERPRISE

Automated Directory Audits & Action/Redact

Don't just detect leaks — fix them. With the Action/Redact tool, your AI agent can physically rewrite files on your local disk, replacing API keys and PII with safe tokens ([EMAIL_1]) while automatically generating .bak backups. Requires a TEAMS or ENTERPRISE subscription for cryptographic rule synchronization across your organization.

Deep Dive

The Action/Redact Tool

Don't just mask data in transit. Empower your local AI agent to physically rewrite files, remove secrets, and generate safe backups directly on your disk.

How to Trigger in Cursor / Claude

Because the PII MCP server natively registers the redact_file and audit_directory_for_pii tools, triggering an automated scrub is as simple as asking your AI assistant in plain English.

  • Zero Configuration: The LLM understands the schema automatically.
  • Safe Execution: Original files are preserved with a .bak extension.
  • 100% Local: The actual redaction happens on your CPU via the PrivacyScrubber regex engine.
"Audit my `./config/` directory and redact any hardcoded AWS keys or database passwords."
Tool Used: audit_directory_for_pii
Found 3 files with secrets. Replaced with [SECRET_KEY_1]. Original files backed up as .bak.

Role-Based Use Cases

DevOps / SRE

Scrubbing Terraform .tf files or CI/CD pipelines of hardcoded AWS, GCP, and Stripe API keys before pushing to a shared repository.

Data Science

Anonymizing raw .csv and .jsonl datasets containing PII before running them through Jupyter Notebooks or Claude Data Analysis.

QA Engineering

Sanitizing production database dumps (.sql) to instantly generate safe, realistic staging environments for testing without exposing real user data.

Security / CISO

Executing automated nightly sweeps across monolithic codebases to catch and redact secrets accidentally committed by junior developers.

Industry-Specific Applications

HIPAA Compliance

Healthcare

Stripping PHI (Patient Names, SSNs, Medical IDs) from clinical trial datasets locally before using an LLM to summarize the trial results or extract insights.

PCI-DSS Standard

Finance

Redacting credit card numbers, SWIFT codes, and IBANs from transaction logs before asking Cursor to write a custom parser for those logs.

Client Confidentiality

LegalTech

Masking client names, addresses, and case numbers in legal briefs before uploading them to an AI contract analyzer for summarization.

How It Works: Zero-Trust Local Processing

The PrivacyScrubber PII MCP server acts as a local security gateway between your IDE (Cursor, Claude, Windsurf) and external LLM endpoints.

1

Local Interception

Your prompt, file attachments, or codebase files are intercepted on your machine before they are sent to the AI.

2

Zero-Trust Masking

Identified PII and secrets are instantly replaced with tokens like [EMAIL_1]. The original data remains strictly inside your local RAM.

3

Sanitized Inference

The remote LLM processes only secure tokens. There is zero risk of downstream data retention or training on proprietary info.

4

Interactive Reveal

When the AI responds using placeholders, the MCP server automatically swaps tokens back to their original values inside the IDE.

Secure Workspace Integration

DevSecOps Directory Audit Engine

The same core engine that powers the PrivacyScrubber PII MCP server is natively embedded into our Web Dashboard. Perform 100% offline, zero-server repository scans directly from your browser to proactively detect hardcoded API keys before they leak to AI tools.

  • Secret & IP Detection: Hardcoded rules catch AWS Credentials (AKIA...), JSON Web Tokens (JWT), Cryptographic Private Keys, and Intellectual Property leaks (e.g. Proprietary/Trade Secret headers) in your source code.
  • Zero-Trust Architecture: Using the modern File System Access API, your repository files are read directly into browser memory. No data is ever uploaded to a server.
  • Actionable Audit Reports: Generate instant security summaries showing exactly which files contain leaked secrets before you commit code or grant AI workspace access.
Audit Results Preview
src/config/.env.local1 Leak
AWS Credentials Detected
api/middleware/auth.ts2 Leaks
JSON Web Token (JWT) Detected

PII MCP Server — Model Context Protocol Tool Reference

These tools are automatically declared to your AI client (Cursor, Windsurf, Claude) upon starting the PrivacyScrubber server.

Tool NameParametersFunction & DescriptionTier
sanitize_texttext: string,
profile?: string
Scrubs PII and API keys from prompt text or code. Supports 22 custom industry profiles (e.g. 'Dev', 'Medical', 'Legal').FREE / PRO
reveal_texttext: stringSwaps masked [TOKEN_N] labels back to their original values inside the AI's response using the local session map.FREE / PRO
sanitize_filefile_path: string,
profile?: string
Reads a file path from your workspace, sanitizes it locally, and feeds the sanitized data to the AI agent.PRO / TEAMS
create_default_configNoneCreates a default configurations file (privacyscrubber.json) in the active workspace root directory.PRO / TEAMS
check_statusNoneReturns current PrivacyScrubber tier status, request usage counts, and lists active custom rules.FREE / PRO

Workspace Custom Rules

Declare proprietary database structures, internal project identifiers, or custom security profiles locally. Create a privacyscrubber.json file at the root of your project or home folder. The local server automatically loads and merges these rules.

Regex Collision Prevention

Rules are sorted by length descending automatically to prevent token collision.

Exclusion Lists

Define safe terms (e.g. localhost, system keywords) that must never be redacted.

// privacyscrubber.json example
{ "customRules": [ { "pattern": "\\\\b[A-Z]{3}-\\\\d{4}-\\\\d{2}\\\\b", "label": "INTERNAL_DB_ID", "enabled": true } ], "exclusions": [ "localhost", "main_production_db", "PrivacyScrubber" ]
}

Hardening AI Coding Workflows

Address data leakage risks in Cursor IDE, Claude Desktop, and terminal agents without breaking code syntax or development velocity.

Automated Token Rehydration

Instruct the AI client to automatically run the reveal_text tool as its last step. Add this instruction to your system prompt presets so original values (e.g. database keys, emails) are automatically restored in the editor viewport:

"At the end of your response, if you used any masked placeholders like [EMAIL_1], you must call the reveal_text tool to restore them before displaying the code."

Zero-Frustration Code Auditing

Security regexes can sometimes redact programming syntax, breaking build compiles. PrivacyScrubber's default template automatically excludes standard developer keywords from sanitization, keeping code fully functional:

  • process.env.* and environment hooks
  • localhost and 127.0.0.1 addresses
  • node_modules directory paths
  • Standard console methods (console.log)

Terminal Shell Sanitization

If an AI agent (Cursor Agent or Claude Code) executes terminal command lines directly, secrets or user data can leak through stderr/stdout. Wrap any command in our lightweight execution utility to sanitize logs and outputs locally before they display or egress:

npx pii-masking-run -- npm run dev
Terminal — Run 100% Offline
# Install and run PrivacyScrubber MCP server locally
$npx -y @privacyscrubber/mcp-server
> [ZTDS] Initializing Zero-Trust data sanitization...
> [Keys] Cryptographic license check: Running in FREE tier
> [Listen] MCP Server listening on stdio transport

Quick Integration Guides

Integrate with Cursor IDE

Configure Cursor to scrub prompt context locally before letting Claude/GPT-4 write your code or analyze workspace files.

  1. Open Cursor Settings (Gear Icon top right or Ctrl/Cmd + ,).
  2. Go to Features > MCP.
  3. Click + Add New MCP Tool.
  4. Configure the tool settings in the modal:
    • Name: PrivacyScrubber
    • Type: command
    • Command: npx -y @privacyscrubber/mcp-server
💡 Pro tip: To activate your license keys, click the 'Environment Variables' button inside Cursor settings and add key PRIVACYSCRUBBER_KEY.

Frequently Asked Questions

Find quick answers to common questions about the PrivacyScrubber MCP Server deployment, features, and security architecture.