Papyrio PDF Tools

v0.1.4
io.github.atabekdemurtaza/papyrio-mcp Checked 15 hours ago Published 1 month ago

Compress, convert, merge, split and OCR PDFs from an assistant, using local files.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

compress_pdf

Shrink a PDF by downsampling its images. Image-heavy files lose 30-80% of their size; text stays selectable. Use this when a PDF is too large to email or upload. Already-optimized files come back unchanged rather than larger. The input is uploaded to the Papyrio API, processed in memory and not stored. The result is written to output_path, replacing any file already there, and the call returns that path and the size in bytes. Inputs are limited to 50 MB, and each call counts as one operation against the daily quota.

ParameterTypeDescription
file *stringAbsolute path to the PDF to compress.
levelstringCompression strength. low keeps images at 300 DPI, medium at 150, high at 72.
output_pathstringAbsolute path to write the result to. Defaults to the input file with a "-papyrio.pdf" suffix.

merge_pdfs

Combine 2 to 10 PDFs into one document, in the order given. Use this to join separate scans, chapters or invoices into a single file. Password-protected files must be unlocked first. The input is uploaded to the Papyrio API, processed in memory and not stored. The result is written to output_path, replacing any file already there, and the call returns that path and the size in bytes. Inputs are limited to 50 MB, and each call counts as one operation against the daily quota.

ParameterTypeDescription
files *arrayAbsolute paths to the PDFs, in the order they should appear.
output_pathstringAbsolute path to write the result to. Defaults to the input file with a "-papyrio.pdf" suffix.

extract_pdf_text

Return the text of a PDF as UTF-8, so it can be read or summarized. Fast and exact when the PDF already has a text layer. A scanned PDF has none — run ocr_pdf on it first. The input is uploaded to the Papyrio API, processed in memory and not stored. The result is written to output_path, replacing any file already there, and the call returns that path and the size in bytes. Inputs are limited to 50 MB, and each call counts as one operation against the daily quota.

ParameterTypeDescription
file *stringAbsolute path to the PDF.
output_pathstringAbsolute path to write the result to. Defaults to the input file with a "-papyrio.txt" suffix.

ocr_pdf

Add an invisible text layer to a scanned PDF so its text can be searched, selected and extracted. Use this before extract_pdf_text or pdf_to_word on a scan or photographed document, and set lang when the text is not English. The page images are kept, so the output is about the same size as the input, and pages that already have text are left untouched. Takes roughly 2-10 seconds per page. Scans at 300 DPI or higher read well; below 150 DPI accuracy degrades badly. The input is uploaded to the Papyrio API, processed in memory and not stored. The result is written to output_path, replacing any f…

ParameterTypeDescription
file *stringAbsolute path to the scanned PDF.
langstringLanguage of the document's text as a Tesseract code: eng (English), rus (Russian), spa (Spanish), ita (Italian), uzb (Uzbek, Latin script), uzb_cyrl (Uzbek, Cyrillic) or kaz (Kazakh). For mixed docume…
output_pathstringAbsolute path to write the result to. Defaults to the input file with a "-papyrio.pdf" suffix.

pdf_to_word

Convert a PDF into an editable Word document. PDFs exported from Word, Google Docs or InDesign come through well. A scanned PDF is a picture of a page, so run ocr_pdf on it first. The input is uploaded to the Papyrio API, processed in memory and not stored. The result is written to output_path, replacing any file already there, and the call returns that path and the size in bytes. Inputs are limited to 50 MB, and each call counts as one operation against the daily quota.

ParameterTypeDescription
file *stringAbsolute path to the PDF.
output_pathstringAbsolute path to write the result to. Defaults to the input file with a "-papyrio.docx" suffix.

split_pdf

Separate every page of a PDF into its own file, returned as a ZIP archive. Use this to pull single pages out of a long document. The input is uploaded to the Papyrio API, processed in memory and not stored. The result is written to output_path, replacing any file already there, and the call returns that path and the size in bytes. Inputs are limited to 50 MB, and each call counts as one operation against the daily quota.

