Pattern-based PII redaction for MCP servers — FastMCP middleware (Tier 1)
Wellknown found it in public sources; nobody has proven control of it yet. Claiming takes one click if the repository is under your GitHub account, or a small file on your domain otherwise. Verified owners get the badge, 15-minute checks, status alerts, edits that outrank crawled data, and a ranking boost.
Agents can do it too: POST https://wellknown.network/api/v1/claims with {"agent":"pii-mcp","method":"well_known_file"} — machine-readable steps at claim.json, guide at /docs/claim.
Everything here was measured by our prober or read from a registry. Nothing is self-reported.
Attributed to the source that supplied each field. Treated as claims, not facts.
# pii-mcp Pattern-based PII redaction for MCP servers (regex + checksums). Masks emails, IBANs, cards, BICs, MACs, IMEIs, IPs, coordinates, BSNs, Belgian national register numbers, US SSNs and ITINs, UK National Insurance and NHS numbers, German tax IDs, Dutch BTW-ids, Dutch and German passport/ID numbers, phones, street + house number addresses, Dutch and UK postcodes, and Dutch license plates in tool results. Also masks credentials (API keys, JWTs, `Bearer` tokens) as `[SECRET]`. Language packs: `en`, `nl`, and opt-in `de`. [](https://pypi.org/project/pii-mcp/) [](https://www.npmjs.com/package/pii-mcp) [](https://github.com/foro-sh/pii-mcp/actions/workflows/ci.yml) [](https://opensource.org/licenses/MIT) [](https://github.com/foro-sh/pii-mcp) If pii-mcp saves you time, a ⭐ helps others find it. ## Example ```python from pii_mcp import scrub_text scrub_text( "Contact [email protected]. IBAN NL91 ABNA 0417 1643 00. card 4111111111111111" ) # Contact [EMAIL]. IBAN [IBAN]. card [CREDIT_CARD] ``` For runnable scripts including a FastMCP server and payload scrubbing, see the [`examples/`](examples/) directory. ## Install ```bash pip install "pii-mcp[fastmcp]" # FastMCP >= 3.0.0 # or pip install pii-mcp # core; platform wheels include Rust acceleration # or npm install pii-mcp ``` ### FastMCP ```python from fastmcp import FastMCP from pii_mcp.fastmcp import PiiScrubMiddleware mcp = FastMCP("MyServer") mcp.add_middleware(PiiScrubMiddleware()) # languages=["en", "nl"] by default # mcp.add_middleware(PiiScrubMiddleware(languages=["en", "nl", "de"])) ``` Results only. On scrub failure or oversize, the result is withheld, never f…
Mapped onto the structured taxonomy from declared text and observed tool names. Confidence shown for derived entries.
Every source is kept verbatim. Field changes are logged as events.