yaktool-pdf-mcp
v0.7.0
Published
PDF work as an MCP server: merge with the bookmarks preserved, split, compress image-heavy files, unlock password-protected ones with the password you supply, rewrite the page order with relative rotation, read the text layer, extract embedded files and c
Maintainers
Readme
yaktool-pdf-mcp
PDF organisation as an MCP server — the PDF-domain suite of yaktool.com.
Every tool diagnoses the file first (missing header, truncation, encryption, damaged cross-reference — as numbered PDFI-* findings), never overwrites an existing output, and does no network I/O.
Tools
merge_pdfs— merge PDF files in order. Bad files are skipped with their diagnosis attached and the merge continues. Nothing is ever silently dropped. Bookmarks come with it: each source's outline is remapped onto the pages' new positions and nested under one entry per source file, and any bookmark whose destination cannot be resolved is reported by name rather than quietly lost.split_pdf— extract pages with a real range language (1-3,5,9-,-4,last) whose errors name the actual problem (backwards range with a swap suggestion, out-of-bounds with the document's true page count). One output file, or one per page.organize_pdf— rewrite the page sequence: reorder, delete, duplicate and rotate in one pass. Rotation is relative to how the page currently displays — a scan stored at/Rotate 270turned by 90 comes out at 0, not 90, so pre-rotated scans are not silently un-rotated. A page that does not exist, or an angle that is not a quarter turn, refuses the whole plan rather than quietly dropping a page.compress_pdf— shrink image-heavy and scanned PDFs by re-encoding their bitmaps (JPEG and Flate). Reports every image's before/after size, resolution and PSNR, and never fakes a saving: an image that would grow keeps its original bytes, and a file that cannot be improved comes back untouched instead of re-saved.unlock_pdf— remove a password using the password the user supplies. It does not crack, guess or bypass anything: a permissions ("owner") password needs the password too, unlike sites that silently strip it. The output is a genuinely clean, unencrypted PDF the other tools here accept.check_pdf_redaction— check whether a "redacted" PDF actually removed the text or just covered it. Dark rectangles over extractable text are caught and the covered words come back verbatim inrecovered[]; also flags unapplied/Redactannotations, annotation text, document metadata, incremental-save history, attachments and bookmark titles. Honest about scanned pages: the text layer is judged, pixels are out of scope. Published thresholds (dark = grey ≤ 0.25, covered = ≥ 60% of the word box).extract_pdf_text— read the text layer out, reflowed into reading order. The part worth calling it for: it says when the text cannot be trusted. Pages with no text layer come back named (they are scans, and an empty string reads as "blank page"); a text layer that decodes to unmapped codepoints is flagged instead of handed over as prose; and amaxCharsbudget reports exactly what it dropped. Deliberately no table reconstruction and no layout analysis — for those, a dedicated extraction server does more.extract_pdf_attachments— list every file embedded in a PDF, and when it is a Factur-X / ZUGFeRD hybrid invoice, check the container: prescribed filename, the/AFRelationshipvalue (Alternative, orSourcein the case ZUGFeRD 2.1 names), and registration in both/AFand/EmbeddedFiles— get those wrong and the XML is present but unreachable. Then the invoice itself goes through the Article 226 engine, with totals computed per VAT rate rather than copied from the file. The CII reader takes a bounded set of paths and reports what it could not read rather than guessing.check_pdf_form— list every AcroForm field (type, value, options, required, read-only, MaxLen) and judge whether the form would come back rejected: a required field left empty, a value outside the field's options, a value past MaxLen, and fields that share a name — those are one field with several widgets, so typing in one changes the others. Passfillto check a planned fill before touching the file.fill_pdf_form— write values and save to a new file, never overwriting. It checks before it writes and refuses on an error, and it regenerates the field appearances — the step that separates a filled form from a file that merely contains values, because without it many readers and most printers show empty boxes. Signature fields are left alone.images_to_pdf— build a PDF from JPEG and PNG files, one image per page, with the layout decisions stated rather than applied silently: enlarging is off by default (it adds pixels, not detail),coverreports how much it crops, and with a fixed paper size the effective print resolution is computed and flagged below 150 DPI. Formats a PDF cannot carry are refused by name instead of being converted behind your back.check_pdf_hidden_content— show what a recipient can still recover. The headline is cropping: it deletes nothing, and — this is the part that makes it dangerous — every reader and text extractor clips to the crop box, soextract_pdf_texton a cropped file returns the visible text and silently omits the rest. This tool re-opens the document with each crop box pushed back out to the media box and reports the text outside the original crop verbatim, not as a count of hidden objects. Also: layers that are off by default (by name), document properties as values with local file paths flagged, incremental-save rounds, and embedded files. Text layer only — images outside the crop are equally recoverable and are reported as out of scope rather than passed off as "nothing hidden".
Install
claude mcp add yaktool-pdf -- npx -y yaktool-pdf-mcpSame engine as the browser tools at yaktool.com/documents/pdf-merge.
