maskera-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
maskera
Pasting Swedish customer, patient, or employee text into an LLM leaks personal data, and generic PII tools miss Swedish personnummer, addresses, and lowercase names. Maskera masks them locally on your device before text leaves, then restores the original values in the reply.
On-device, zero telemetry: text, model weights, and restore maps stay in your browser or Node process.
Rules + 68 MB Swedish AI model: catches personnummer, bankgiro, IBAN, phone numbers, plus free-text names (97% recall, 92.8% lowercase), places (97.3%), and addresses (95.2%).
Reversible placeholders: swaps PII for stable tokens like
[NAMN_1]and restores them in the model's answer.Three ways to run: TypeScript/JS packages (
maskera,@maskera/core), local MCP server & HTTP proxy (@maskera/mcpwith PDF, DOCX, and XLSX redaction), and Chrome/Edge/Firefox extension.Tunable for real workflows: opt into
profile: "clinical"for medical text or extend with customregexDetectorrules.
npm install maskera @huggingface/transformers # all-in-one: rules + Swedish AI modelimport { createNerRecognizer, redactWithNer } from "maskera"
const recognizer = createNerRecognizer() // 68 MB Swedish model, runs locally
const { text, restore } = await redactWithNer(
"hej jag heter provnamn maskera, personnummer 19900101-2385, och bor i provbyn",
{ recognizer },
)
// text -> "hej jag heter [NAMN_1], personnummer [PERSONNUMMER_1], och bor i [PLATS_1]"Rules only, zero dependencies: npm install @maskera/core. Live demo: maskera.dev
Three ways to use it
Open-source npm packages (MIT):
@maskera/coreandmaskerafor browser and Node.js apps.AI agents, MCP & CLI (
@maskera/mcp): local MCP server, HTTP proxy, and CLI for Claude Code, Codex, OpenCode, and Claude Desktop, including local PDF, DOCX, and XLSX redaction.Browser extension (maskera.dev/tjanster / English): masks locally inside ChatGPT, Claude, Gemini, Microsoft Copilot, Perplexity, Mistral and opt-in internal AI sites on Chrome, Edge and Firefox. Free tier included; paid plans via app.maskera.dev.
Related MCP server: phi-redact-mcp
Two layers, rules first
@maskera/core: deterministic detectors for structured Swedish PII (personnummer, samordningsnummer, organisationsnummer, phone, email, postnummer, bankgiro, plusgiro, IBAN, cards, IP, URL). Zero dependencies, synchronous, extensible viaregexDetector.maskera: everything in core plusmaskera-sv-ner(68 MB q4 ONNX). Catches free-text names, places, organisations and street addresses, including all-lowercase chat text and ALL CAPS.
Use before an LLM call
const { text: safePrompt, restore } = await redactWithNer(userInput, { recognizer })
const answer = await llm(safePrompt)
const result = restore(answer)Placeholders are stable within a call. For clinical text, pass profile: "clinical" to retain common measurements, doses and care terms. Runnable example: examples/llm-roundtrip.ts.
Benchmarks
Share of values hidden across four public Swedish corpora (measured 2026-11-30): the SUC 3.0 test split (National Library of Sweden), SIC2 Swedish blogs (Språkbanken Text), the MultiCoNER v2 Swedish test split (persons) and the Swedish rows of ai4privacy openpii. Raw results: docs/benchmark-independent-v24.json.
System | Names | Lowercase names | Places | Addresses + postcodes | Entity-free sentences with a hit (lower is better) |
Maskera v24 q4 (68 MB) | 97% | 92.8% | 97.3% | 95.2% | 4.4% |
Microsoft Presidio + sv spaCy | 72.3% | 71.4% | 97.1% | 47.0% | 2.5% |
swedish-pii 1.2.0 | 55.3% | 0.3% | 82.7% | 77.3% | 7.0% |
OpenAI Privacy Filter q4 | 52.2% | 10.3% | 33.5% | 63.3% | 3.5% |
Presidio's spaCy model is trained on SUC 3.0, one of the tests. Personnummer, bankgiro and IBAN have no independent Swedish corpus and are not in this table.
Full report and internal release gates: docs/BENCHMARKS.md.
Packages & docs
Package / doc | Purpose |
Zero-dep detectors + redact/restore engine | |
Swedish NER model + hybrid pipeline ( | |
Local MCP server, HTTP proxy, CLI, and PDF/DOCX/XLSX redaction | |
Self-hosting the model, thresholds, fallback and operational checklist | |
Privacy boundary and what runs where | |
Synthetic attestation, identifier rejection, KB-BERT boundary | |
Architecture, privacy model, measurements and GDPR positioning for DPOs/legal |
maskera is defense in depth, not a compliance guarantee. The model catches most free-text PII, but can miss edge cases.
Development
pnpm install
pnpm demo # live demo at http://localhost:5180
pnpm build && pnpm test
pnpm lint # biome + benchmark/privacy checks
pnpm smoke # pack tarballs, install fresh, test ESM+CJS
pnpm eval # grade published model against gold corpus
pnpm eval:domain # hybrid pipeline on 258-text synthetic domain corpus
pnpm eval:domain:clinical # same corpus with clinical precision profileRoadmap: docs/ROADMAP.md.
License
Code: MIT © Joel Hägvall. Model weights: MIT (base model KB-BERT is CC0, National Library of Sweden). See packages/ner/NOTICE.
Maskera is developed and maintained by Hägvall Labs AB (Stockholm, Sweden, reg. no. 559598-0110).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
AI Privacy Firewall: PII/secret leak scanner, hybrid cost estimator & reversible agent redaction.
Mask, restore and black out personal data in text and files, processed in the EU.
Scan prompts for injection attacks, redact PII, and audit LLM SDK usage from any MCP client
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceLocal-first CLI and MCP server for redacting sensitive text before sharing logs, configs, and errors with AI tools.MIT
- AlicenseAqualityCmaintenanceAn MCP server that redacts PII/PHI from text before it ever reaches an LLM — self-hosted, fail-closed, and HIPAA-aware.343 PyPIMIT
- AlicenseAqualityCmaintenanceLocal pseudonymisation MCP server that detects PII in text, replaces it with opaque tokens before sending to cloud LLMs, and restores tokens afterward.2127 npm2MIT
- AlicenseNot gradedqualityCmaintenanceLocal CLI and MCP server that redacts secrets from logs, files, and diffs before sending them to AI agents, with stable placeholders and token-budgeted truncation.MIT