redacta-mcp
v2.1.1Keep patient identifiers out of AI agent context — a local privacy boundary for healthcare agents.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
protect Protect text (mapping stays server-side)
Redact patient identifiers and PII, replacing each distinct value with a labelled token ([NHS_NUMBER_1], [PATIENT_NAME_1], ...). The reversal mapping is kept privately inside the Redacta server and is NEVER included in this response — you receive only the protected text, an opaque session_id for later controlled restoration, a count of what was replaced, and a self-check of possible leftovers. Sessions expire automatically.
| Parameter | Type | Description |
|---|---|---|
text * | string | The text to protect. |
categories | array | Which pattern sets to apply. Defaults to clinical + general. 'clinical' = NHS/NI/DOB/MRN/postcode/SSN/ZIP/email/phone/names; 'general' = URLs, IPs, payment cards, IBANs, account numbers, vehicle regs;… |
release_to_file Restore identifiers into a local file
Restore original identifiers into text produced from a protected session, writing the result to a file inside the server's configured release directory (REDACTA_RELEASE_DIR). Returns only a receipt — file path, size, and counts — so restored data never enters the model context. This is the privacy-preserving way to complete the round trip.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | The session_id returned by protect. |
text * | string | Text containing Redacta tokens to restore. |
check_output Check output for leaked identifiers
Scan generated text for verbatim reappearance of the original values held in a protected session (tolerant of spacing, dashes and case for identifier-like values) and re-tokenise anything found. Returns which token categories leaked — never the raw values — plus the sanitised text and a general self-check. Scope is verbatim reappearance only: paraphrases and inferred identities are not detected.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | The session_id returned by protect. |
text * | string | Model output to inspect. |
discard_session Discard a protection session
Delete a session's private mapping immediately instead of waiting for expiry. Idempotent. After this, no restoration is possible for that session.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | The session_id to discard. |
redact Redact / pseudonymise text (legacy — exposes token map)
LEGACY: like protect, but returns the token_map (token -> original value) in the response, which places the reversal key in the client and potentially the model context. Kept for backward compatibility and client-managed workflows. Prefer protect, which keeps the mapping server-side.
| Parameter | Type | Description |
|---|---|---|
text * | string | The text to redact. |
categories | array | Which pattern sets to apply. Defaults to clinical + general. 'clinical' = NHS/NI/DOB/MRN/postcode/SSN/ZIP/email/phone/names; 'general' = URLs, IPs, payment cards, IBANs, account numbers, vehicle regs;… |
reinstate Re-identify from a client-held token map (legacy)
LEGACY: reverse a redaction using a token map held by the client (from the legacy redact tool). Restored personal data will appear in this tool result. For session-based restoration that keeps mappings server-side, use protect + release_to_file.
| Parameter | Type | Description |
|---|---|---|
text * | string | Text containing Redacta tokens to restore. |
token_map * | object | Token map, e.g. {"[NHS_NUMBER_1]": "943 476 5919"}. |
self_check Self-check for residual identifiers
Scan already-redacted text for anything that still looks like an identifier (long numbers, emails, postcodes, URLs). A second pair of eyes, not a guarantee. Returns a list of possible leftovers to review.
| Parameter | Type | Description |
|---|---|---|
text * | string | Redacted text to re-scan. |