pdfedit-mcp

v0.1.10
io.github.zp130221/pdfedit-mcp Checked 9 hours ago Published 1 month ago

Edit text inside existing PDFs: replace, delete, redact, insert, fill forms; original fonts kept.

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

pdf_edit Edit a PDF

Edit the text of an existing PDF in place: replace, delete, redact, insert, or fill form fields, keeping the original layout, fonts and everything you did not point at. `edits[]` is taken exactly as the API takes it (`op`, `scope`, `match`, `fit`), and the result carries up to 3 before/after previews of the pages that changed. To change text on one page only, set `scope.pages`; to pick one of several identical matches, use `scope.after` with nearby text or `scope.occurrence`. Use `op: 'redact'` when the text must be unrecoverable.

ParameterTypeDescription
edits *arrayThe edits to apply, in order, exactly as `POST /v1/edit` takes them.
file *stringThe PDF: an absolute (or ~) local path, which this server uploads for you, an https:// URL the API fetches, or an `f_…` file id from an earlier call.
optionsobject
output_pathstringWhere to write the edited PDF (stdio mode only). Default: `<name>.edited.pdf` next to the input, or `<name>.edited.2.pdf`, `.3.pdf`, ... when that exists; an earlier result is never overwritten.
passwordstringThe document open password, when it has one.

pdf_batch Batch-edit a PDF template

Apply the same edits to one template PDF once per record, producing one output document per record — a mail merge over an existing PDF. Returns a `job_id`: call `pdf_job` with it for the per-record results. To change text on one page only, set `scope.pages`; to pick one of several identical matches, use `scope.after` with nearby text or `scope.occurrence`. Use `op: 'redact'` when the text must be unrecoverable.

ParameterTypeDescription
edits *arrayThe edits applied to each record, with `{field}` placeholders filled from it.
file *stringThe PDF: an absolute (or ~) local path, which this server uploads for you, an https:// URL the API fetches, or an `f_…` file id from an earlier call. Used as the template for every record.
optionsobject
passwordstring
recordsarrayOne object per output document.
records_urlstringA CSV or JSONL file of records, instead of `records`.

pdf_find Read the text of a PDF

Read the text of a PDF: every span with its page, position, font and span id, optionally filtered by `query` (the same four `match` modes an edit uses) and `pages`, over the `content`, `forms` and `annotations` layers. Paginated: pass the returned `next_cursor` back as `cursor` for the next page. Use it before `pdf_edit` to check what a document actually says and to pick the `scope` that selects the match you mean.

ParameterTypeDescription
file *stringThe PDF: an absolute (or ~) local path, which this server uploads for you, an https:// URL the API fetches, or an `f_…` file id from an earlier call.
cursorstring | null
layersarray
limitinteger(default: 200)
matchobject
pages
passwordstring
querystring | null

pdf_preview Render a PDF page

Render one page of a PDF as a PNG image block, optionally cropped to `region` and with rectangles drawn over `highlight`. Use it to see a page before editing it, or to check the result afterwards.

ParameterTypeDescription
file *stringThe PDF: an absolute (or ~) local path, which this server uploads for you, an https:// URL the API fetches, or an `f_…` file id from an earlier call.
highlight
pageinteger(default: 1)
passwordstring
region
scale(default: 2)

pdf_job Job result

The result of an async edit or a batch, by `job_id`: the same body `pdf_edit` returns once the job is done, plus `progress` while it is still queued or running, and `records` for a batch.

ParameterTypeDescription
job_id *stringThe `job_id` an async edit or a batch returned.
output_pathstringWhere to write the finished document (stdio mode, single-document jobs only).