localpdf-mcp

v0.1.6
io.github.ulinycoin/localpdf-mcp Checked 19 hours ago Published 1 day ago

Local PDF tools for AI agents: inspect, merge, split, compress, OCR.

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

pdf_inspect Inspect PDF

Read a PDF header: page count, byte size, encryption flag, producer, sha256. No content is returned.

ParameterTypeDescription
path *stringabsolute path to the PDF

pdf_merge Merge PDFs

Concatenate two or more PDFs into a new file, in the given order.

ParameterTypeDescription
out *stringoutput path; must differ from every input
paths *arrayabsolute paths, in order

pdf_split Split / extract pages

Write each requested page of a PDF into its own file inside out_dir.

ParameterTypeDescription
path *string
out_dirstringdirectory for the page files (default: scratch dir)
pagesarray1-based page numbers. Omit for all pages.

pdf_compress Compress PDF

Structural resave with object streams. No image recompression: text-only PDFs may barely shrink, already-optimised ones may grow. Reports before/after sizes honestly.

ParameterTypeDescription
path *string
outstring
use_object_streamsboolean

pdf_extract_text Extract text

Extract the text layer to a .txt file and return per-page character counts. The text is NOT returned by default — set inline=true only if the caller really needs the content in its context (it then lands in the model provider logs).

ParameterTypeDescription
path *string
inlinebooleanalso return the text in the tool result (opt-in)
outstringoutput .txt path
pagesarray1-based page numbers. Omit for all pages.

pdf_replace_text Replace text (overlay)

Find a string on a page and draw a white patch with the replacement on top. IMPORTANT: this is an overlay, not a true content-stream edit — the original text layer stays, so copy-paste still returns the old string. Font is substituted with Helvetica (Latin-1 only). Use it for cosmetic fixes, not for redaction.

ParameterTypeDescription
find *stringexact substring as it appears in a single text item
path *string
replace *string
allbooleanreplace every match (default: first only)
outstring
pageintegerlimit to one page

pdf_ocr OCR (offline)

Add an invisible text layer to a scanned PDF using tesseract with locally installed traineddata. Done for: eng, rus. Recognised text is not returned, only counts and confidence.

ParameterTypeDescription
path *string
langsarray
outstring
pagesarray1-based page numbers. Omit for all pages.
scalenumberrender scale before OCR, default 2