MCP Connector

Redact Sensitive Data from PDFs for LLMs

Masquerade MCP redacts sensitive data from PDFs before they reach Claude, using Tinfoil's Llama 3.3 70B for detection.

Works with githubclaude

91
Spark score
out of 100
Updated Aug 2025
Source checked Aug 18, 2026
Version 1.0.0
Models
claudellama 3

Add to Favorites

Why it matters

Securely process PDF documents by automatically detecting and redacting sensitive information before sending them to LLM models, ensuring data privacy.

Outcomes

What it gets done

01

Detect and redact names, emails, and dates from PDF documents.

02

Generate redacted PDF files with sensitive areas highlighted.

03

Provide a summary of masked data and redaction counts per page.

04

Integrate with isolated AI platforms for sensitive data detection.

Source

Get it from source

Spark does not host a copy of it.

Open source

Reports

Agent outcome reports

No reports yet

Capabilities

Tools your agent gets

redact_pdf

Detects and redacts sensitive data (names, emails, dates, entities) from PDF documents

preview_redactions

Previews redacted data and sensitive areas before sending PDF to LLM

generate_redacted_pdf

Generates a redacted PDF file with sensitive areas highlighted

get_redaction_summary

Provides summary with masked sensitive data and redaction count per page

Overview

Masquerade MCP Server

Masquerade MCP redacts sensitive data from a PDF before Claude sees it, using Tinfoil's Llama 3.3 70B to detect names, emails, dates, and entities. Use it when Claude needs to work with a sensitive PDF, such as a contract or medical record, without seeing the raw unredacted content.

What it does

Masquerade MCP is a privacy firewall for files fed to Claude. Given a PDF's file path, it converts the PDF to text, sends that text to Tinfoil, an isolated AI platform running Llama 3.3 70B, to detect sensitive data such as names, emails, dates, and entities, then redacts what it finds and produces a redacted PDF you can preview before ever letting Claude see the original.

When to use - and when NOT to

Use it when you need Claude to work with a PDF that contains sensitive material - contracts, medical records, or internal documents - and you want the sensitive content stripped out before the model ever sees it, rather than uploading the raw file directly. It requires Claude Desktop and a Tinfoil API key, and processes files by path rather than by upload, so the workflow is: ask Claude to redact a PDF by path, review the redacted output, then manually upload the redacted version if you're satisfied. It is not an automatic pipeline - the redacted PDF still needs a manual review-and-upload step, by design, so a human stays in the loop before anything reaches the model.

Capabilities

The core flow runs as one request: Claude reads a PDF's file path, converts it to text, and sends that text to Tinfoil for sensitive-data detection. Masquerade then removes what Tinfoil flags and creates a redacted PDF, returning Claude a summary that includes masked versions of the sensitive data found, redaction counts per page, and the path to the redacted file, so you can judge the redaction quality before deciding to upload the cleaned file for further Q&A.

How to install

Install Claude Desktop and get a Tinfoil API key first. The automated path runs a setup script:

curl -O https://raw.githubusercontent.com/postralai/masquerade/main/setup.sh && bash setup.sh

then restart Claude Desktop. For manual setup: create a Python 3.10-3.12 virtual environment, install the repo with pip install git+https://github.com/postralai/masquerade@main, then either run python -m masquerade.configure_claude to automate the Claude config, or manually add your Python path, the MCP file's path, and your TINFOIL_API_KEY to claude_desktop_config.json.

The intended usage pattern is explicit in the project's own instructions: prompt Claude with the file path, let it open the redacted and highlighted PDFs for review, and only then manually upload the redacted file for querying - never the original.

Who it's for

Anyone who needs Claude to analyze sensitive PDFs - legal, medical, or internal documents - without exposing the raw, unredacted content to the model, and wants a preview-and-approve step before any redacted file is uploaded. It is released under the MIT License.

Source README

Masquerade MCP: Redact. Replace. Retain Control.

Demo video

🤐 Problem: Tools like Claude or GPT are incredibly powerful, but they require raw input. If you're dealing with contracts, medical records, or internal documents, that's risky.

🛡️ Solution: Masquerade acts as a privacy firewall for your files. Just paste in the file path to a PDF, and Masquerade will:

  • Automatically detect sensitive data (names, emails, dates, entities)
  • Redact the sensitive data
  • Let you preview before sending to an LLM

Architecture

Image

  1. User Input: The user asks Claude to redact a PDF by providing its file path.
  2. PDF Processing: MCP reads the PDF and converts it to text.
  3. Sensitive Data Detection: The text is sent to Tinfoil (an isolated AI platform using Llama 3.3 70B) to identify sensitive data.
  4. Redaction: MCP removes the sensitive data and creates a redacted PDF.
  5. Summary Return: MCP sends Claude a summary with:
    • Masked versions of the sensitive data
    • Redaction counts per page
    • The path to the redacted file
  6. Quering PDF with Claude: The user can upload the redacted PDF to Claude if satisfied with the redactions.

Installation

Setup video

  1. Install Claude desktop
  2. Get Tinfoil API key (create account and API key)
  3. Configure environment
Option 1: Automated
curl -O https://raw.githubusercontent.com/postralai/masquerade/main/setup.sh && bash setup.sh
  1. Restart Claude desktop app (if successfully configured)
Option 2: Manual (click to expand)
  1. Create a virtual environment with Python ">=3.10, <=3.12"
python3.12 -m venv pdfmcp
source pdfmcp/bin/activate
python --version
  1. Install this repo with the command below
pip install git+https://github.com/postralai/masquerade@main
  1. Automate the Claude config setup (and skip the next steps)
python -m masquerade.configure_claude
  1. Get Python path: which python
  2. Get MCP file path: python -c "import masquerade as m; print(f'{m.__path__[0]}/mcp_pdf_redaction.py')"
  3. Add (1) Python path, (2) MCP file path, and (3) Tinfoil API key to the JSON below and add that to claude_desktop_config.json. Instructions to find the config file are in the image below.
  4. Restart Claude
{
  "mcpServers": {
    "pdf-redaction": {
      "command": "/path/to/python", // Run `which python`
      "args": ["/path/to/mcp_pdf_redaction.py"], // Run `python -c "import masquerade as m; print(f'{m.__path__[0]}/mcp_pdf_redaction.py')"`
      "env": {
        "TINFOIL_API_KEY": "your_api_key" // Create Tinfoil account and paste API key
      }
    }
  }
}

Image

How to use?

  1. Prompt Claude: "Redact sensitive information from this PDF: /path/to/filename.pdf"
  2. MCP opens the redacted and highlighted PDF files
  3. Manually upload the redacted PDF to Claude for quering

Note: Don't upload the original PDF to Claude, only the file path.

Need Help?

For questions and common issues, please see the FAQ section or open an issue on GitHub.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.