# Redacta

> Redacta — a Claude/Agent Skill that pseudonymises medical documents before AI processing

- **Type:** MCP server
- **Install:** `agentstack add mcp-nickjlamb-redacta`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [nickjlamb](https://agentstack.voostack.com/s/nickjlamb)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT-0
- **Upstream author:** [nickjlamb](https://github.com/nickjlamb)
- **Source:** https://github.com/nickjlamb/redacta
- **Website:** https://www.pharmatools.ai/redacta

## Install

```sh
agentstack add mcp-nickjlamb-redacta
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Redacta

[](https://doi.org/10.5281/zenodo.21115605)

Pseudonymise medical and clinical documents before they're processed by AI or
shared. Redacta replaces patient identifiers with labelled tokens —
`[PATIENT_NAME_1]`, `[NHS_NUMBER_1]`, `[DATE_OF_BIRTH_1]`, … — while leaving the
clinical meaning intact, and returns a redaction report alongside the cleaned
text.

It started as an [Agent Skill](https://agentskills.io) and is now one engine
shipped across eight surfaces — an iOS app, agent skill, MCP server, two
libraries, a CLI, and two whiteboard apps.

## One engine, many surfaces

  

| Surface | Folder | Get it |
|---------|--------|--------|
| iOS app — iPhone (app, Share Extension, widget) | [`ios-app/`](ios-app/) | Build with Xcode — see [`ios-app/README.md`](ios-app/README.md) |
| Agent skill (Claude Code / apps / API) | `SKILL.md`, `scripts/` | `openclaw skills install redacta` ([ClawHub](https://clawhub.ai/nickjlamb/redacta)) |
| MCP server (Claude Desktop, Cursor, …) | `mcp-server/` | `npx -y redacta-mcp` ([npm](https://www.npmjs.com/package/redacta-mcp) · [MCP Registry](https://registry.modelcontextprotocol.io) · [Anthropic MCP Directory](https://claude.ai/directory/connectors/ant.dir.gh.nickjlamb.redacta)) |
| TypeScript library | `npm-package/` | `npm i @pharmatools/redacta` ([npm](https://www.npmjs.com/package/@pharmatools/redacta)) |
| Python library | `python-package/` | `pip install redacta` ([PyPI](https://pypi.org/project/redacta/)) |
| Command-line tool | `cli-package/` | `npx redacta-cli` ([npm](https://www.npmjs.com/package/redacta-cli)) |
| Miro app | `miro-app/` | [getpatiently.ai → Redacta](https://www.pharmatools.ai/redacta) |
| FigJam plugin | `figjam-plugin/` | [Figma Community](https://www.figma.com/community/plugin/1647311189828426124) |

The detection logic lives in one place — the TypeScript engine
(`@pharmatools/redacta`, in `npm-package/`), which the MCP server and both
whiteboard apps consume, and which the iOS app runs on-device via JavaScriptCore.
The Python package mirrors it for `pip` users; the agent skill adds LLM reasoning
for free-text names on top of the deterministic patterns.

## How it works

Two layers:

- **Patterns (deterministic).** A bundled script (`scripts/redact_structured.py`,
  Python standard library only, no network) matches fixed-format identifiers:
  NHS numbers (Modulus-11 validated), UK National Insurance numbers, dates of
  birth, UK postcodes, phone numbers, emails, and hospital/MRN numbers. US SSN
  and ZIP codes are also handled.
- **Reasoning (judgement).** The skill then has the agent handle what patterns
  can't: patient names (told apart from the clinicians treating them), relatives
  and carers, postal addresses, and identifying ages.
- **Self-check.** A final pass re-reads the output for any identifier that slipped
  through before the report is written.

It also works in reverse. **Re-identification** (`scripts/reinstate.py`) takes the
token map from an earlier redaction and restores the original values — so you can
redact a document, run it through another AI tool, and put the real details back
locally. Redact → process → re-identify is a complete round trip, and identifiers
only ever exist on your machine.

**Safe Harbor mode.** Ask for HIPAA Safe Harbor (or "US de-identification") and
Redacta applies a stricter pass: *all* dates (not just the date of birth), all
specific ages, and the remaining HIPAA identifiers — fax, certificate/licence,
device serial, VIN, and health-plan beneficiary numbers.

## Install

**Claude Code**

```bash
git clone https://github.com/nickjlamb/redacta ~/.claude/skills/redacta
```

Then invoke it with `/redacta`, or let it trigger automatically when you ask to
redact or de-identify clinical text.

**Claude apps / API**

Zip the repository folder and upload it as a skill.

## Contents

| Path | What it is |
|------|------------|
| `SKILL.md` | The skill — instructions plus metadata |
| `reference.md` | Pattern specs, the Modulus-11 algorithm, NI prefix rules, the date-of-birth vs clinical-date rule, token vocabulary, limitations |
| `scripts/redact_structured.py` | The deterministic pattern layer |
| `scripts/reinstate.py` | The re-identification layer (restore originals from a token map) |
| `scripts/test_redact_structured.py` | Tests for the pattern layer |
| `scripts/test_reinstate.py` | Tests for the re-identification layer |
| `evaluations.json` | Example evaluation scenarios |

Run the tests:

```bash
python3 scripts/test_redact_structured.py
python3 scripts/test_reinstate.py
```

## A note on limits

Redacta is a strong first line of defence, not a guarantee. It won't catch every
possible identifier and isn't a substitute for formal data-protection processes.
Always review the redaction report before sharing text.

## License

[MIT-0](LICENSE) (MIT No Attribution). Built by
[PharmaTools.AI](https://www.pharmatools.ai/redacta).

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [nickjlamb](https://github.com/nickjlamb)
- **Source:** [nickjlamb/redacta](https://github.com/nickjlamb/redacta)
- **License:** MIT-0
- **Homepage:** https://www.pharmatools.ai/redacta

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-nickjlamb-redacta
- Seller: https://agentstack.voostack.com/s/nickjlamb
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
