Permanently redact PII from PDFs and scans. EU/Swiss-hosted, never used to train AI models.
An MCP server that permanently redacts PII from PDFs. Give an agent a PDF, get back a PDF with the sensitive text removed from the file — not covered with a black rectangle that anyone can select, copy, or delete.
Most "redaction" MCP servers scrub PII out of prompt text. This one takes a real document and returns a real redacted document.
claude mcp add redact-pdf -- npx -y redact-pdf-mcp
Then ask: "Redact the personal data in ~/Documents/contract.pdf".
You are sending the document the agent is meant to protect, so this comes first.
ephemeral retention.
The redacted output is kept for your account's retention window (14 days by default,
configurable) and can be purged at any time with DELETE /v1/jobs/{job_id}.Details: redact-pdf.ai/security · privacy policy
An agent can find names in text. It cannot make a PDF safe on its own:
Prompts that work as-is once the server is installed:
pii_excluded_terms for the company name and fans
out with redact_pdf.The server ships a keyless tool, try_demo. Give it a file and it redacts the first
page for real — no key, no account — and tells the agent what it found:
You: Use the redact-pdf server's try_demo tool on ~/Documents/contract.pdf.
Claude: Redacted the first page of contract.pdf (4 pages). Personal data removed on that page: Person, Email. Here is the redacted page (link valid 14 days). To redact all 4 pages, a free account gets the first document (up to 5 pages) done in full, no card.
Call it with no file and it runs a built-in synthetic sample instead, which is the zero-configuration connectivity check. Same thing from a terminal, no install:
curl https://www.redact-pdf.ai/v1/demo
curl -F file=@contract.pdf https://www.redact-pdf.ai/v1/demo/redact
retention: "studio" keeps the detected masks so a
person can check and adjust them before export.claude mcp add redact-pdf --env REDACT_PDF_API_KEY=your_key -- npx -y redact-pdf-mcp
claude_desktop_config.json:
{
"mcpServers": {
"redact-pdf": {
"command": "npx",
"args": ["-y", "redact-pdf-mcp"],
"env": { "REDACT_PDF_API_KEY": "your_key" }
}
}
}
.cursor/mcp.json:
{
"mcpServers": {
"redact-pdf": {
"command": "npx",
"args": ["-y", "redact-pdf-mcp"],
"env": { "REDACT_PDF_API_KEY": "your_key" }
}
}
}
code --add-mcp '{"name":"redact-pdf","command":"npx","args":["-y","redact-pdf-mcp"],"env":{"REDACT_PDF_API_KEY":"your_key"}}'
Get an API key at redact-pdf.ai/sign-up. A free account
gets its first document (up to 5 pages) redacted in full, no card. Without a key,
try_demo still works; everything else will tell the agent to ask you for one.
| Tool | What it does |
|---|---|
redact_pdf_and_wait | Start here. Upload, redact, wait, return the finished PDF. One call. |
redact_pdf | Start a job and return immediately, for redacting several documents in parallel. |
get_job_status | Poll a job: uploaded → analyzing → redacting → redacted | error. |
download_redacted | Fetch the redacted output for one document. |
try_demo | Keyless. With a file: redact its first page for real. Without: run the built-in sample. |
get_account_status | Check the API key is valid and see the account, before a big batch. |
Redaction rules, on either redact tool:
| Argument | Effect |
|---|---|
pii_categories | Restrict to specific entity types. Omit for account defaults. |
pii_included_terms | Always redact these, even if not detected as PII (codenames, case numbers). |
pii_excluded_terms | Never redact these, even if detected (your own company name). |
retention | ephemeral (default) deletes the original after processing. studio keeps masks for human review. |
The package also ships a streamable-HTTP server for hosted use, where the API key travels per request instead of in the environment:
npx redact-pdf-mcp-http # listens on :8080/mcp
POST /mcp
X-API-Key: your_key (or: Authorization: Bearer your_key)
It is stateless — no sessions, no stored keys, nothing kept between requests — so each request gets its own short-lived server instance and one caller's key can never leak into another's tool call.
The handshake, tools/list, and try_demo work without a key, so a client can connect and
verify the server before anyone signs up; every other tool returns 401 with a
WWW-Authenticate challenge.
Documents are supplied as file_base64 (the remote server has no access to your
filesystem).
Fetching a document by URL is off by default on the remote server. The address check is real — URLs resolving to loopback, private, or link-local addresses are refused, and every redirect hop is re-checked — but the socket resolves the hostname a second time after that check, so a DNS-rebinding attacker with a short TTL can still have the server validate one address and connect to another. Closing that requires pinning the connection to the validated address, which is not implemented yet, so an internet-reachable server does not offer the surface at all.
Set REDACT_PDF_ENABLE_URL_INPUT=1 to accept file_url, and only where you have your own
egress controls (a network policy or allowlisting proxy) in front of the server.
REDACT_PDF_ALLOW_PRIVATE_URLS=1 additionally permits private addresses, for a
self-hosted instance fetching from internal storage.
stdio mode is unaffected: it runs on your own machine, where fetching a URL carries no privilege you do not already have.
| Variable | Default | Purpose |
|---|---|---|
REDACT_PDF_API_KEY | — | API key (stdio mode only; remote takes it per request). |
REDACT_PDF_BASE_URL | https://www.redact-pdf.ai | Point at a different API host. |
PORT | 8080 | HTTP server port. |
REDACT_PDF_MCP_PATH | /mcp | HTTP endpoint path. |
REDACT_PDF_ENABLE_URL_INPUT | unset | Accept file_url on the remote server. Off by default — see the DNS-rebinding note above. |
REDACT_PDF_ALLOW_PRIVATE_URLS | unset | Self-hosted only: permit file_url to reach private addresses. Never set this on a publicly reachable server. |
ephemeral retention the API deletes the original after processing.idempotency_key when you genuinely want a second, separate redaction of the same file.The full policy is at redact-pdf.ai/privacy. It covers the website, the app and the API this server calls. In short:
ephemeral retention the original is deleted
after processing; the redacted output follows your account's retention window (14 days
by default) and can be deleted at any time. Files sent to the keyless try_demo are
deleted after the first page is redacted; that page is kept 14 days.file_url
for anything large.pii_categories list is rejected: to the API an empty list means
"redact nothing", which would return an untouched file reported as redacted. Omit the
argument to use your account defaults.quota_exceeded error means top up — the tools tell the agent not to retry it.npm install
npm run build
npm test # offline unit + tool tests
npm run test:integration # hits the live keyless demo endpoint; no key needed
Support questions about redaction quality, billing, or your account go to info@redact-pdf.ai — GitHub issues here are for the MCP server itself.
MIT licensed.
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y redact-pdf-mcpMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-dambuchs-redact-pdf-mcp": {
"command": "npx",
"args": [
"-y",
"redact-pdf-mcp"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referenceio.github.dambuchs/redact-pdf-mcp works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.