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
# Choose a different port when needed:
redaction-mcp-http --port 9000

Local MCP clients can connect to http://127.0.0.1:8000/mcp by default, or http://127.0.0.1:9000/mcp with the example above. 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.2.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.2.0
File Size Uploaded Provenance Actions
redaction_mcp-1.2.0.tar.gz 53.4 kB With provenance Details for redaction_mcp-1.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 104.8 kB

Release files / redaction_mcp-1.2.0.tar.gz

Download URL redaction_mcp-1.2.0.tar.gz
Size 53.4 kB
Tags Source
SHA-256 checksum
How to use checksums
623fec9b9ce1904eadcd2ca0906e0ee041e7e4e50baa37733fe0c5e0a65968c8
BLAKE2b-256 checksum
How to use checksums
6ff6c708f60b3d9457f931609b879ec825ca35034bdac692528d69a426981b8d
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.2.0-py3-none-any.whl

Download URL redaction_mcp-1.2.0-py3-none-any.whl
Size 51.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d407dbb9cd6907fc2676474a8256537c7afec4ef4dcd6829e57226b5e51afb93
BLAKE2b-256 checksum
How to use checksums
5db653b6c5ded6eba31d10168c6e3f5e6c9075100563a843bb3ea52586de3e31
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.2.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.2.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