Skip to main content
Glama

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.
Karina

becomes

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-redact
from 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 answer

redaction.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 RAG

MCP 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_text

Redact a text; returns the redacted text and entities (no original values)

redact_file

Redact a UTF-8 file into a new file; writes a restore mapping (owner-only permissions)

restore_file

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-redact

Claude 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 tools
redact_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_textA
Read-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

    A4.2/5.0

    Scored across 3 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    All tool names follow a consistent snake_case verb_noun pattern (redact_text, redact_file, restore_file). The convention is predictable and uniform.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivitySlowing
    ResponsivenessOutdated data

    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.

      https://redactic.eu/mcp
    • 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

      https://eleyed.com/api/mcp

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Zero-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/sdk
      4
      23
      794 npm
      274 PyPI
      3
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      Enables 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.
      4
      1
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      Enables 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.
      4
      MIT