Skip to main content

A MCP server library to provide Document Redaction and Data replacement capabilities to AI Agents

Project description

Redaction-MCP

Introduction

Redaction-MCP is a document redaction that can be used for Sensitive Data Redaction and Sensitive Data Replacement capabilities for a wide range of documents.

It is primarily designed to be used by AI agents via MCP adapters to provide document redaction and scrubbing capabilities to intelligent document processing systems using AI agents or agentic workflows.

Scope of the project

This project is aimed to be made into a full-fledged document "Sensitive Data Protection" MCP suite focused on inspection, de-identification and de-sensitization of documents. It will support various document formats such as PDF, PPT, DOCX, TXT, etc. The scope of this MCP server is to provide SDP functionalities to the AI agents and Agentic workflows.

ALso, A VERY IMPROTANT NOTE is that while this project is quite good at providing said capabilities to AI agents, but when talking about production-scenario, organisations often require much specific and customized capabilities which is out of scope of this project.

If you are going to build a SDP tool-set or suite of enterprise level, I would suggest creating a custom capabilities pipeline, as they often see a lot more success than generic SDP suites.

Requirements

  • Python 3.12 or newer
  • uv (recommended) or a Python environment with the dependencies installed

How to run the server

There are two methods exposed for MCP server - STDIO and HTTP modes.

MCP over STDIO

Use this when an MCP client launches Redaction-MCP as a local subprocess:

uv run redaction-mcp-stdio

For example, an MCP client command can use:

{
  "command": "uv",
  "args": ["run", "--directory", "/absolute/path/to/redaction-mcp", "redaction-mcp-stdio"]
}

The server provides one tool, redact, with the same request and response schema as the FastAPI API.

MCP over HTTP

Start the streamable HTTP MCP server:

uv run redaction-mcp-http

It listens on 127.0.0.1:8000 by default and exposes MCP at /mcp. Configure the bind address or port with MCP_HOST and MCP_PORT:

MCP_HOST=0.0.0.0 MCP_PORT=8000 uv run redaction-mcp-http

Development setup

Install the application and development dependencies:

uv sync --extra dev

Run the test suite:

uv run python -m pytest --cov=src --cov-report=html

Start the Fast API server on port 8080:

uv run redaction-fastapi

- or -

python -m uvicorn src.server.main:app --port 8080

Once running, interactive OpenAPI documentation is available at http://127.0.0.1:8080/docs.

Endpoints:

Method Path Purpose
GET /health Liveness check, returning {"status":"ok"}.
POST /redact Redact a PDF and return the result as base64.
  • Note - Also check DEVELOPMENT.md for more information on the porject development.

Questions?

  • If you have any questions or need any improvements/bug fixes, please raise a new GitHub issue stating the context.
  • I'll try to follow up as soon as I can, but it may still be not very fast for some people. Please gimme time, me slow :)

Happy Coding!!!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

redaction_mcp-0.1.1.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

redaction_mcp-0.1.1-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

Details for the file redaction_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: redaction_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.4

File hashes

Hashes for redaction_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d43efd2cf1bb18eb1d78da0196717396b770d67d63199cf846b480c1ce237426
MD5 24b46abb962833485ae41a2eaef374ce
BLAKE2b-256 c9b452304c998673d022f479e330a97aba37312c771c610f3440fa6cbafec8cf

See more details on using hashes here.

File details

Details for the file redaction_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: redaction_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 31.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.4

File hashes

Hashes for redaction_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a6c0641a13f5fa4939a36bcbd1a6fd2aa737fa3b1b2142b0876f6e0a26a84a30
MD5 c8defcaae6419a5d2ef05d6cc1d87008
BLAKE2b-256 94a331d3807c356e094d36b49ba047709091a0dc1f2370c6bc6ad7a12178d38c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page