localpdf-mcp
v0.1.6Local 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.
| Parameter | Type | Description |
|---|---|---|
path * | string | absolute path to the PDF |
pdf_merge Merge PDFs
Concatenate two or more PDFs into a new file, in the given order.
| Parameter | Type | Description |
|---|---|---|
out * | string | output path; must differ from every input |
paths * | array | absolute paths, in order |
pdf_split Split / extract pages
Write each requested page of a PDF into its own file inside out_dir.
| Parameter | Type | Description |
|---|---|---|
path * | string | |
out_dir | string | directory for the page files (default: scratch dir) |
pages | array | 1-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.
| Parameter | Type | Description |
|---|---|---|
path * | string | |
out | string | |
use_object_streams | boolean |
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).
| Parameter | Type | Description |
|---|---|---|
path * | string | |
inline | boolean | also return the text in the tool result (opt-in) |
out | string | output .txt path |
pages | array | 1-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.
| Parameter | Type | Description |
|---|---|---|
find * | string | exact substring as it appears in a single text item |
path * | string | |
replace * | string | |
all | boolean | replace every match (default: first only) |
out | string | |
page | integer | limit 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.
| Parameter | Type | Description |
|---|---|---|
path * | string | |
langs | array | |
out | string | |
pages | array | 1-based page numbers. Omit for all pages. |
scale | number | render scale before OCR, default 2 |