@privacyscrubber/mcp-server 2.2.3 โ 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +142 -5
- package/index.js +855 -26
- package/install.js +294 -41
- package/manifest.json +17 -1
- package/package.json +6 -2
- package/pii-masking-run.js +3 -3
- package/ps-license-manager.cjs +1 -1
- package/ps-license-manager.js +1 -1
- package/ps-pii-engine.cjs +1 -1
- package/ps-pii-engine.js +1 -1
- package/scrubber-core.cjs +1 -1
- package/server.json +3 -3
- package/smithery.yaml +2 -2
package/README.md
CHANGED
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@privacyscrubber/mcp-server)
|
|
4
4
|
[](https://www.npmjs.com/package/@privacyscrubber/mcp-server)
|
|
5
5
|
[](https://www.npmjs.com/package/@privacyscrubber/sdk)
|
|
6
|
+
[](https://www.npmjs.com/package/@privacyscrubber/sdk)
|
|
7
|
+
[](https://www.npmjs.com/package/@privacyscrubber/sdk)
|
|
6
8
|
[](https://opensource.org/licenses/MIT)
|
|
7
9
|
[](https://zenodo.org/records/22058770)
|
|
8
10
|
[](https://osf.io/5byjf/)
|
|
9
11
|
[](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=7335581)
|
|
12
|
+
[](https://datatracker.ietf.org/doc/draft-sibiryakov-ztds-protocol/)
|
|
10
13
|
[](https://smithery.ai/servers/privacyscrubber/pii-masking-mcp)
|
|
11
14
|
[](https://cursor.directory/plugins/privacyscrubber-mcp)
|
|
12
15
|
[](https://glama.ai/mcp/servers/moxno/privacyscrubber-mcp)
|
|
@@ -20,6 +23,8 @@
|
|
|
20
23
|
**CISO-Approved Zero-Trust PII & Secrets Redaction MCP Server for Cursor, Windsurf, and Claude Desktop.**
|
|
21
24
|
Locally 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.
|
|
22
25
|
|
|
26
|
+
> โญ **Support Zero-Trust Open Source:** If PrivacyScrubber protects your API keys and code from leaks, please **[Star this repository](https://github.com/moxno/privacyscrubber-mcp)** or run `gh repo star moxno/privacyscrubber-mcp` in your terminal!
|
|
27
|
+
|
|
23
28
|
---
|
|
24
29
|
|
|
25
30
|
## ๐ Zero-Trust Data Flow
|
|
@@ -50,22 +55,146 @@ Run the server directly without local installation:
|
|
|
50
55
|
npx -y @privacyscrubber/mcp-server
|
|
51
56
|
```
|
|
52
57
|
|
|
53
|
-
### 3. Programmatic Node.js / TypeScript SDK
|
|
54
|
-
Need direct, in-memory zero-trust PII sanitization in your backend microservice or
|
|
58
|
+
### 3. Programmatic Node.js / TypeScript SDK (Lightweight Presidio Alternative)
|
|
59
|
+
Need direct, in-memory zero-trust PII sanitization in your backend microservice, Next.js app, or RAG vector pipeline rather than an MCP server? Use our official zero-dependency SDK:
|
|
55
60
|
|
|
56
61
|
```bash
|
|
57
62
|
npm install @privacyscrubber/sdk
|
|
58
63
|
```
|
|
59
64
|
|
|
60
|
-
```
|
|
65
|
+
```typescript
|
|
61
66
|
import OpenAI from 'openai';
|
|
62
67
|
import { wrapOpenAI } from '@privacyscrubber/sdk';
|
|
63
68
|
|
|
64
69
|
// Transparently masks PII before sending to LLM and rehydrates responses:
|
|
65
70
|
const openai = wrapOpenAI(new OpenAI({ apiKey: process.env.OPENAI_API_KEY }));
|
|
71
|
+
|
|
72
|
+
// Outbound prompt is sanitized in local RAM before leaving your machine:
|
|
73
|
+
// "Schedule a call with [NAME_1] at [EMAIL_1] regarding API key [AWS_KEY_1]."
|
|
74
|
+
const completion = await openai.chat.completions.create({
|
|
75
|
+
model: 'gpt-4o',
|
|
76
|
+
messages: [{ role: 'user', content: 'Schedule a call with Alice Smith at alice@acme.com with AKIAIOSFODNN7EXAMPLE.' }]
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// Incoming LLM answer is automatically rehydrated with "Alice Smith (alice@acme.com)":
|
|
80
|
+
console.log(completion.choices[0].message.content);
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### โก Why @privacyscrubber/sdk vs Microsoft Presidio?
|
|
84
|
+
|
|
85
|
+
Microsoft Presidio is the Python standard, but deploying it in a Node.js / TypeScript stack requires running heavy Python microservices, Docker containers, and 500MB+ spaCy NLP models with 35โ120ms latency. `@privacyscrubber/sdk` runs **100% in-process with zero dependencies**:
|
|
86
|
+
|
|
87
|
+
| Feature / Metric | `@privacyscrubber/sdk` | Microsoft Presidio | AWS Comprehend / Google Cloud DLP |
|
|
88
|
+
| :--- | :--- | :--- | :--- |
|
|
89
|
+
| **Runtime & Dependencies** | **0 dependencies (~150KB)** | Python + Docker + spaCy (~500MB) | Heavy Cloud SDKs |
|
|
90
|
+
| **Execution Latency** | **Sub-millisecond in RAM (<1ms)** | 35โ120ms HTTP/gRPC roundtrip | 180โ400ms external cloud roundtrip |
|
|
91
|
+
| **Docker / Sidecar Needed** | **None (Pure in-process Node/WASM)** | Mandatory Docker container | VPC endpoints & IAM configurations |
|
|
92
|
+
| **Network Egress** | **0 Bytes (100% Air-gapped)** | Local internal network hop | Full unencrypted payload to cloud |
|
|
93
|
+
| **Data Loss & Reversibility** | **0 Loss (RAM-reversible via `restore()`)** | Manual token vault configuration | Irreversible masking / hashing |
|
|
94
|
+
| **OpenAI / LangChain 1-Liner** | **Built-in (`wrapOpenAI`, `wrapAiStream`)** | Complex custom pipeline glue | Custom proxy architecture |
|
|
95
|
+
| **DevOps Secrets Interception**| **Built-in (AWS, JWT, DB URIs, GitHub PAT)**| Custom regex recognizers needed | Cloud-specific classifiers |
|
|
96
|
+
| **Streaming Rehydration** | **Built-in (`wrapAiStream`, `TransformStream`)**| Buffering / chunk split failures | Not supported in real-time streams |
|
|
97
|
+
|
|
98
|
+
๐ [View @privacyscrubber/sdk on NPM](https://www.npmjs.com/package/@privacyscrubber/sdk) | Full documentation, Express middleware, LangChain transforms, and 25 compliance profiles.
|
|
99
|
+
|
|
100
|
+
#### ๐ค AI Orchestrator Recipes: LangChain, LlamaIndex, CrewAI & AutoGPT
|
|
101
|
+
|
|
102
|
+
If you are building autonomous agents, RAG vector pipelines, or backend services rather than single-user IDE prompts, use `@privacyscrubber/sdk` to sanitize data in-memory:
|
|
103
|
+
|
|
104
|
+
##### 1. LangChain.js (LCEL & RAG Document Ingestion)
|
|
105
|
+
```typescript
|
|
106
|
+
import { ChatOpenAI } from '@langchain/openai';
|
|
107
|
+
import { createLangChainTransform, createDocumentTransformer } from '@privacyscrubber/sdk';
|
|
108
|
+
|
|
109
|
+
// A. RAG Pre-Ingestion: sanitize documents before embedding into vector stores
|
|
110
|
+
const docTransformer = createDocumentTransformer({
|
|
111
|
+
profile: 'General',
|
|
112
|
+
sensitiveMetadataKeys: ['account_owner', 'submitter_email'],
|
|
113
|
+
attachTelemetry: true
|
|
114
|
+
});
|
|
115
|
+
const sanitizedDocs = await docTransformer.transformDocuments(rawDocs);
|
|
116
|
+
|
|
117
|
+
// B. LCEL Runtime Chains: sanitize prompts and restore responses in local RAM
|
|
118
|
+
const transform = createLangChainTransform({ defaultProfile: 'Dev' });
|
|
119
|
+
const { scrubbedText, tokenMap } = transform.preprocess(
|
|
120
|
+
"Deploying database with user admin and pwd postgresql://user:SecretPass123@db.internal:5432/prod"
|
|
121
|
+
);
|
|
122
|
+
const model = new ChatOpenAI({ model: 'gpt-4o' });
|
|
123
|
+
const response = await model.invoke(scrubbedText);
|
|
124
|
+
const finalOutput = transform.postprocess(response.content, tokenMap);
|
|
66
125
|
```
|
|
67
126
|
|
|
68
|
-
|
|
127
|
+
##### 2. LlamaIndex.TS & Universal Vector DB Ingestion (Chroma, Pinecone, Qdrant)
|
|
128
|
+
```typescript
|
|
129
|
+
import { createVectorIngestionGuard, createLlamaIndexTransform } from '@privacyscrubber/sdk';
|
|
130
|
+
|
|
131
|
+
// Initialize in-memory Vector Ingestion Guard (<1ms per batch, zero network egress)
|
|
132
|
+
const guard = createVectorIngestionGuard({
|
|
133
|
+
profile: 'Finance',
|
|
134
|
+
sensitiveMetadataKeys: ['contractor_email', 'billing_contact']
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
// A. Sanitize Chroma columnar batches ({ ids, documents, metadatas })
|
|
138
|
+
const cleanChroma = guard.sanitizeRecords(chromaBatch);
|
|
139
|
+
|
|
140
|
+
// B. Sanitize Pinecone / Qdrant record arrays ({ id, text/payload, metadata })
|
|
141
|
+
const cleanRecords = guard.sanitizeRecords(pineconeRecords);
|
|
142
|
+
|
|
143
|
+
// C. Align search query tokens with sanitized vector space before embedding
|
|
144
|
+
const { query: alignedQuery } = guard.sanitizeQuery("Search user john@example.com records");
|
|
145
|
+
|
|
146
|
+
// D. Transparent Vector Store Proxy: auto-sanitizes on write, re-hydrates on query
|
|
147
|
+
const guardedStore = guard.wrapVectorStore(nativeVectorStore);
|
|
148
|
+
```
|
|
149
|
+
> Complete runnable recipes are included inside the npm package under `@privacyscrubber/sdk/examples/` (or run `npx @privacyscrubber/sdk`).
|
|
150
|
+
|
|
151
|
+
##### 3. CrewAI & Multi-Agent Swarms (Sidecar Mode / Python Interop)
|
|
152
|
+
```bash
|
|
153
|
+
# Run lightweight zero-dependency local daemon (<1ms in-memory, 0 external network calls):
|
|
154
|
+
npx @privacyscrubber/sdk sidecar --port 3100
|
|
155
|
+
```
|
|
156
|
+
```python
|
|
157
|
+
# In your Python CrewAI / AutoGen Agent tools:
|
|
158
|
+
import requests
|
|
159
|
+
|
|
160
|
+
def sanitize_agent_input(prompt: str) -> tuple[str, dict]:
|
|
161
|
+
res = requests.post("http://127.0.0.1:3100/sanitize", json={"text": prompt, "profile": "Dev"}).json()
|
|
162
|
+
return res["scrubbedText"], res["tokenMap"]
|
|
163
|
+
|
|
164
|
+
def restore_agent_output(ai_response: str, token_map: dict) -> str:
|
|
165
|
+
res = requests.post("http://127.0.0.1:3100/restore", json={"text": ai_response, "tokenMap": token_map}).json()
|
|
166
|
+
return res["restoredText"]
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
##### 4. AutoGPT / Multi-Turn Autonomous Agents
|
|
170
|
+
```typescript
|
|
171
|
+
import { PrivacyScrubberEngine, createGuardedTools } from '@privacyscrubber/sdk';
|
|
172
|
+
|
|
173
|
+
const engine = new PrivacyScrubberEngine({ defaultProfile: 'Dev' });
|
|
174
|
+
// Equips agent with tools that intercept commands, file reads, and git diffs before model exposure:
|
|
175
|
+
const guardedTools = createGuardedTools(engine);
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
> ๐ข **Enterprise & Production Licensing:**
|
|
179
|
+
> - **Self-Serve Developer SDK ($299/mo flat or $2,990/yr):** Unlimited internal backend nodes, microservices, and RAG pipelines. [Get SDK License](https://privacyscrubber.com/pricing?tier=sdk&utm_source=mcp_readme)
|
|
180
|
+
> - **PrivacyScrubber TEAMS ($99/mo flat):** Unlimited team seats, centralized policy enforcement, encrypted session handoff. [Deploy TEAMS](https://privacyscrubber.com/teams?utm_source=mcp_readme)
|
|
181
|
+
> - **Enterprise Air-Gapped License:** On-premise source code distribution, zero-network custom models. [Contact Enterprise](https://privacyscrubber.com/enterprise?utm_source=mcp_readme)
|
|
182
|
+
|
|
183
|
+
#### ๐ก๏ธ Architecture & Security Deep-Dive (Zero-Trust vs Cloud DLP)
|
|
184
|
+
|
|
185
|
+
When AI IDEs (Cursor, Claude Desktop, Windsurf) connect to model providers, developer credentials, database connection strings, and internal customer PII are at continuous risk of prompt exfiltration. The `@privacyscrubber/mcp-server` enforces four immutable architectural guarantees:
|
|
186
|
+
|
|
187
|
+
1. **Stdio Air-Gapped Transport**:
|
|
188
|
+
The MCP server communicates exclusively over local standard input/output (`stdio`) child processes spawned by your IDE. It opens **zero external listening ports** and initiates **zero remote network requests**.
|
|
189
|
+
2. **Volatile RAM-Only Token Map**:
|
|
190
|
+
The mapping table between synthetic tokens (`[AWS_KEY_1]`, `[EMAIL_1]`) and raw cleartext is maintained exclusively in ephemeral node memory and is wiped the moment your IDE session closes.
|
|
191
|
+
3. **Deterministic AST Lookarounds vs Cloud Proxy Overhead**:
|
|
192
|
+
Unlike cloud DLP gateways (Nightfall, Skyflow) that add 200โ400ms latency and transmit unencrypted code to third parties, `@privacyscrubber/mcp-server` runs locally in <2ms with zero data egress.
|
|
193
|
+
4. **Permanent Standards & Academic Validation**:
|
|
194
|
+
- **IETF Specification**: [draft-sibiryakov-ztds-protocol-01](https://datatracker.ietf.org/doc/draft-sibiryakov-ztds-protocol/) โ Revision 01 ยท 2026-09-23 ยท 13 pages
|
|
195
|
+
- **CERN / Zenodo Foundation**: [DOI 10.5281/zenodo.22058770](https://doi.org/10.5281/zenodo.22058770)
|
|
196
|
+
- **Center for Open Science (OSF)**: [DOI 10.17605/OSF.IO/5BYJF](https://doi.org/10.17605/OSF.IO/5BYJF)
|
|
197
|
+
- **Patent Pending**: Israel Patent Office Application `IL 331905` (WIPO DAS Code: `B17B`)
|
|
69
198
|
|
|
70
199
|
---
|
|
71
200
|
|
|
@@ -246,7 +375,7 @@ Returns a visual dashboard showing your current tier, session request count, act
|
|
|
246
375
|
* **Response Example (Free Tier):**
|
|
247
376
|
```
|
|
248
377
|
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
249
|
-
โ PrivacyScrubber MCP Server v2.2.
|
|
378
|
+
โ PrivacyScrubber MCP Server v2.2.4 โ
|
|
250
379
|
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ
|
|
251
380
|
โ ๐ Tier: FREE โ
|
|
252
381
|
โ ๐ Session requests: 5 โ
|
|
@@ -395,6 +524,7 @@ PrivacyScrubber and the Zero-Trust Data Sanitization (ZTDS) protocol are backed
|
|
|
395
524
|
|
|
396
525
|
| Repository / Archive | DOI / Identifier | Focus Area | Regulatory & Compliance Scope |
|
|
397
526
|
|---|---|---|---|
|
|
527
|
+
| **IETF Specification** | [`draft-sibiryakov-ztds-protocol`](https://datatracker.ietf.org/doc/draft-sibiryakov-ztds-protocol/) | The ZTDS Protocol for Frontier AI Ingestion (Internet-Draft) | Global AI Privacy, Zero-Egress Architecture |
|
|
398
528
|
| **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 |
|
|
399
529
|
| **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 |
|
|
400
530
|
| **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 |
|
|
@@ -431,4 +561,11 @@ The Zero-Trust Data Sanitization (ZTDS) architecture, in-memory deterministic to
|
|
|
431
561
|
- **Official Title:** *SYSTEM AND METHOD FOR CLIENT-SIDE ZERO-TRUST DATA SANITIZATION AND CRYPTOGRAPHIC SESSION HANDOFF IN ARTIFICIAL INTELLIGENCE WORKFLOWS*
|
|
432
562
|
- **Virtual Patent Marking:** [privacyscrubber.com/patents/](https://privacyscrubber.com/patents/) in accordance with 35 U.S.C. ยง 287(a).
|
|
433
563
|
|
|
564
|
+
### ๐ Internet Engineering Task Force (IETF) Specification
|
|
565
|
+
- **Specification Title:** *The Zero-Trust Data Sanitization (ZTDS) Protocol for Frontier Artificial Intelligence Ingestion*
|
|
566
|
+
- **Document Category:** IETF Internet-Draft (Individual Submission)
|
|
567
|
+
- **IETF Datatracker:** [https://datatracker.ietf.org/doc/draft-sibiryakov-ztds-protocol/](https://datatracker.ietf.org/doc/draft-sibiryakov-ztds-protocol/)
|
|
568
|
+
- **Archive Plaintext:** [https://www.ietf.org/archive/id/draft-sibiryakov-ztds-protocol-01.txt](https://www.ietf.org/archive/id/draft-sibiryakov-ztds-protocol-01.txt)
|
|
569
|
+
|
|
570
|
+
|
|
434
571
|
|