ParameterTypeDescription
file *stringAbsolute path to the PDF to split.
output_pathstringAbsolute path to write the result to. Defaults to the input file with a "-papyrio.zip" suffix.

pdf_to_jpg

Render every page of a PDF as a JPG image, returned as a ZIP archive. Use this when the pages are needed as pictures, for a thumbnail, a slide or an image pipeline. The input is uploaded to the Papyrio API, processed in memory and not stored. The result is written to output_path, replacing any file already there, and the call returns that path and the size in bytes. Inputs are limited to 50 MB, and each call counts as one operation against the daily quota.

ParameterTypeDescription
file *stringAbsolute path to the PDF.
output_pathstringAbsolute path to write the result to. Defaults to the input file with a "-papyrio.zip" suffix.

office_to_pdf

Convert a Word (.doc, .docx, .odt), PowerPoint (.ppt, .pptx) or Excel (.xls, .xlsx) document to PDF with LibreOffice, keeping fonts, tables, images and page layout; each slide or sheet becomes one or more pages. Use this to turn an Office file into a fixed, shareable PDF, not for files that are already PDFs. Large presentations can take 30 seconds or more. Password-protected Office files are not supported. The input is uploaded to the Papyrio API, processed in memory and not stored. The result is written to output_path, replacing any file already there, and the call returns that path and the s…

ParameterTypeDescription
file *stringAbsolute path to the Office document. The extension decides how it is read, so it must be one of .doc, .docx, .odt, .ppt, .pptx, .xls or .xlsx.
output_pathstringAbsolute path to write the result to. Defaults to the input file with a "-papyrio.pdf" suffix.

image_to_pdf

Wrap a JPG, PNG or WebP image in a PDF page. Use this when an image needs to be submitted or printed as a PDF. The input is uploaded to the Papyrio API, processed in memory and not stored. The result is written to output_path, replacing any file already there, and the call returns that path and the size in bytes. Inputs are limited to 50 MB, and each call counts as one operation against the daily quota.

ParameterTypeDescription
file *stringAbsolute path to the image.
output_pathstringAbsolute path to write the result to. Defaults to the input file with a "-papyrio.pdf" suffix.

webpage_to_pdf

Fetch a public URL and render the page to PDF in a headless browser. Use this to archive or print a web page. This tool takes a URL rather than a file, so output_path is required. The input is uploaded to the Papyrio API, processed in memory and not stored. The result is written to output_path, replacing any file already there, and the call returns that path and the size in bytes. Inputs are limited to 50 MB, and each call counts as one operation against the daily quota.

ParameterTypeDescription
output_path *stringAbsolute path to write the .pdf result to. Required for this tool.
url *stringPublicly reachable page URL, including https://.

protect_pdf

Encrypt a PDF with AES-256 so it cannot be opened without the password. Use this before sending a document that contains anything private. The input is uploaded to the Papyrio API, processed in memory and not stored. The result is written to output_path, replacing any file already there, and the call returns that path and the size in bytes. Inputs are limited to 50 MB, and each call counts as one operation against the daily quota.

ParameterTypeDescription
file *stringAbsolute path to the PDF to encrypt.
password *stringPassword that will be required to open the resulting PDF.
output_pathstringAbsolute path to write the result to. Defaults to the input file with a "-papyrio.pdf" suffix.

unlock_pdf

Remove the password from a PDF you already know the password for. This decrypts with the supplied password; it does not break or guess encryption. The input is uploaded to the Papyrio API, processed in memory and not stored. The result is written to output_path, replacing any file already there, and the call returns that path and the size in bytes. Inputs are limited to 50 MB, and each call counts as one operation against the daily quota.

ParameterTypeDescription
file *stringAbsolute path to the password-protected PDF.
password *stringThe PDF's current password.
output_pathstringAbsolute path to write the result to. Defaults to the input file with a "-papyrio.pdf" suffix.