{
  "markdown": "# @privacyscrubber/mcp-server\n\n[![NPM Version](https://img.shields.io/npm/v/@privacyscrubber/mcp-server?color=blue)](https://www.npmjs.com/package/@privacyscrubber/mcp-server)\n[![NPM Downloads](https://img.shields.io/npm/dm/@privacyscrubber/mcp-server?color=3b82f6)](https://www.npmjs.com/package/@privacyscrubber/mcp-server)\n[![NPM SDK](https://img.shields.io/npm/v/@privacyscrubber/sdk?label=%40privacyscrubber%2Fsdk&color=10b981)](https://www.npmjs.com/package/@privacyscrubber/sdk)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.22058770.svg)](https://zenodo.org/records/22058770)\n[![OSF DOI](https://img.shields.io/badge/OSF%20DOI-10.17605%2FOSF.IO%2F5BYJF-blue.svg)](https://osf.io/5byjf/)\n[![SSRN](https://img.shields.io/badge/SSRN-7335581-darkred.svg)](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=7335581)\n[![smithery badge](https://smithery.ai/badge/privacyscrubber/pii-masking-mcp)](https://smithery.ai/servers/privacyscrubber/pii-masking-mcp)\n[![Cursor Directory](https://img.shields.io/badge/Cursor%20Directory-Verified%20Plugin-000000.svg)](https://cursor.directory/plugins/privacyscrubber-mcp)\n[![Glama.ai](https://glama.ai/mcp/servers/moxno/privacyscrubber-mcp/badge)](https://glama.ai/mcp/servers/moxno/privacyscrubber-mcp)\n[![TensorBlock MCP Index](https://img.shields.io/badge/TensorBlock-Indexed%20MCP-FF6B6B.svg)](https://github.com/TensorBlock/awesome-mcp-servers)\n[![There's An AI For That](https://img.shields.io/badge/There's_An_AI_For_That-Live-06b6d4.svg)](https://theresanaiforthat.com/ai/privacy-scrubber/)\n[![Security: 100% Local](https://img.shields.io/badge/Security-100%25%20Local-emerald)](https://privacyscrubber.com)\n[![Parity: 100% Core Match](https://img.shields.io/badge/Parity-100%25%20Core%20Match-blueviolet)](https://privacyscrubber.com)\n\n**CISO-Approved Zero-Trust PII & Secrets Redaction MCP Server for Cursor, Windsurf, and Claude Desktop.**\nLocally scrubs PII, secrets, credentials, and custom regex rules from files and text contexts before they reach remote LLM providers to prevent API leaks and ensure HIPAA/SOC 2 compliance at the developer endpoint.\n\n---\n\n## 🔒 Zero-Trust Data Flow\n\nAll sensitive parameters, identifiers, and variables are intercepted locally inside your machine's RAM. They are replaced by tokens (e.g. `[EMAIL_1]`) before being sent to the AI. Once the AI responds, the tokens are safely swapped back to original values in your local context.\n\n```text\n[Raw Input / Files] ──> [MCP sanitize_text] ──> [Masked Tokens] ──> [LLM API]\n                               │                                       │\n                        (In-Memory Map)                             (Result)\n                               │                                       │\n[Original Output] <─── [MCP reveal_text] <─────────────────────────────┘\n```\n\n---\n\n## 🚀 Installation\n\n### 1. Install via Smithery\nTo automatically configure and run with your preferred client, install using Smithery:\n```bash\nnpx -y @smithery/cli install @privacyscrubber/mcp-server --write-to-clients\n```\n\n### 2. Instant Run with NPX\nRun the server directly without local installation:\n```bash\nnpx -y @privacyscrubber/mcp-server\n```\n\n### 3. Programmatic Node.js / TypeScript SDK\nNeed direct, in-memory zero-trust PII sanitization in your backend microservice or custom AI agent rather than an MCP server? Use our official zero-dependency SDK:\n\n```bash\nnpm install @privacyscrubber/sdk\n```\n\n```javascript\nimport OpenAI from 'openai';\nimport { wrapOpenAI } from '@privacyscrubber/sdk';\n\n// Transparently masks PII before sending to LLM and rehydrates responses:\nconst openai = wrapOpenAI(new OpenAI({ apiKey: process.env.OPENAI_API_KEY }));\n```\n\n👉 [View @privacyscrubber/sdk on NPM](https://www.npmjs.com/package/@privacyscrubber/sdk) | Includes `wrapOpenAI()` middleware, TypeScript definitions, and 25 compliance profiles.\n\n---\n\n## ⚙️ Client Integrations\n\n### Claude Desktop\nAdd this to your Claude Desktop config file:\n*   **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`\n*   **Windows:** `%APPDATA%\\Claude\\claude_desktop_config.json`\n\n```json\n{\n  \"mcpServers\": {\n    \"privacyscrubber\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@privacyscrubber/mcp-server\"],\n      \"env\": {\n        \"PRIVACYSCRUBBER_KEY\": \"YOUR_OPTIONAL_PRO_LICENSE_KEY\"\n      }\n    }\n  }\n}\n```\n\n### Cursor / Windsurf\n1. Navigate to Settings -> Features -> MCP.\n2. Add new MCP server:\n    *   **Name:** `privacyscrubber`\n    *   **Type:** `command`\n    *   **Command:** `npx -y @privacyscrubber/mcp-server`\n3. Optional: Set `PRIVACYSCRUBBER_KEY` as an environment variable in your system shell.\n\n---\n\n## 🛠️ Provided Tools & JSON-RPC Specifications\n\n### 1. `sanitize_text`\nRedacts PII, secrets, API keys, and credentials from a text block and populates the volatile local replacement mapping.\n\n*   **Arguments:**\n    *   `text` (string, required): The raw content or logs to sanitize.\n    *   `profile` (string, optional): Gated industry detection profile (e.g., 'General', 'Dev', 'Medical', 'Legal', 'Compliance'). Defaults to 'General'.\n*   **JSON-RPC Call Example:**\n    ```json\n    {\n      \"method\": \"tools/call\",\n      \"params\": {\n        \"name\": \"sanitize_text\",\n        \"arguments\": {\n          \"text\": \"Contact me at dev-key-1234 or jane.doe@company.com\",\n          \"profile\": \"General\"\n        }\n      }\n    }\n    ```\n*   **Response Example:**\n    ```json\n    {\n      \"content\": [\n        {\n          \"type\": \"text\",\n          \"text\": \"Contact me at [SECRET_1] or [EMAIL_1]\"\n        }\n      ]\n    }\n    ```\n\n### 2. `reveal_text`\nDetokenizes the AI response back to the original values locally.\n\n*   **Arguments:**\n    *   `text` (string, required): The response from the LLM containing tokenized placeholders.\n*   **JSON-RPC Call Example:**\n    ```json\n    {\n      \"method\": \"tools/call\",\n      \"params\": {\n        \"name\": \"reveal_text\",\n        \"arguments\": {\n          \"text\": \"Please reach out to [EMAIL_1] regarding the update.\"\n        }\n      }\n    }\n    ```\n*   **Response Example:**\n    ```json\n    {\n      \"content\": [\n        {\n          \"type\": \"text\",\n          \"text\": \"Please reach out to jane.doe@company.com regarding the update.\"\n        }\n      ]\n    }\n    ```\n\n### 3. `sanitize_file`\nReads a local file, extracts text, sanitizes it, and returns the redacted template for LLM analysis.\n*   **Supported Formats:** Plain text (source code, logs, CSV, JSON, markdown) and Microsoft Word (`.docx`) documents.\n*   **Arguments:**\n    *   `filePath` (string, required): Absolute file path to read and sanitize.\n    *   `profile` (string, optional): The industry detection profile.\n\n---\n\n## 🌐 Browser Extension & Web Client\n\nLooking for real-time protection directly inside your web browser?\n*   **Chrome Extension:** Get the [PrivacyScrubber Chrome Extension](https://chromewebstore.google.com/detail/privacyscrubber-%E2%80%94-pii-red/pimoejgefeilajmmbpghifdmhdlkgjol) to sanitize prompts directly inside ChatGPT, Claude, and Gemini in real-time.\n*   **Web Sandbox:** Use the zero-server browser sanitization tools at [PrivacyScrubber Homepage](https://privacyscrubber.com/?utm_source=npm&utm_medium=readme&utm_campaign=mcp_server).\n\n## 📄 License & Commercial Upgrade\n\nBy default, the server runs under the **Free Tier** (restricted to 15,000 characters per request and the basic `General` PII profile). To unlock 25 specialized engineering, medical, legal, and financial PII profiles, as well as team-wide custom rules, you can purchase a commercial license.\n\n### Feature Comparison\n\n| Feature | Free Tier | PRO Tier | TEAMS Tier |\n| :--- | :--- | :--- | :--- |\n| **Volatile Tokenization** | ✅ Yes | ✅ Yes | ✅ Yes |\n| **Standard PII Masking** | ✅ Yes | ✅ Yes | ✅ Yes |\n| **Max Character Length** | 15,000 chars | ♾️ Unlimited | ♾️ Unlimited |\n| **Industry Profiles** | General Only | 25 Profiles | 25 Profiles |\n| **Custom Regex Rules** | ❌ Locked | ♾️ Unlimited | ♾️ Unlimited |\n| **Team Rules Sync (GPO)** | ❌ No | ❌ No | ✅ Yes (Shared Link) |\n| **Licensing Cost** | $0 | **$110 Lifetime** | **$99/mo Flat Rate** |\n\n👉 **[Acquire a PRO / TEAMS License Key at privacyscrubber.com/pricing](https://privacyscrubber.com/pricing?utm_source=npm&utm_medium=readme&utm_campaign=mcp_server)**\n\n---\n\n### 4. `check_status`\n\nReturns a visual dashboard showing your current tier, session request count, active profiles, and upgrade instructions. Use it at any time to check your license status or get setup help.\n\n*   **Arguments:** _(none required)_\n*   **JSON-RPC Call Example:**\n    ```json\n    {\n      \"method\": \"tools/call\",\n      \"params\": { \"name\": \"check_status\", \"arguments\": {} }\n    }\n    ```\n*   **Response Example (Free Tier):**\n    ```\n    ╔══════════════════════════════════════════════════╗\n    ║       PrivacyScrubber MCP Server v1.7.1          ║\n    ╠══════════════════════════════════════════════════╣\n    ║  🔓 Tier: FREE                                   ║\n    ║  📊 Session requests: 5                          ║\n    ║  📁 Input size limit: 15,000 characters/request  ║\n    ╠══════════════════════════════════════════════════╣\n    ║  🏷️  Profiles: General only — PRO unlocks 25 more ║\n    ║  📋 Custom rules: 🔒 Locked — requires PRO       ║\n    ╠══════════════════════════════════════════════════╣\n    ║  💳 Upgrade to PRO — $110 Lifetime               ║\n    ║     https://privacyscrubber.com/pricing?utm_source=npm&utm_medium=readme&utm_campaign=mcp_server          ║\n    ╠══════════════════════════════════════════════════╣\n    ║  After purchase, add your key to MCP config:     ║\n    ║  \"PRIVACYSCRUBBER_KEY\": \"<your-key-here>\"        ║\n    ║  Full setup guide:                               ║\n    ║  https://privacyscrubber.com/features/mcp/?utm_source=npm&utm_medium=readme&utm_campaign=mcp_server       ║\n    ╚══════════════════════════════════════════════════╝\n    ```\n\n---\n\n## 🔐 After Purchase: Activate PRO in Your MCP Client\n\nAfter purchasing a PRO license at [privacyscrubber.com/pricing](https://privacyscrubber.com/pricing?utm_source=npm&utm_medium=readme&utm_campaign=mcp_server), you will receive a license key. Add it to your MCP client config as an environment variable: `PRIVACYSCRUBBER_KEY`.\n\n### Claude Desktop\n\nEdit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\\Claude\\claude_desktop_config.json` (Windows):\n\n```json\n{\n  \"mcpServers\": {\n    \"privacyscrubber\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@privacyscrubber/mcp-server\"],\n      \"env\": {\n        \"PRIVACYSCRUBBER_KEY\": \"YOUR_LICENSE_KEY_HERE\"\n      }\n    }\n  }\n}\n```\n\nRestart Claude Desktop after saving.\n\n### Cursor\n\n1. Go to **Settings → Features → MCP Servers**.\n2. Find `privacyscrubber` and click **Edit**.\n3. Add the environment variable: `PRIVACYSCRUBBER_KEY=YOUR_LICENSE_KEY_HERE`.\n4. Restart Cursor.\n\nAlternatively, export it system-wide so all tools pick it up:\n```bash\n# macOS / Linux — add to ~/.zshrc or ~/.bashrc\nexport PRIVACYSCRUBBER_KEY=\"YOUR_LICENSE_KEY_HERE\"\n```\n\n### Windsurf\n\nEdit `~/.codeium/windsurf/mcp_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"privacyscrubber\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@privacyscrubber/mcp-server\"],\n      \"env\": {\n        \"PRIVACYSCRUBBER_KEY\": \"YOUR_LICENSE_KEY_HERE\"\n      }\n    }\n  }\n}\n```\n\n### Verify Activation\n\nAfter adding the key, ask your AI agent to call `check_status`:\n\n```\nUse the check_status tool from PrivacyScrubber MCP\n```\n\nThe dashboard should show **Tier: PRO** and all profiles unlocked.\n\n---\n\n## 📚 Academic Foundations & Regulatory Verification\n\nPrivacyScrubber and the Zero-Trust Data Sanitization (ZTDS) protocol are backed by published scientific, clinical, and legal treatises:\n\n| Repository / Archive | DOI / Identifier | Focus Area | Regulatory & Compliance Scope |\n|---|---|---|---|\n| **Zenodo / CERN** | [`10.5281/zenodo.22058770`](https://zenodo.org/records/22058770) | Zero-Trust Data Sanitization (ZTDS) Protocol Foundation | Cross-Border AI Privacy, ISO 27001 A.8.11 |\n| **OSF (Center for Open Science)** | [`10.17605/OSF.IO/5BYJF`](https://osf.io/5byjf/) | Empirical Latency Benchmark & Memory Profiling (<2ms RAM) | Performance vs Cloud DLP Proxies |\n| **SSRN / Elsevier** | [`SSRN ID: 7335581`](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=7335581) | Enterprise Generative AI Governance | EU AI Act, UK GDPR, US State Privacy |\n| **medRxiv (Cold Spring Harbor)** | [`MEDRXIV/2026/361661`](https://submit.medrxiv.org/) | Multi-Center Clinical Trial De-Identification | HIPAA Safe Harbor Section 164.514(b) |\n| **Law Archive / OSF** | [`LawArchive ID: 4wc86`](https://osf.io/preprints/lawarchive/4wc86/) | Preserving Attorney-Client Privilege in AI Workflows | ABA Model Rules & Legal Ethics |\n\n### Citing PrivacyScrubber in Research & Audits\n```bibtex\n@software{sibiryakov2026privacyscrubber,\n  author = {Sibiryakov, Ilya},\n  title = {PrivacyScrubber: Zero-Trust Data Sanitization (ZTDS) Engine & MCP Server},\n  year = {2026},\n  publisher = {Zenodo},\n  doi = {10.5281/zenodo.22058770},\n  url = {https://github.com/moxno/privacyscrubber-mcp}\n}\n```\n\n---\n\n## 📄 License\n\nMIT © [Ilya Sibiryakov](https://privacyscrubber.com) (BrandMeWeb)\n\n\n",
  "bytes": 13269,
  "sha": "01e3996cf377d4a1319f9dce645d974cabb488cdc780461a643da74f19db18b5",
  "repo_slug": "moxno/privacyscrubber-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_moxno_privacyscrubber_mcp_8dbf80bf/readme"
}