eu-pii-redact
One MCP server that keeps European personal data out of LLM conversations by redacting text and files, with local restore afterwards.
redact_text— redact a string and get back the redacted text plus detected entities (type, position, placeholder); original values are never returned. Choosemode(label→[TYPE_n]ormask→ asterisks) and restrict to specifictypes.redact_file— redact a UTF-8 file into a new file without its contents entering the conversation; returns only counts per type. Optionally writes a<output_path>.map.jsonmapping (owner-only permissions) for later restore, and canoverwrite.restore_file— put the original values back into a file using the mapping, entirely locally (no API call); returns only how many placeholders were restored, not the values. Useful for edited redacted files or LLM answers saved to disk.Detectable types —
PERSON,EMAIL,PHONE,IBAN,CREDIT_CARD,EU_VAT,NATIONAL_ID,IP_ADDRESS(all by default).
Provides a LangChain integration that wraps models or chains to redact PII before LLM processing and restore original values in responses, and includes a transformer for redacting documents before indexing for RAG.
Integrates with the EU PII Redaction API hosted on RapidAPI to detect and redact European personal data such as names, national IDs, IBANs, cards, VAT numbers, emails, phones, and IPs, with restoration support.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@eu-pii-redact redact ./support/ticket.txt and save the redacted copy next to it"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
eu-pii-redact
Keep European personal data out of LLM prompts and logs, and put it back in the answer. Python client, LangChain integration and MCP server for the EU PII Redaction API. Try it live without signing up · Quickstart · Privacy and data processing
Hi, my name is Karina Dahl. I was charged twice for order 88412.
Please refund to DK50 0040 0440 1162 43 or call me on +45 32 12 34 56.
Karinabecomes
Hi, my name is [PERSON_1]. I was charged twice for order 88412.
Please refund to [IBAN_1] or call me on [PHONE_1].
[PERSON_1]Names from evidence, not capital letters: titles, greetings, roles,
Name:labels, sign-offs, or a first name from 140,000 European names. "Best Practices" and "Court of Justice" stay as they are.National ID numbers from 21 EU/EEA countries, checked by check digit and birth date (personnummer, HETU, DNI/NIE, codice fiscale, NIR, PESEL, BSN, CPR, ...).
IBANs (mod-97), cards (Luhn), EU VAT numbers, emails, phones (with + prefix), IPs.
Every mention of a person shares one placeholder; order and invoice numbers stay untouched.
You need a RapidAPI key with a plan for the API. The
free plan gives 500 requests a month.
Set it as RAPIDAPI_KEY.
Python
pip install eu-pii-redactfrom eu_pii_redact import Redactor
with Redactor() as r: # reads RAPIDAPI_KEY
redaction = r.redact(ticket)
reply = ask_llm(redaction.text) # the model only sees placeholders
print(redaction.restore(reply)) # real values back in the answerredaction.entities lists each finding with its type, offsets in the original text and placeholder
(national IDs also carry country and scheme). Texts longer than 50,000 characters are sent in pieces
with consistent placeholders. r.redact(text, types=["EMAIL", "IBAN"], mode="mask") masks with asterisks.
Related MCP server: privacyscrubber-mcp
LangChain
pip install "eu-pii-redact[langchain]"from eu_pii_redact.langchain import protect, PIIRedactionTransformer
safe_llm = protect(llm) # any model or chain that takes a string
safe_llm.invoke("Draft a reply to Karina Dahl about her refund to DK50 0040 0440 1162 43")
# the model sees [PERSON_1] and [IBAN_1]; the returned message has the real values again
docs = PIIRedactionTransformer().transform_documents(docs) # e.g. before indexing for RAGMCP server
Lets an AI assistant redact text and, more importantly, files without reading them:
redact_file reads and writes the file itself and only reports counts, so the personal data
never enters the conversation. restore_file puts the values back locally.
Tool | What it does |
| Redact a text; returns the redacted text and entities (no original values) |
| Redact a UTF-8 file into a new file; writes a restore mapping (owner-only permissions) |
| Put the original values back into a file using that mapping, offline |
Claude Desktop (one click): download eu-pii-redact-0.1.0.mcpb from the
latest release, open it, and paste
your RapidAPI key when asked. The bundle sources are in mcpb/.
Claude Code
claude mcp add eu-pii-redact -e RAPIDAPI_KEY=your-key -- uvx eu-pii-redactClaude Desktop / Cursor / other hosts (mcpServers config)
{
"mcpServers": {
"eu-pii-redact": {
"command": "uvx",
"args": ["eu-pii-redact"],
"env": { "RAPIDAPI_KEY": "your-key" }
}
}
}Postman
Fork the public collection from the
EU PII Redaction workspace (or import
postman/eu-pii-redaction.postman_collection.json), set the collection variable rapidapi_key, and send:
four requests with example responses and built-in tests.
Limits
Rule-based, which keeps it fast (about 0.1 s for 50,000 characters) and predictable: no street addresses yet, phone numbers need an international prefix, and a name without any cue whose surname is an English word ("Will Smith") is missed on purpose. Use it as a strong first layer, not as a compliance guarantee.
License
MIT for this client package. The API itself is a hosted service.
Available Tools
3 toolsredact_fileA
Redact a text file into a new file without showing its contents. Returns only counts per type, so the personal data never enters the conversation.
Inputs: input_path (required), output_path (required), types, overwrite, +1 more.
redact_textARead-only
Redact personal data in a text and return the redacted text plus the detected entities (type, position, placeholder). Original values are not returned.
Inputs: text (required), mode, types.
restore_fileA
Put the original values back into a file, locally (no API call). Returns only how many placeholders were restored, not the values.
Inputs: input_path (required), output_path (required), mapping_path (required), overwrite.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct target and operation: redact_text for text, redact_file for files, restore_file for reversing file redaction. There is no overlap in purpose; an agent can easily select the correct tool.
All tool names follow a consistent snake_case verb_noun pattern (redact_text, redact_file, restore_file). The convention is predictable and uniform.
Three tools are well-scoped for a focused PII redaction server: one for text, one for files, one for restoration. Each tool earns its place without redundancy.
Core redaction and file restoration are covered, but redact_text lacks a corresponding restore operation (unlike redact_file), and no batch or structured-data redaction exists. These are minor gaps given the narrow scope.
Maintenance
Related MCP Connectors
Detect and redact PII and secrets before text reaches an LLM, with reversible placeholders.
Mask, restore and black out personal data in text and files, processed in the EU.
Find and redact leaked secrets, wallet keys and PII before an AI agent sends text.
Redact personal data from text before your agent sends it to a model or stores it: names, contact details, ID numbers, financial and health identifiers, card numbers, plus any exact terms you add. Nothing stored, no third-party AI. Tools - redact_text: returns the redacted text and a count of what was removed, by type. Never the removed values. Options: restrict to particular data types, add exact terms to remove, choose the replacement style (a type label such as <PERSON> by default) and set a confidence threshold. - list_entity_types: lists the detectable data types. Free. Data handling - Nothing you send is stored. Text is processed in memory and discarded when the call returns. - No third-party AI. Text is never sent to OpenAI, Anthropic, Google or any other outside model. - Tool arguments are never logged. Only counts are kept: credits used, a timestamp and how many of each type were found. PDFs, including scanned pages, are handled by the REST API with the same key and credits. They aren't offered as an MCP tool because a file doesn't fit in a tool call. Pricing: 1 credit per call plus 1 per 1,000 characters. 10 free credits on sign-up, no card. Credit packs from $5; purchased credits never expire. Failed calls and repeated identical calls are free. Setup and API key: https://eleyed.com/mcp?utm_source=glama&utm_medium=directory&utm_campaign=listing
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to redact PII from text, summarize redacted content, and manage custom redaction patterns across multiple languages.-
- AlicenseBqualityBmaintenanceZero-Trust local PII & secrets masking MCP (ZTDS RFC v1.0). Zero server logs. Features: 23 zero-trust tools, 30 industry profiles, offline OCR, RAM-only masking. Run: npx -y @privacyscrubber/mcp-server. Website: https://privacyscrubber.com SDK: https://www.npmjs.com/package/@privacyscrubber/sdk423794 npm274 PyPI3MIT
- AlicenseBqualityCmaintenanceEnables AI assistants to mask personal data in local Turkish documents by accepting a local file path (TXT, MD, DOCX, or text PDF) and returning pseudonymized text such as [KISI-1] and [TCKN-1] instead of the original values. Tools scan for PII types, produce masked output, and restore real values into a local file without ever returning plaintext to the model.41MIT
- AlicenseAqualityAmaintenanceEnables agents to detect and redact PII and secrets in text, HTML, and PDF documents before they reach an LLM, with reversible placeholder, mask, or hash redaction, and to list supported detectors and redaction styles.4MIT