@privacyscrubber/mcp-server 2.0.3 → 2.2.0
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 +125 -23
- package/bundle.mcpb +0 -0
- package/index.js +431 -3
- package/manifest.json +5 -3
- package/package.json +3 -1
- package/pii-masking-run.js +205 -53
- package/ps-pii-engine.cjs +289 -140
- package/ps-pii-engine.js +289 -140
- package/scrubber-core.cjs +7 -7
- package/server.json +3 -3
- package/.well-known/mcp/server-card.json +0 -78
- package/LICENSE +0 -21
package/scrubber-core.cjs
CHANGED
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
function stitchOrphanedNameLines(text, profile) {
|
|
39
39
|
if (!text || !text.includes('\n')) return text;
|
|
40
40
|
const prof = (profile || 'general').toLowerCase();
|
|
41
|
-
if (prof === 'medical') {
|
|
42
|
-
text = text.replace(/Patient
|
|
41
|
+
if (prof === 'medical' || prof === 'general') {
|
|
42
|
+
text = text.replace(/(Patient\s+Name|Emergency\s+Contact|In\s+Case\s+of\s+Emergency|ICE(?:\s+Contact)?):\s*\r?\n+([A-Z\p{Lu}][A-Za-z0-9&.,'’ \t-]*?[A-Za-z0-9\p{Lu}\p{Ll}])(?=\r?\n|$)/gui, '$1: $2');
|
|
43
43
|
} else if (prof === 'legal') {
|
|
44
|
-
text = text.replace(/Defendant:\s*\n+([A-Z][a-zA-Z]+\s[A-Z][a-zA-Z]+)/g, 'Defendant: $1');
|
|
44
|
+
text = text.replace(/Defendant:\s*\r?\n+([A-Z][a-zA-Z]+\s[A-Z][a-zA-Z]+)/g, 'Defendant: $1');
|
|
45
45
|
}
|
|
46
46
|
return text;
|
|
47
47
|
}
|
|
@@ -82,7 +82,7 @@ function scrubText(text, customRules = [], tokenLabelMap = {}, profile = 'Genera
|
|
|
82
82
|
|
|
83
83
|
// Split attached table labels/headers (e.g. Sarah MitchellEmail: -> Sarah Mitchell Email:)
|
|
84
84
|
// Specifically matches a letter followed directly by field names and a colon
|
|
85
|
-
textToProcess = textToProcess.replace(/([a-
|
|
85
|
+
textToProcess = textToProcess.replace(/([a-z])(Email|Phone|Mobile|Tel|Address|IP|ID|URL|SSN|Date):/g, '$1 $2:');
|
|
86
86
|
|
|
87
87
|
const sysMarker = "[Privacy Scrubber Mode]";
|
|
88
88
|
const oldMarker = "[SYSTEM INSTRUCTION: DATA PRIVACY MODE]";
|
|
@@ -388,7 +388,7 @@ function cleanAIPromptPrefix(text) {
|
|
|
388
388
|
cleaned = cleaned.replace(/(?:^|\n)[a-zA-Z0-9_#.:\-*>[\]=\s,'"]+\{[^}]*(--[a-zA-Z0-9_-]+:|color-mix\(|var\()[^}]*\}/g, "");
|
|
389
389
|
}
|
|
390
390
|
// 2. Strip AI author prefixes and platform artifacts
|
|
391
|
-
cleaned = cleaned.replace(/^\s*(?:Claude responded|Claude|ChatGPT|Gemini|Grok|DeepSeek|Kimi|Copilot|Assistant|User)\s*(?::|\bsaid\b|\bresponded\b|(
|
|
391
|
+
cleaned = cleaned.replace(/^\s*(?:Claude responded|Claude|ChatGPT|Gemini|Grok|DeepSeek|Kimi|Copilot|Assistant|User)\s*(?::|\bsaid\b|\bresponded\b|(?:\s*\n))\s*/i, "");
|
|
392
392
|
cleaned = cleaned.replace(/^(?:Here (?:is|are) (?:the )?(?:redacted|scrubbed|sanitized|processed|clean|updated|modified) (?:text|output|version|data).*?[:\n]+|\*\*Scrubbed Text\*\*[:\n]+|### Scrubbed Text[:\n]+)/i, '');
|
|
393
393
|
cleaned = cleaned.replace(/^\s*Edit\s*\n+/i, "");
|
|
394
394
|
cleaned = cleaned.replace(/\s*\bEdit\s+in\s+a\s+page\b\s*$/i, "");
|
|
@@ -1116,7 +1116,7 @@ function hydrateRegex(rule) {
|
|
|
1116
1116
|
}
|
|
1117
1117
|
});
|
|
1118
1118
|
if (remaskedCount > 0) {
|
|
1119
|
-
if (typeof showInPageToast === 'function') showInPageToast(
|
|
1119
|
+
if (typeof showInPageToast === 'function') showInPageToast('Re-masked in DOM. Original tokens restored.', "info");
|
|
1120
1120
|
document.querySelectorAll('.ps-toolbar-reveal, [id$="-reveal"]').forEach(b => {
|
|
1121
1121
|
b.setAttribute('title', 'Reveal Original Data (Decrypted Locally)');
|
|
1122
1122
|
b.classList.remove('ps-revealed-active');
|
|
@@ -1184,7 +1184,7 @@ function hydrateRegex(rule) {
|
|
|
1184
1184
|
});
|
|
1185
1185
|
|
|
1186
1186
|
if (restoredCount > 0) {
|
|
1187
|
-
if (typeof showInPageToast === 'function') showInPageToast(
|
|
1187
|
+
if (typeof showInPageToast === 'function') showInPageToast('✓ Decrypted Locally in RAM. Safe to copy.', "success");
|
|
1188
1188
|
document.querySelectorAll('.ps-toolbar-reveal, [id$="-reveal"]').forEach(b => {
|
|
1189
1189
|
b.setAttribute('title', 'Hide / Re-mask Protected Data in DOM');
|
|
1190
1190
|
b.classList.add('ps-revealed-active');
|
package/server.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"url": "https://github.com/moxno/privacyscrubber-mcp",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "2.0
|
|
9
|
+
"version": "2.2.0",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "@privacyscrubber/mcp-server",
|
|
14
|
-
"version": "2.0
|
|
14
|
+
"version": "2.2.0",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
},
|
|
@@ -26,4 +26,4 @@
|
|
|
26
26
|
]
|
|
27
27
|
}
|
|
28
28
|
]
|
|
29
|
-
}
|
|
29
|
+
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"serverInfo": {
|
|
3
|
-
"name": "privacyscrubber/pii-masking-mcp",
|
|
4
|
-
"version": "1.6.9"
|
|
5
|
-
},
|
|
6
|
-
"tools": [
|
|
7
|
-
{
|
|
8
|
-
"name": "sanitize_text",
|
|
9
|
-
"description": "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.",
|
|
10
|
-
"inputSchema": {
|
|
11
|
-
"type": "object",
|
|
12
|
-
"properties": {
|
|
13
|
-
"text": {
|
|
14
|
-
"type": "string",
|
|
15
|
-
"description": "The raw text, code, or logs to sanitize."
|
|
16
|
-
},
|
|
17
|
-
"profile": {
|
|
18
|
-
"type": "string",
|
|
19
|
-
"description": "The detection profile to use. Available: 'General' (Free), or PRO profiles: 'Dev' (Engineering/Code), 'Medical', 'Pharma', 'Legal', 'Compliance', 'CCPA', 'Finance', 'Bizops', 'Sales', 'WealthMgmt', 'Insurance', 'Accounting', 'HR', 'Security', 'Marketing', 'Support', 'RealEstate', 'Agents', 'Academic', 'Creative', 'Tech', 'Personal'. Defaults to 'General'."
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"required": ["text"]
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"name": "reveal_text",
|
|
27
|
-
"description": "Replaces masked tokens (e.g., [EMAIL_1], [API_KEY_1]) in the LLM's response back with the original private data from the local volatile RAM-only session map.",
|
|
28
|
-
"inputSchema": {
|
|
29
|
-
"type": "object",
|
|
30
|
-
"properties": {
|
|
31
|
-
"text": {
|
|
32
|
-
"type": "string",
|
|
33
|
-
"description": "The AI generated response containing placeholders to restore."
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"required": ["text"]
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"name": "sanitize_file",
|
|
41
|
-
"description": "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.",
|
|
42
|
-
"inputSchema": {
|
|
43
|
-
"type": "object",
|
|
44
|
-
"properties": {
|
|
45
|
-
"file_path": {
|
|
46
|
-
"type": "string",
|
|
47
|
-
"description": "Absolute path to the file to sanitize."
|
|
48
|
-
},
|
|
49
|
-
"profile": {
|
|
50
|
-
"type": "string",
|
|
51
|
-
"description": "The detection profile to use. Available: 'General' (Free), or PRO profiles: 'Dev' (Engineering/Code), 'Medical', 'Pharma', 'Legal', 'Compliance', 'CCPA', 'Finance', 'Bizops', 'Sales', 'WealthMgmt', 'Insurance', 'Accounting', 'HR', 'Security', 'Marketing', 'Support', 'RealEstate', 'Agents', 'Academic', 'Creative', 'Tech', 'Personal'. Defaults to 'General'."
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
"required": ["file_path"]
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"name": "create_default_config",
|
|
59
|
-
"description": "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.",
|
|
60
|
-
"inputSchema": {
|
|
61
|
-
"type": "object",
|
|
62
|
-
"properties": {},
|
|
63
|
-
"required": []
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"name": "check_status",
|
|
68
|
-
"description": "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.",
|
|
69
|
-
"inputSchema": {
|
|
70
|
-
"type": "object",
|
|
71
|
-
"properties": {},
|
|
72
|
-
"required": []
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
],
|
|
76
|
-
"resources": [],
|
|
77
|
-
"prompts": []
|
|
78
|
-
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Ilya Sibiryakov (BrandMeWeb)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|