MCP server for Australian PII detection and sanitisation — TFN, Medicare, ABN, ACN, BSB, bank account, drivers licence, passport, Centrelink CRN, and address recognisers with checksum validation, compliance audit logging, built on Presidio
Server demonstrates solid definition quality with well-structured tool schemas, comprehensive parameter descriptions, and clear use-case guidance. All 5 tools have explicit descriptions (50-300 chars) and complete input schemas with typed parameters. Tool names follow verb_noun convention (detect_pii, sanitize_text, sanitize_document, detokenize_text, list_supported_entities). Descriptions include WHEN to use each tool and distinguish between similar tools (e.g., detect_pii vs sanitize_text). However, output schemas are not formally documented in the source code, they are inferred from Pydantic models (DetectPiiResult, SanitizeTextResult, etc.) but not visible in the tool registration. Error handling returns structured dicts with 'error' and 'scan_id' fields, but lacks actionable recovery guidance (e.g., 'Try with lower min_confidence'). Security is strong: no credentials in parameters, audit logging built-in, and tokenization prevents PII exposure in logs.
Scan text and return all detected PII entities without modifying the text. Use this tool when you need to inspect what PII exists in text before deciding what to do with it. Returns entity types, positions, and confidence scores. Do NOT send text that has already been sanitised — it will find nothing. Do NOT use this if you want the text cleaned; use sanitize_text instead.
Reverse tokenisation: restore original PII values from a tokenized text using the token mapping stored during sanitize_text or sanitize_document. When you sanitise text in "tokenize" mode, PII is replaced with stable tokens like {{EMAIL_1}}, {{PERSON_2}}, etc., and a mapping is stored server-side keyed by scan_id. This tool reverses that process — it looks up the mapping and restores the original values. WARNING: This tool exposes original PII. Use only in trusted, secure contexts (e.g. internal audit, compliance review). Never expose the result to untrusted users or external systems.
List all PII entity types supported by this server, with descriptions, compliance frameworks, and examples. Use this to discover what entity types are available for filtering in detect_pii and sanitize_text. Includes both standard Presidio entities (PERSON, EMAIL_ADDRESS, CREDIT_CARD, etc.) and custom Australian/New Zealand entities (AU_TFN, AU_MEDICARE, AU_ABN, AU_ACN, AU_DRIVERS_LICENCE, AU_PASSPORT, AU_BSB, AU_BANK_ACCOUNT, AU_ADDRESS, AU_PHONE_NUMBER, CENTRELINK_CRN, NZ_IRD, NZ_NHI, NZ_DRIVERS_LICENCE).
Recursively scan and sanitise all string values in a structured document (dict, list, or nested combination). This is the tool to use when you have JSON, YAML, or other structured data containing PII. Walks the entire document tree, sanitising every string field while preserving structure and non-string values. Optionally skip specific fields (e.g. "id", "timestamp") that should not be scanned. Returns the sanitised document plus a summary of what was found and removed.
Output schemas not formally documented in tool registration. Return types are inferred from Pydantic models (DetectPiiResult, SanitizeTextResult) but not visible in @mcp.tool() decorators. LLMs cannot see what fields to expect without reading implementation code.
Error responses lack actionable recovery guidance. When detect() or sanitize() fails, the tool returns {'error': str(e), 'scan_id': scan_id} with no hint about what the LLM should try next (e.g., 'Lower min_confidence', 'Check language code', 'Verify text is not already sanitized').
detokenize_text lacks a dry-run or confirmation step. This tool exposes original PII values, a critical security operation. The description warns 'Use only in trusted contexts' but the tool itself has no confirmation mechanism to prevent accidental exposure.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 59 | <=2025-11-25 | v2 |
Detect and remove PII from text in a single operation. This is the most commonly used tool — call it when you need clean text safe to pass to an LLM, store in a database, or include in a response. Three modes: - "redact": replaces PII with [REDACTED:TYPE] labels (safest, default) - "replace": replaces PII with Presidio's default type-labelled placeholders - "tokenize": replaces PII with stable tokens like {{EMAIL_1}} (useful if you need to reference the same entity later without exposing the value). Use detokenize_text with the returned scan_id to reverse tokenisation. Do NOT send already-sanitised text through this tool again. Do NOT use this for structured documents (dicts/JSON) — use sanitize_document.
sanitize_document parameter 'document' accepts type 'object' but lacks format/constraint documentation. LLMs may pass invalid structures (e.g., non-JSON-serializable objects). Description should specify 'dict, list, or nested combination of both' and note that non-string values are preserved.
In-memory token mapping store (_token_mappings) is session-scoped and lost on server restart. No documentation of this limitation in detokenize_text description. If an agent calls sanitize_text in tokenize mode, then the server restarts, detokenize_text will fail silently with 'scan_id not found', no recovery path.