Skip to main content

Redaction MCP

Find sensitive text in a document, then permanently redact it or replace it with sample data. Use it from an MCP client such as ChatGPT, or through the FastAPI server. It supports text-based PDFs, DOCX, PPTX/PPTM, TXT, CSV, and XLSX.

How it works: document → inspect_document → redact or replace → check the output.

With an AI agent

In the ChatGPT session, the agent identified the invoice fields, used Redaction MCP to remove them, verified the output, and returned the updated PDF. The metadata cleanup shown in the chat was a separate step performed by the agent.

ChatGPT conversation showing an agent using Redaction MCP to redact invoice fields, check the PDF, and return the finished file

See it work

In this sample invoice, the invoice number, date, and product quantities are removed while the rest of the layout stays readable.

Before After redaction
Sample invoice showing number 1213, date 16.12.2021, and product quantities 222 and 34 Same invoice with those four values covered by black redaction bars

The PDF engine also handles text at an angle, text that overlaps other text, and colored text. Replacement removes the original value and inserts a new one.

Before After redaction or replacement
Examples of rotated text, overlapping text, blue text on a colored background, and code AB-129 Rotated and colored text redacted, overlapping K preserved, and AB-129 replaced with BC-230

The images above are sample PDFs processed by this project. In the last row, AB-129 becomes BC-230 using the REGEX replacement mode.

Install and use

Requires Python 3.12 or newer.

python -m pip install redaction-mcp

Start the MCP server in HTTP mode:

redaction-mcp-http

Local MCP clients can connect to http://127.0.0.1:8000/mcp. For a client that launches its own server process, use redaction-mcp-stdio. To use ChatGPT, make the HTTP endpoint available at a reachable HTTPS URL and add that URL as an MCP connection.

Then attach a document and ask, for example:

Redact the invoice number, invoice date, and product quantities from this PDF. Check the resulting document before returning it.

The server exposes inspect_document, redact, and replace tools. Keep the original file and check the output, including PDF metadata, before sharing it. See DEVELOPMENT.md for API requests, large-file jobs, and configuration.

Limitations

PDF support is for text-based PDFs. Scanned PDFs need a specialized PII detection and removal pipeline with OCR, structure analysis, a custom redaction or replacement engine, and generation of a new document. For more information about such solutions, contact me at zhimanshuk135@gmail.com.

Metadata

Release files for redaction-mcp 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for redaction-mcp 1.1.0
File Size Uploaded Provenance Actions
redaction_mcp-1.1.0.tar.gz 52.4 kB With provenance Details for redaction_mcp-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for redaction-mcp 1.1.0
File Interpreter ABI Platform Actions
redaction_mcp-1.1.0-py3-none-any.whl Python 3 none any Details for redaction_mcp-1.1.0-py3-none-any.whl

Total release size: 103.4 kB

Release files / redaction_mcp-1.1.0.tar.gz

Download URL redaction_mcp-1.1.0.tar.gz
Size 52.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ee5af4704ceb3a04401939a31298d8305345974909a51dc6d08d2ffec85d0397
BLAKE2b-256 checksum
How to use checksums
085e7287b800ce3daee3ce48769788c0afd63b7856f87a5ab5090a013cc4bee3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / redaction_mcp-1.1.0-py3-none-any.whl

Download URL redaction_mcp-1.1.0-py3-none-any.whl
Size 51.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32406d9a65bf3a68827f8450bcd6f3575df0797ceae648d3f6f09f338523c81e
BLAKE2b-256 checksum
How to use checksums
e1b86edf7d9b787746b0d72165e0c582fcbbde7de321200d77fb82d365915858
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for redaction-mcp 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for redaction_mcp-1.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page