pseudonym-mcp 0.7.3 → 0.7.4
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 +51 -56
- package/dist/cli.js +4 -3
- package/dist/cli.js.map +1 -1
- package/dist/core/ollama-client.d.ts.map +1 -1
- package/dist/core/ollama-client.js.map +1 -1
- package/dist/mcp/prompts.d.ts.map +1 -1
- package/dist/mcp/prompts.js +6 -2
- package/dist/mcp/prompts.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +4 -3
- package/dist/mcp/server.js.map +1 -1
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# pseudonym-mcp
|
|
2
2
|
|
|
3
|
-
Local pseudonymisation
|
|
3
|
+
Local pseudonymisation tools for LLM workflows — replace detected PII with opaque tokens before you hand text to a cloud LLM, then restore those tokens afterward.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/pseudonym-mcp)
|
|
6
6
|
[](LICENSE)
|
|
@@ -9,7 +9,7 @@ Local pseudonymisation layer for LLM workflows — replaces detected PII with op
|
|
|
9
9
|
[](#)
|
|
10
10
|
[](#)
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Expose MCP tools (`mask_text` and `unmask_text`) that your client or agent can call as an explicit privacy step. The server detects PII locally, replaces it with opaque tokens, and keeps the token mapping in memory for later restoration.
|
|
13
13
|
|
|
14
14
|
It is a **defense-in-depth measure**, not a compliance silver bullet. Read the [Limitations](#limitations) and [GDPR & AI Compliance](#gdpr--ai-compliance) sections before assuming this stack does more than it does.
|
|
15
15
|
|
|
@@ -17,9 +17,9 @@ It is a **defense-in-depth measure**, not a compliance silver bullet. Read the [
|
|
|
17
17
|
|
|
18
18
|
- **Multi-language PII detection**: Built-in support for English (SSN, credit cards, US phone) and Polish (PESEL, IBAN, Polish phone). New **heuristic language detection** (`detectLanguage()`) infers the language from text content — `--lang` remains the authoritative override but is no longer the only input.
|
|
19
19
|
- **Hybrid NER engine**: Regex for structured PII (SSN, credit cards, IBAN, email, phone) + local Ollama LLM for unstructured entities (names, organisations).
|
|
20
|
-
- **Local-detection architecture**: Detection and substitution happen on your machine. The cloud LLM call still happens (that's the point) — but it
|
|
20
|
+
- **Local-detection architecture**: Detection and substitution happen on your machine when the MCP tool is called. The cloud LLM call still happens (that's the point) — but it can see tokens instead of detected PII when your workflow uses the masked output.
|
|
21
21
|
- **Session-keyed mapping store**: Tokens like `[PERSON:1]` map back to originals in an isolated, per-request session. Multiple round-trips preserve token coherence.
|
|
22
|
-
- **
|
|
22
|
+
- **Unmask workflow support**: `mask_text` returns `auto_unmask` for clients that want to honor that preference, but this server does not intercept arbitrary LLM responses automatically.
|
|
23
23
|
- **Flexible engines**: Run `regex` only (no Ollama required), `llm` only, or `hybrid` (default).
|
|
24
24
|
- **Strict validation**: SSN area-number validation, credit card Luhn checksum, PESEL checksum — all configurable.
|
|
25
25
|
- **Graceful degradation**: If Ollama is unavailable, the regex phase still runs and no exception is thrown.
|
|
@@ -34,11 +34,11 @@ It is a **defense-in-depth measure**, not a compliance silver bullet. Read the [
|
|
|
34
34
|
- A breach at the provider's end exposes those values in cleartext
|
|
35
35
|
- Sending personal data to a non-EU LLM provider without further safeguards raises GDPR Article 44 questions you'll need to answer
|
|
36
36
|
|
|
37
|
-
✅ **With pseudonym-mcp:**
|
|
37
|
+
✅ **With pseudonym-mcp used before the cloud call:**
|
|
38
38
|
|
|
39
|
-
- The same prompt
|
|
39
|
+
- The same prompt can become `"[PERSON:1], SSN [SSN:1], card [CREDIT_CARD:1]"` when you call `mask_text` first
|
|
40
40
|
- The LLM reasons about structure and content without seeing those detected values in cleartext
|
|
41
|
-
- The response
|
|
41
|
+
- The response can be locally de-tokenised with `unmask_text` before reaching the user
|
|
42
42
|
- Detected direct identifiers are no longer shipped upstream — though structure, dates, indirect references, and any missed PII still are
|
|
43
43
|
|
|
44
44
|
This is a meaningful reduction in cleartext PII exposure. It is **not** "no personal data leaves your machine" — see [Limitations](#limitations).
|
|
@@ -51,13 +51,13 @@ pseudonym-mcp is relevant to compliance work, but it is a **technical control**,
|
|
|
51
51
|
|
|
52
52
|
The EU **General Data Protection Regulation (GDPR)** classifies names, national ID numbers (like SSN or PESEL), bank account numbers (IBAN), email addresses, credit card numbers, and phone numbers as **personal data** under Article 4(1). Sending this data to a cloud LLM provider constitutes **processing** under Article 4(2). Pseudonymisation is explicitly recognised under Art. 4(5) as a risk-reduction measure — but, critically, **pseudonymised data is still personal data** (Recital 26).
|
|
53
53
|
|
|
54
|
-
| GDPR Article | Obligation
|
|
55
|
-
| ------------ |
|
|
56
|
-
| Art. 5(1)(c) | **Data minimisation**
|
|
57
|
-
| Art. 25 | **Privacy by design and by default**
|
|
58
|
-
| Art. 32 | **Security of processing**
|
|
59
|
-
| Art. 44 | **Transfers to third countries**
|
|
60
|
-
| Art. 4(5) | **Pseudonymisation** definition
|
|
54
|
+
| GDPR Article | Obligation | Where pseudonym-mcp helps | Where it doesn't |
|
|
55
|
+
| ------------ | ------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------- |
|
|
56
|
+
| Art. 5(1)(c) | **Data minimisation** | Strips detected direct identifiers before transmission | Doesn't minimise context, structure, or undetected PII |
|
|
57
|
+
| Art. 25 | **Privacy by design and by default** | Provides a technical layer that fits into a privacy-by-design architecture | Architecture and policy decisions are still your responsibility |
|
|
58
|
+
| Art. 32 | **Security of processing** | Recognised technical measure under Recital 83 (pseudonymisation) | One control among many; doesn't replace access control, logging, encryption |
|
|
59
|
+
| Art. 44 | **Transfers to third countries** | Reduces the cleartext PII you transfer | Pseudonymised personal data is still personal data — transfer rules still apply |
|
|
60
|
+
| Art. 4(5) | **Pseudonymisation** definition | The mapping store is opaque to the cloud LLM; re-identification requires the local session | Re-identification is possible from context for anyone with side knowledge |
|
|
61
61
|
|
|
62
62
|
> **The honest bottom line:** pseudonymisation under GDPR Art. 4(5) is **not** anonymisation. The data remains personal data in your system, and Art. 44 transfer obligations are not switched off just because you tokenised the name field.
|
|
63
63
|
|
|
@@ -100,17 +100,19 @@ In every row of this table, pseudonym-mcp is a useful **building block**. None o
|
|
|
100
100
|
```
|
|
101
101
|
Your App / Claude Desktop
|
|
102
102
|
│
|
|
103
|
-
│
|
|
103
|
+
│ explicit mask_text tool call with PII
|
|
104
104
|
▼
|
|
105
105
|
┌─────────────────────────┐
|
|
106
106
|
│ pseudonym-mcp │
|
|
107
107
|
│ │
|
|
108
108
|
│ Phase 1: Regex NER │ ← SSN, CREDIT_CARD, EMAIL, PHONE (en)
|
|
109
|
-
│ │ ← PESEL, IBAN, EMAIL, PHONE (pl)
|
|
109
|
+
│ │ ← PESEL, IBAN, EMAIL, PHONE, NIP (pl)
|
|
110
110
|
│ Phase 2: Ollama NER │ ← PERSON, ORG (local LLM)
|
|
111
111
|
│ MappingStore (session) │ ← [TAG:N] ↔ original value
|
|
112
112
|
└────────────┬────────────┘
|
|
113
|
-
│
|
|
113
|
+
│ masked text returned to the client/agent
|
|
114
|
+
▼
|
|
115
|
+
Your workflow sends the masked text
|
|
114
116
|
▼
|
|
115
117
|
Cloud LLM API
|
|
116
118
|
(Claude / GPT-4 / Gemini)
|
|
@@ -165,14 +167,14 @@ In Claude Code you type:
|
|
|
165
167
|
Use mask_text on this note, then summarise the key points of the meeting.
|
|
166
168
|
```
|
|
167
169
|
|
|
168
|
-
**pseudonym-mcp replaces detected PII locally
|
|
170
|
+
**First, call `mask_text`; pseudonym-mcp replaces detected PII locally:**
|
|
169
171
|
|
|
170
172
|
```
|
|
171
173
|
Meeting with [PERSON:1] ([PESEL:1]) from [ORG:1].
|
|
172
174
|
We discussed a contract for 45 000 zł. Contact: [EMAIL:1]
|
|
173
175
|
```
|
|
174
176
|
|
|
175
|
-
**Claude
|
|
177
|
+
**Then ask Claude to work from the masked text. Claude responds with tokens:**
|
|
176
178
|
|
|
177
179
|
```
|
|
178
180
|
Meeting with [PERSON:1] from [ORG:1] covered a contract
|
|
@@ -186,7 +188,7 @@ Meeting with Jan Kowalski from Acme sp. z o.o. covered
|
|
|
186
188
|
a contract for 45 000 zł. Follow up via jan.kowalski@acme.pl
|
|
187
189
|
```
|
|
188
190
|
|
|
189
|
-
|
|
191
|
+
If the masked text is what you send upstream, the cloud provider sees the structure of the meeting and the amount — but not the detected name, PESEL, organisation, or email in cleartext. The swap happens on your machine.
|
|
190
192
|
|
|
191
193
|
### Obsidian vault with `session_id`
|
|
192
194
|
|
|
@@ -205,7 +207,9 @@ The `session_id` keeps the token map alive for the session — the same `[PERSON
|
|
|
205
207
|
|
|
206
208
|
## MCP Prompt Templates
|
|
207
209
|
|
|
208
|
-
pseudonym-mcp ships two built-in prompt templates that
|
|
210
|
+
pseudonym-mcp ships two built-in prompt templates that describe a mask → task → unmask workflow.
|
|
211
|
+
|
|
212
|
+
**Important:** MCP prompt templates are convenience helpers, not a privacy boundary. Inline prompt arguments may be visible to the host client or model before tool masking happens. For strongest privacy, call `mask_text` directly first, then use the returned `masked_text` in your LLM prompt.
|
|
209
213
|
|
|
210
214
|
### `pseudonymize_task` — inline text
|
|
211
215
|
|
|
@@ -213,7 +217,7 @@ pseudonym-mcp ships two built-in prompt templates that chain masking, an LLM tas
|
|
|
213
217
|
/pseudonymize_task text="Meeting with Jan Kowalski (PESEL: 90010112318). Contract: 45 000 zł." task="Extract action items"
|
|
214
218
|
```
|
|
215
219
|
|
|
216
|
-
|
|
220
|
+
Intended workflow:
|
|
217
221
|
|
|
218
222
|
1. pseudonym-mcp masks detected PII locally → `[PERSON:1]`, `[PESEL:1]`
|
|
219
223
|
2. Claude processes the masked text
|
|
@@ -229,7 +233,7 @@ Optional `lang` argument: `en` (default) or `pl`.
|
|
|
229
233
|
/privacy_scan_file filePath="/Users/me/contracts/nda.pdf" task="Summarise obligations and deadlines"
|
|
230
234
|
```
|
|
231
235
|
|
|
232
|
-
|
|
236
|
+
Intended workflow:
|
|
233
237
|
|
|
234
238
|
1. macos-vision-mcp extracts text from the file on-device
|
|
235
239
|
2. pseudonym-mcp masks detected PII locally
|
|
@@ -281,7 +285,8 @@ Restart your client. The `mask_text` and `unmask_text` tools appear automaticall
|
|
|
281
285
|
{
|
|
282
286
|
"session_id": "3f2a1b...",
|
|
283
287
|
"masked_text": "[PERSON:1] (SSN: [SSN:1]) works at [ORG:1].",
|
|
284
|
-
"auto_unmask": false
|
|
288
|
+
"auto_unmask": false,
|
|
289
|
+
"ner_status": "ready"
|
|
285
290
|
}
|
|
286
291
|
```
|
|
287
292
|
|
|
@@ -310,15 +315,15 @@ Restart your client. The `mask_text` and `unmask_text` tools appear automaticall
|
|
|
310
315
|
}
|
|
311
316
|
```
|
|
312
317
|
|
|
313
|
-
| Key | Values | Default | Description
|
|
314
|
-
| ------------------ | ---------------------------- | ------------------------ |
|
|
315
|
-
| `lang` | `en`, `pl` | `en` | Language pack for regex rules
|
|
316
|
-
| `engines` | `regex` \| `llm` \| `hybrid` | `hybrid` | Which NER engines to run
|
|
317
|
-
| `ollamaModel` | any Ollama model name | `llama3` | Local LLM for entity detection
|
|
318
|
-
| `ollamaBaseUrl` | URL | `http://localhost:11434` | Ollama API endpoint
|
|
319
|
-
| `autoUnmask` | `true` \| `false` | `false` |
|
|
320
|
-
| `strictValidation` | `true` \| `false` | `true` | Enable checksum / format validation (SSN area check, Luhn for cards, PESEL checksum)
|
|
321
|
-
| `customLiterals` | `string[]` | `[]` | Specific strings always redacted regardless of engine (names, IDs, phone numbers)
|
|
318
|
+
| Key | Values | Default | Description |
|
|
319
|
+
| ------------------ | ---------------------------- | ------------------------ | ----------------------------------------------------------------------------------------- |
|
|
320
|
+
| `lang` | `en`, `pl` | `en` | Language pack for regex rules |
|
|
321
|
+
| `engines` | `regex` \| `llm` \| `hybrid` | `hybrid` | Which NER engines to run |
|
|
322
|
+
| `ollamaModel` | any Ollama model name | `llama3` | Local LLM for entity detection |
|
|
323
|
+
| `ollamaBaseUrl` | URL | `http://localhost:11434` | Ollama API endpoint |
|
|
324
|
+
| `autoUnmask` | `true` \| `false` | `false` | Report the preferred unmask behavior to clients; this server does not intercept responses |
|
|
325
|
+
| `strictValidation` | `true` \| `false` | `true` | Enable checksum / format validation (SSN area check, Luhn for cards, PESEL checksum) |
|
|
326
|
+
| `customLiterals` | `string[]` | `[]` | Specific strings always redacted regardless of engine (names, IDs, phone numbers) |
|
|
322
327
|
|
|
323
328
|
### CLI flags
|
|
324
329
|
|
|
@@ -335,7 +340,7 @@ pseudonym-mcp --lang en --engines regex --ollama-model llama3 --auto-unmask
|
|
|
335
340
|
| `--ollama-model` | Ollama model to use for NER |
|
|
336
341
|
| `--ollama-base-url` | Ollama base URL |
|
|
337
342
|
| `--config` | Path to a custom JSON config file |
|
|
338
|
-
| `--auto-unmask` |
|
|
343
|
+
| `--auto-unmask` | Set `auto_unmask: true` in `mask_text` output for clients that honor it |
|
|
339
344
|
| `--custom-literals` | Comma-separated strings to always redact, e.g. `"Jan Kowalski,78091512345"` |
|
|
340
345
|
|
|
341
346
|
### Claude Code
|
|
@@ -386,15 +391,7 @@ Detection is best-effort. The patterns below are what the tool **looks for** —
|
|
|
386
391
|
|
|
387
392
|
Custom literals are applied after the regex phase and before LLM NER, regardless of engine mode. Longest literals are matched first to prevent partial substitution.
|
|
388
393
|
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
| Tag | Pattern | Validation |
|
|
392
|
-
| ------- | ------------------------------------ | ------------ |
|
|
393
|
-
| `EMAIL` | RFC 5321-compatible | Format match |
|
|
394
|
-
| `IBAN` | Generic IBAN (`CC` + 2 check + BBAN) | Format match |
|
|
395
|
-
| `IP` | IPv4 (all octets 0–255) | Format match |
|
|
396
|
-
| `URL` | `http://` / `https://` URLs | Format match |
|
|
397
|
-
| `PHONE` | International `+CC` prefix format | Format match |
|
|
394
|
+
The tables below list patterns active in the current `Engine` pipeline. Some additional pattern modules exist in the repository for experimentation, but they are not advertised here unless the language rules actually use them.
|
|
398
395
|
|
|
399
396
|
### English (`--lang en`, default)
|
|
400
397
|
|
|
@@ -404,22 +401,20 @@ Custom literals are applied after the regex phase and before LLM NER, regardless
|
|
|
404
401
|
| `CREDIT_CARD` | 13–19 digits (Visa, Mastercard, Amex, Discover) | Luhn checksum |
|
|
405
402
|
| `EMAIL` | RFC 5321-compatible | Format match |
|
|
406
403
|
| `PHONE` | `+1 (XXX) XXX-XXXX`, `XXX-XXX-XXXX`, `XXX.XXX.XXXX` | Format match |
|
|
407
|
-
| `ZIP_CODE` | `XXXXX` or `XXXXX-XXXX` (paranoid mode only) | Format match |
|
|
408
404
|
| `PERSON` | Full names | Ollama NER (hybrid / llm engines) |
|
|
409
405
|
| `ORG` | Company / organisation names | Ollama NER (hybrid / llm engines) |
|
|
410
406
|
|
|
411
407
|
### Polish (`--lang pl`)
|
|
412
408
|
|
|
413
|
-
| Tag
|
|
414
|
-
|
|
|
415
|
-
| `PESEL`
|
|
416
|
-
| `IBAN`
|
|
417
|
-
| `EMAIL`
|
|
418
|
-
| `PHONE`
|
|
419
|
-
| `NIP`
|
|
420
|
-
| `
|
|
421
|
-
| `
|
|
422
|
-
| `ORG` | Company / organisation names | Ollama NER (hybrid / llm engines) |
|
|
409
|
+
| Tag | Pattern | Validation |
|
|
410
|
+
| -------- | ---------------------------------------------------------------- | ----------------------------------------------- |
|
|
411
|
+
| `PESEL` | 11-digit national ID | Full checksum (weights `[1,3,7,9,1,3,7,9,1,3]`) |
|
|
412
|
+
| `IBAN` | `PL` + 26 digits, compact or spaced | Format match |
|
|
413
|
+
| `EMAIL` | RFC 5321-compatible | Format match |
|
|
414
|
+
| `PHONE` | `+48` / `0048` prefix, 9-digit mobile, landline `(XX) XXX-XX-XX` | Format match |
|
|
415
|
+
| `NIP` | 10-digit tax ID (strict / paranoid modes) | Checksum (weights `[6,5,7,2,3,4,5,6,7]`) |
|
|
416
|
+
| `PERSON` | Full names | Ollama NER (hybrid / llm engines) |
|
|
417
|
+
| `ORG` | Company / organisation names | Ollama NER (hybrid / llm engines) |
|
|
423
418
|
|
|
424
419
|
## Language Detection
|
|
425
420
|
|
|
@@ -453,7 +448,7 @@ It is a building block for future multi-language and auto-select modes.
|
|
|
453
448
|
| `llm` | Yes | No | Yes |
|
|
454
449
|
| `hybrid` (default) | Yes (graceful fallback) | Yes | Yes |
|
|
455
450
|
|
|
456
|
-
In `hybrid` mode, Ollama runs after the regex pass so the
|
|
451
|
+
In `hybrid` mode, Ollama runs after the regex pass, so the local NER model receives already-tokenised structured identifiers. If Ollama is unreachable, the server logs a warning to stderr and returns the regex-only masked text — no crash, no hang.
|
|
457
452
|
|
|
458
453
|
## Privacy & Security notes
|
|
459
454
|
|
|
@@ -492,7 +487,7 @@ git clone https://github.com/woladi/pseudonym-mcp
|
|
|
492
487
|
cd pseudonym-mcp
|
|
493
488
|
npm install
|
|
494
489
|
npm run build # tsc compile
|
|
495
|
-
npm test # vitest (
|
|
490
|
+
npm test # vitest (no Ollama required)
|
|
496
491
|
```
|
|
497
492
|
|
|
498
493
|
The test suite runs fully offline — Ollama calls are injected via constructor and mocked in all tests. No live LLM required.
|
package/dist/cli.js
CHANGED
|
@@ -3,18 +3,19 @@ import { Command } from 'commander';
|
|
|
3
3
|
import { ConfigManager } from './config/manager.js';
|
|
4
4
|
import { printOllamaStatus } from './setup/check-ollama.js';
|
|
5
5
|
import { startServer } from './mcp/server.js';
|
|
6
|
+
import { APP_VERSION } from './version.js';
|
|
6
7
|
const VALID_ENGINES = ['regex', 'llm', 'hybrid'];
|
|
7
8
|
const program = new Command();
|
|
8
9
|
program
|
|
9
10
|
.name('pseudonym-mcp')
|
|
10
|
-
.description('MCP server that pseudonymizes sensitive data locally before
|
|
11
|
-
.version(
|
|
11
|
+
.description('MCP server that pseudonymizes sensitive data locally before cloud LLM work')
|
|
12
|
+
.version(APP_VERSION)
|
|
12
13
|
.option('--lang <lang>', 'Language for regex rules: en | pl', 'en')
|
|
13
14
|
.option('--engines <mode>', 'Processing engines: regex | llm | hybrid', 'hybrid')
|
|
14
15
|
.option('--ollama-model <model>', 'Ollama model for LLM NER', 'llama3')
|
|
15
16
|
.option('--ollama-base-url <url>', 'Ollama base URL', 'http://localhost:11434')
|
|
16
17
|
.option('--config <path>', 'Path to a JSON config file (default: ./mcp-config.json)')
|
|
17
|
-
.option('--auto-unmask', '
|
|
18
|
+
.option('--auto-unmask', 'Report auto_unmask=true in tool output for clients that honor it', false)
|
|
18
19
|
.option('--custom-literals <items>', 'Comma-separated strings to always redact')
|
|
19
20
|
.action(async (opts) => {
|
|
20
21
|
const engines = VALID_ENGINES.includes(opts.engines)
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAmB,MAAM,qBAAqB,CAAA;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAmB,MAAM,qBAAqB,CAAA;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE1C,MAAM,aAAa,GAAiB,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAA;AAE9D,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAA;AAE7B,OAAO;KACJ,IAAI,CAAC,eAAe,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,QAAQ,IAAI,GAAG,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;QACtD,MAAM,iBAAiB,CAAC,GAAG,CAAC,aAAa,EAAE,GAAG,CAAC,WAAW,CAAC,CAAA;IAC7D,CAAC;IAED,MAAM,WAAW,EAAE,CAAA;AACrB,CAAC,CACF,CAAA;AAEH,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IACtD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ollama-client.d.ts","sourceRoot":"","sources":["../../src/core/ollama-client.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,QAAQ,GAAG,KAAK,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAQD;;;GAGG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAQ;IAChC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;IAC9B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAQ;gBAEtB,IAAI,EAAE,mBAAmB;IAMrC;;;OAGG;IACG,YAAY,CAAC,SAAS,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;IAyBxD;;;OAGG;IACH,MAAM,IAAI,IAAI;IAIR,eAAe,
|
|
1
|
+
{"version":3,"file":"ollama-client.d.ts","sourceRoot":"","sources":["../../src/core/ollama-client.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY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AI,IAAI,CAAA;QAE9C,oEAAoE;QACpE,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;QAC9C,IAAI,CAAC,SAAS;YAAE,OAAO,EAAE,CAAA;QAEzB,IAAI,MAAiB,CAAA;QACrB,IAAI,CAAC;YACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAc,CAAA;QAChD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAA;QACX,CAAC;QAED,OAAO,MAAM,CAAC,MAAM,CAClB,CAAC,CAAC,EAAqB,EAAE,CACvB,OAAO,CAAC,KAAK,QAAQ;YACrB,CAAC,KAAK,IAAI;YACV,MAAM,IAAI,CAAC;YACX,OAAO,IAAI,CAAC;YACZ,CAAE,CAA6B,CAAC,IAAI,KAAK,QAAQ;gBAC9C,CAA6B,CAAC,IAAI,KAAK,KAAK,CAAC;YAChD,OAAQ,CAA6B,CAAC,KAAK,KAAK,QAAQ;YACtD,CAA6B,CAAC,KAAgB,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CACrE,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/mcp/prompts.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/mcp/prompts.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAU1E;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAWxE"}
|
package/dist/mcp/prompts.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ConfigManager } from '../config/manager.js';
|
|
2
2
|
export function pseudonymizeTaskMessage(args) {
|
|
3
3
|
const lang = args.lang ?? ConfigManager.getInstance().get().lang;
|
|
4
|
-
return (`
|
|
4
|
+
return (`Privacy note: this MCP prompt template includes the raw text below in the prompt message. ` +
|
|
5
|
+
`For strongest privacy, call the mask_text tool directly before giving content to a cloud LLM.\n\n` +
|
|
6
|
+
`Use pseudonym-mcp mask_text on the following text (lang: ${lang}) and save the session_id:\n\n` +
|
|
5
7
|
`<text>\n${args.text}\n</text>\n\n` +
|
|
6
8
|
`Then: ${args.task}\n\n` +
|
|
7
9
|
`Finally, call pseudonym-mcp unmask_text with the saved session_id to restore original values before showing the response.`);
|
|
@@ -9,7 +11,9 @@ export function pseudonymizeTaskMessage(args) {
|
|
|
9
11
|
export function privacyScanFileMessage(args) {
|
|
10
12
|
const lang = args.lang ?? ConfigManager.getInstance().get().lang;
|
|
11
13
|
const task = args.task ?? 'summarize the key points';
|
|
12
|
-
return (`
|
|
14
|
+
return (`Privacy note: this MCP prompt template asks another tool to extract raw text, then includes workflow instructions in the prompt. ` +
|
|
15
|
+
`For strongest privacy, extract and mask content explicitly before giving it to a cloud LLM.\n\n` +
|
|
16
|
+
`Use macos-vision-mcp to extract text from ${args.filePath}.\n` +
|
|
13
17
|
`Then use pseudonym-mcp mask_text on the result (lang: ${lang}), save session_id.\n` +
|
|
14
18
|
`Then: ${task}.\n` +
|
|
15
19
|
`Finally call pseudonym-mcp unmask_text with the session_id to restore original values in the response.`);
|
package/dist/mcp/prompts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/mcp/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAcpD,MAAM,UAAU,uBAAuB,CAAC,IAA0B;IAChE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,aAAa,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAA;IAChE,OAAO,CACL,4DAA4D,IAAI,gCAAgC;QAChG,WAAW,IAAI,CAAC,IAAI,eAAe;QACnC,SAAS,IAAI,CAAC,IAAI,MAAM;QACxB,2HAA2H,CAC5H,CAAA;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,IAAyB;IAC9D,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,aAAa,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAA;IAChE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,0BAA0B,CAAA;IACpD,OAAO,CACL,6CAA6C,IAAI,CAAC,QAAQ,KAAK;QAC/D,yDAAyD,IAAI,uBAAuB;QACpF,SAAS,IAAI,KAAK;QAClB,wGAAwG,CACzG,CAAA;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/mcp/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAcpD,MAAM,UAAU,uBAAuB,CAAC,IAA0B;IAChE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,aAAa,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAA;IAChE,OAAO,CACL,4FAA4F;QAC5F,mGAAmG;QACnG,4DAA4D,IAAI,gCAAgC;QAChG,WAAW,IAAI,CAAC,IAAI,eAAe;QACnC,SAAS,IAAI,CAAC,IAAI,MAAM;QACxB,2HAA2H,CAC5H,CAAA;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,IAAyB;IAC9D,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,aAAa,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAA;IAChE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,0BAA0B,CAAA;IACpD,OAAO,CACL,mIAAmI;QACnI,iGAAiG;QACjG,6CAA6C,IAAI,CAAC,QAAQ,KAAK;QAC/D,yDAAyD,IAAI,uBAAuB;QACpF,SAAS,IAAI,KAAK;QAClB,wGAAwG,CACzG,CAAA;AACH,CAAC"}
|
package/dist/mcp/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AA6BnE,wBAAgB,eAAe,IAAI,SAAS,CAyK3C;AAED,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAajD"}
|
package/dist/mcp/server.js
CHANGED
|
@@ -6,6 +6,7 @@ import { OllamaClient } from '../core/ollama-client.js';
|
|
|
6
6
|
import { MappingStore } from '../core/mapping-store.js';
|
|
7
7
|
import { ConfigManager } from '../config/manager.js';
|
|
8
8
|
import { pseudonymizeTaskMessage, privacyScanFileMessage } from './prompts.js';
|
|
9
|
+
import { APP_VERSION } from '../version.js';
|
|
9
10
|
const NER_WARNING = {
|
|
10
11
|
ready: null,
|
|
11
12
|
warming_up: 'NER unavailable — Ollama is still loading the model. Retry in a few seconds for PERSON/ORG masking.',
|
|
@@ -24,7 +25,7 @@ function getOrCreateEngine(sessionId) {
|
|
|
24
25
|
export function createMcpServer() {
|
|
25
26
|
const server = new McpServer({
|
|
26
27
|
name: 'pseudonym-mcp',
|
|
27
|
-
version:
|
|
28
|
+
version: APP_VERSION,
|
|
28
29
|
});
|
|
29
30
|
server.tool('mask_text', `Pseudonymize sensitive entities in text before sending to a cloud LLM.
|
|
30
31
|
|
|
@@ -122,7 +123,7 @@ in the session identified by session_id.`, {
|
|
|
122
123
|
};
|
|
123
124
|
});
|
|
124
125
|
server.registerPrompt('pseudonymize_task', {
|
|
125
|
-
description: '
|
|
126
|
+
description: 'Convenience workflow for masking text, running a task, and restoring originals. Not a privacy boundary for prompt arguments.',
|
|
126
127
|
argsSchema: {
|
|
127
128
|
text: z.string().describe('Text containing sensitive data'),
|
|
128
129
|
task: z.string().describe('What to do with the anonymized text'),
|
|
@@ -140,7 +141,7 @@ in the session identified by session_id.`, {
|
|
|
140
141
|
],
|
|
141
142
|
}));
|
|
142
143
|
server.registerPrompt('privacy_scan_file', {
|
|
143
|
-
description: '
|
|
144
|
+
description: 'Convenience workflow for OCR, masking, task execution, and restore. Not a privacy boundary for extracted prompt content.',
|
|
144
145
|
argsSchema: {
|
|
145
146
|
filePath: z.string().describe('Path to the file to scan (PDF, image, etc.)'),
|
|
146
147
|
task: z
|
package/dist/mcp/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAAE,CAAC,EA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,CAAA;IAC7C,IAAI,GAAG,CAAC,OAAO,KAAK,QAAQ,IAAI,GAAG,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;QACtD,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,aAAa,EAAE,KAAK,EAAE,GAAG,CAAC,WAAW,EAAE,CAAC,CAAA;QAC7F,YAAY,CAAC,MAAM,EAAE,CAAA;IACvB,CAAC;IAED,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;AACjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,UAAU,CAAA"}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAA"}
|
package/package.json
CHANGED