pdfvault-mcp
# `pdfvault-mcp` — Offline PDF Fake-Redaction Forensic Auditor, Metadata Scrubber & Clean `%PDF-1.7` MCP Server + GitHub Action
[](https://glama.ai/mcp/servers/z121245017-ai/pdfvault-mcp)
Zero-dependency, 100% offline **Model Context Protocol (`MCP`) Server**, **CLI**, and **GitHub Action** enabling AI coding agents (Claude Desktop, Cursor, Windsurf, Antigravity) and CI pipelines to audit PDF **fake black-box redactions**, incremental `%%EOF` **ghost revisions**, `/Info` + XMP workstation path leaks, reviewer `/Annots`, and hidden `/JavaScript` payloads — and rebuild clean `%PDF-1.7` documents with **`0%` cloud upload**.
## Why PdfVault Exists
1. **Fake Black-Box Redactions (`0 0 0 rg ... re f`)**: Drawing dark rectangles over text in Preview, Word, or basic PDF editors hides characters visually while the underlying `BT ... Tj / TJ ... ET` stream stays **100% copy-pasteable**.
2. **Incremental-Save `%%EOF` Ghost Revisions**: Saving edits incrementally appends a new `xref` and `%%EOF` while leaving deleted drafts and sensitive numbers intact before earlier `%%EOF` markers.
3. **Forensic Metadata & Script Leaks**: `/Info` (`UTF-16BE` BOM `<FEFF...>` and octal `\ddd` strings), `/Metadata` XMP `stRef:filePath` workstation paths, `/PieceInfo` Illustrator blocks, unapplied `/Subtype /Redact` annotations, and `/OpenAction` `/JavaScript` beacons routinely leak author identities and deal terms.
## MCP Tools Exposed (`stdio`)
| Tool | Purpose | Safety Annotations |
| :--- | :--- | :--- |
| `audit_pdf_forensics` | Decompresses `/FlateDecode` content streams locally to detect fake black-box redactions, surviving target substrings, `%%EOF` ghost revisions, `UTF-16BE`/octal `/Info`, XMP XML paths, `/Annots`, `/EmbeddedFiles`, and `/JavaScript` triggers. | `readOnlyHint: true`, `destructiveHint: false`, `idempotentHint: true`, `openWorldHint: false` |
| `scrub_pdf_metadata` | Losslessly rewrites a single-revision `%PDF-1.7` (`1` `%%EOF`, fresh `xref`), stripping `/Info`, XMP `/Metadata`, `/PieceInfo`, `/JavaScript`, `/OpenAction`, `/EmbeddedFiles`, and optional `/Annots` / `/AcroForm` while keeping vector text crisp. | `readOnlyHint: false`, `destructiveHint: false`, `idempotentHint: true`, `openWorldHint: false` |
| `compile_clean_burned_pdf` | Compiles baseline JPEG (`DCTDecode`) page frames with solid pixel burn-in boxes + optional watermark into a brand-new `%PDF-1.7` (`0` `/Font` objects, `0` `BT...ET` text streams) and issues a SHA-256 Zero-Surviving-Leak Verification Receipt. | `readOnlyHint: false`, `destructiveHint: false`, `idempotentHint: true`, `openWorldHint: false` |
| `generate_forensic_pdf_fixture` | Deterministically synthesizes multi-revision Flate-compressed PDF fixtures (`ma-contract`, `hr-compensation`, `vendor-proposal`) for CI security regression tests. | `readOnlyHint: false`, `destructiveHint: false`, `idempotentHint: true`, `openWorldHint: false` |
## Quick Start (MCP Client & Local CLI)
```bash
# Start MCP server over stdio (supports both NDJSON and Content-Length framing)
npx -y github:z121245017-ai/pdfvault-mcp
# List MCP tool schemas from terminal
npx -y github:z121245017-ai/pdfvault-mcp --list
# Audit a local PDF file from terminal
npx -y github:z121245017-ai/pdfvault-mcp --cli audit_pdf_forensics '{"filePath":"./contract.pdf","targetTerms":["$4,850,000"]}'
```
### Claude Desktop / Cursor / Windsurf / Antigravity Config
```json
{
"mcpServers": {
"pdfvault": {
"command": "npx",
"args": ["-y", "github:z121245017-ai/pdfvault-mcp"]
}
}
}
```
### Docker (`node:22-alpine`, non-root `USER node`)
```bash
docker build -t pdfvault-mcp .
docker run -i --rm pdfvault-mcp
```
## GitHub Action (`z121245017-ai/pdfvault-mcp@v1`)
Block pull requests that commit `.pdf` fixtures, docs, or legal attachments containing fake black-box redactions, surviving target secrets, incremental `%%EOF` ghost revisions, workstation OS paths, unapplied `/Redact` boxes, or hidden `/JavaScript`:
```yaml
name: PdfVault PDF Leak & Fake-Redaction Gate
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
pdf-forensic-gate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Audit repository PDFs for fake redactions & metadata leaks
uses: z121245017-ai/pdfvault-mcp@v1
with:
paths: '.'
fail-on-leaks: 'true'
```
### Action Inputs & Outputs
| Name | Kind | Default | Description |
| :--- | :--- | :--- | :--- |
| `paths` | Input | `.` | Newline-, comma-, or space-separated PDF files or directories to scan. |
| `target-terms` | Input | `''` | Optional comma-separated confidential terms that must not survive inside any `.pdf`. |
| `fail-on-leaks` | Input | `true` | Exit `1` when `CRITICAL` or `HIGH` PDF leaks are found. |
| `ignore` | Input | `node_modules,.git,dist,build,coverage,vendor` | Comma-separated directory names skipped during recursive workspace scan. |
| `scanned-pdfs` | Output | — | Total number of `.pdf` files inspected. |
| `leaks-found` | Output | — | Total count of `CRITICAL`/`HIGH` PDF leak findings. |
| `report-json` | Output | — | Structured JSON summary of findings. |
## Verification
```bash
npm test
```
## License
MIT License — `0` external npm dependencies, `0` network calls, `100%` local execution.
TDQS
Scored across 4 tools
Each tool has a clearly distinct role in a PDF forensics pipeline: audit, scrub, compile clean output, and generate test fixtures. The only possible overlap is that compile and generate both produce PDFs, but their descriptions clearly separate clean production output from synthetic malicious fixtures.
All tools use snake_case with verb-first names, following a predictable action-oriented convention. Longer names like compile_clean_burned_pdf and generate_forensic_pdf_fixture remain readable and consistent with the set.
Four tools is a tight, well-scoped surface for a specialized PDF security server. Each tool covers a distinct stage of detection, sanitization, clean generation, and regression testing.
The surface covers the core lifecycle: audit for leaks, scrub existing PDFs, compile a clean replacement with a receipt, and generate forensic fixtures. Minor gaps exist, such as no explicit standalone verification tool for scrubbed output or batch-processing operation, but the main workflows are covered.