pdf_add_page_numbers
Add page numbers to a PDF. Supports configurable position, format, starting number, and font size.
Read, build, transform and secure PDFs locally — including rendering a scan to images a vision model can actually read — from one npx command with nothing to compile.
LABSCO SUMMARY
Most PDF servers stop at extracting text, which leaves scanned documents useless. Rendering pages to images closes that gap by handing them to a vision-capable client instead. The other thing worth knowing is how carefully the page operations treat forms: merging, splitting and reordering keep AcroForm fields, collisions are namespaced by source, and each call reports what it preserved, renamed or dropped rather than losing them quietly. Encryption is AES-256 rather than legacy RC4, and none of it needs a build toolchain.
A write-capable PDF toolkit with 22 tools: extract text and metadata, convert to Markdown, search, merge, split, reorder and delete pages, fill and flatten forms, watermark, encrypt, and create documents from text, Markdown or a template. Every engine is WASM or plain JavaScript, so there is no native build step.
Node.js 20 or newer, launched over stdio as @aryanbv/pdf-toolkit-mcp with npx. No configuration file, API key, Docker or compiler, and it works offline — every engine is WASM or JavaScript, so there is no node-gyp step or prebuilt binary needed on Windows, macOS or Linux. Non-Latin text in a document you create or fill needs a fontPath pointing at a suitable font.
One command — npx -y @aryanbv/pdf-toolkit-mcp
USE CASES
Render the pages to images at a workable DPI and let a vision-capable client read them; text extraction handles the rest of the file.
Convert to reading-order Markdown so columns do not interleave, then search for the passage you actually wanted.
Merge the sources, put the pages in the right order and drop what does not belong — with the form fields surviving all three.
List the fields with their types, fill them, then flatten so the values are part of the page rather than editable.
Build it from Markdown or from a named template with structured data, then number the pages.
Mark it with a diagonal watermark and apply AES-256 protection with separate user and owner passwords.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
pdf_add_page_numbersAdd page numbers to a PDF. Supports configurable position, format, starting number, and font size.
pdf_add_watermarkAdd a text watermark to PDF pages. Watermark is centered and rotated diagonally by default. Applies to all pages if no page range is specified.
pdf_compareCompare two PDFs page by page (by absolute page index) and report text differences. Returns identical:true when text matches. Diffs content-stream-order text (not visual reading order), so it is best for same-layout documents; reflowed or multi-column PDFs produce noisy diffs. Inserting/deleting a page shifts all later pages and reports them as changed. Large diffs are trimmed (truncated:true) to fit the response limit.
pdf_createCreate a new PDF from text content with automatic line wrapping and page overflow. Supports A4, Letter, and Legal page sizes. Provide fontPath for non-Latin text (Arabic, CJK, etc.).
pdf_create_from_markdownCreate a rich, high-fidelity PDF from Markdown (CommonMark + GFM). Supports headings, bold/italic, links, ordered/bullet lists, tables, fenced code blocks, blockquotes, and horizontal rules.
pdf_create_from_templateCreate a polished PDF from a named template (invoice, report, or letter). Pass structured data matching the template's fields; data is validated against the template's schema.
pdf_delete_pagesDelete specific pages from a PDF, keeping the rest in their original order. AcroForm fields on the remaining pages are preserved. Set flatten:true to bake field values into static content. Cannot delete every page.
pdf_embed_imageEmbed a PNG or JPEG image into a specific page of a PDF. Supports custom positioning and optional scaling with aspect ratio preservation.
pdf_embed_qr_codeEmbed a QR code or barcode into a specific page of a PDF at given coordinates. Supports qrcode, code128, datamatrix, ean13, pdf417, and azteccode.
pdf_encryptEncrypt a PDF with AES-256 password protection. Requires a user password to open. Owner password controls editing permissions (defaults to the user password).
pdf_extract_textExtract text content from a PDF file. Returns first 10 pages by default to avoid exceeding LLM context limits. Use the 'pages' parameter for specific pages.
pdf_fill_formFill form fields in a PDF. Supports text, checkbox, dropdown, radio, and list-box (multi-select) fields. Provide fontPath for non-Latin text (Arabic, CJK, etc.).
pdf_flattenFlatten a PDF's form fields, baking their current values into the page content and removing interactivity. Form-less PDFs are copied unchanged.
pdf_get_form_fieldsList all form fields in a PDF with their names, types, current values, and required status. Returns hasForm: false for PDFs without forms.
pdf_get_metadataGet metadata from a PDF file including title, author, subject, page count, creation/modification dates, and producer information.
pdf_mergeMerge multiple PDF files into one. AcroForm fields are preserved; fields whose names collide across inputs are auto-renamed (namespaced by source). Set flatten:true to bake field values into static content.
pdf_render_pagesRender PDF pages to images so a vision-capable client can read scanned or image-only PDFs. Writes PNG/JPEG files and returns their paths; set inline:true to return image blocks the model can see directly.
pdf_reorder_pagesReorder pages in a PDF. Specify the new page order as a comma-separated string (e.g. '3,1,2'). Duplicates are allowed. AcroForm fields are preserved. Set flatten:true to bake field values into static content.
pdf_rotate_pagesRotate pages in a PDF by 90, 180, or 270 degrees. Rotation is additive to any existing rotation. Rotates all pages if no page range is specified.
pdf_searchSearch text across a PDF and return matches with a short surrounding snippet and the page number. The query is matched as a literal substring (case-insensitive by default). Searches all pages unless a range is given.
pdf_splitExtract specific pages from a PDF into a new file. AcroForm fields on the extracted pages are preserved; fields on omitted pages are dropped. Set flatten:true to bake field values into static content.
pdf_to_markdownConvert a PDF to clean, reading-order Markdown for LLM consumption: reconstructs up to 2 content columns (plus full-width title/footer bands), infers headings from font size, and detects bullet/numbered lists. Pages with 3 or more columns fall back to single-column reading order. Tables are emitted as plain reading-order text, NOT reconstructed as Markdown tables. Best on clean, digital (text-based) PDFs; degrades on scanned/image-only PDFs (use pdf_render_pages for those) and very complex layouts. Returns the first 10 pages by default.
BEFORE YOU INSTALL
22 tools when we connected. The five prompts, including pdf-to-markdown, and the pdf-toolkit://templates resource are not tools; the prompt pdf-to-markdown is separate from the tool pdf_to_markdown.
Node.js 20 or later. Node 18 and the 20.x line are end-of-life, so Node 22 or 24 LTS is recommended
All 5 documented clients run the server on your machine.
CONTEXT COST
Rated by the size of the 22 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
npx -y @aryanbv/pdf-toolkit-mcp{
"mcpServers": {
"pdf-toolkit": {
"command": "npx",
"args": [
"-y",
"@aryanbv/pdf-toolkit-mcp"
]
}
}
}claude mcp add pdf-toolkit -- npx -y @aryanbv/pdf-toolkit-mcp{
"servers": {
"pdf-toolkit": {
"command": "npx",
"args": [
"-y",
"@aryanbv/pdf-toolkit-mcp"
]
}
}
}