Pdfporter

io.github.CloudCorpRecordsPublished by GitHub account CloudCorpRecordsv0.1.0Updated Nov 5, 2026

Convert files/URLs to PDF via conv2pdf; writes output files locally and deletes conversion jobs.

Overview

AI-generated overview

Client for the conv2pdf service that converts local files and web pages to PDF and reshapes PDFs, writing results to disk.

What you can do
  • Convert files to PDF from their extension, or render a public web page to PDF
  • Convert PDFs to editable Word documents or to per-page PNG/JPG images in a ZIP, and HEIC photos to JPG
  • Combine, split, extract page ranges, rotate, number and watermark PDFs
  • Compress PDFs, set or remove passwords and printing/copying restrictions
  • Check the plan, usage and limits of the API key
When to use it
Useful when an assistant needs to turn Office documents, images, e-books or web pages into PDFs, or to merge, split, compress, watermark or password-protect PDFs on the user's machine without a local office suite.
Requirements
Runs locally via npx or Docker. Requires a conv2pdf API key in CONV2PDF_API_KEY, sent as a Bearer token; optional CONV2PDF_API_URL and CONV2PDF_TIMEOUT_MS. Network access to the conv2pdf API is needed for every tool call; without a key the server starts but calls fail.
Before you install
Every conversion uploads the input file or URL to the third-party conv2pdf service, so avoid confidential documents unless that is acceptable. Passwords for protect_pdf and unlock_pdf are passed to the service. Tools write files to disk and refuse to overwrite existing outputs. Usage counts against the API key's plan quota.

Installation

In SourceWeft

  1. Open Pdfporter in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

pdfporter

Files in, PDFs out — and PDFs reshaped. pdfporter is a client for the conv2pdf conversion service: it takes the path of a file on your computer, sends it for conversion, and writes the result back next to the original. Office documents, spreadsheets, presentations, images, e-books, PostScript and HTML files become PDFs; PDFs become Word documents or per-page images; and PDFs can be merged, split, page-extracted, rotated, numbered, watermarked, compressed, password-protected and unlocked.

Configuration

  • CONV2PDF_API_KEY (required for calls) — created in the conv2pdf dashboard, Developer tab. It is sent on every request as Authorization: Bearer <key>. Without a key the server still starts and lists its tools; any tool call fails with a message explaining how to set the key.
  • CONV2PDF_API_URL (optional) — API base URL. Defaults to https://api.conv2pdf.com/v1.
  • CONV2PDF_TIMEOUT_MS (optional) — per-request timeout in milliseconds. Defaults to 120000, because a conversion may legitimately take up to about a minute.

Tools

  • convert_to_pdf — convert a file to PDF, chosen from its extension: Word, Excel, PowerPoint, OpenDocument, Apple Pages, RTF, TXT and CSV files go through office-to-pdf; PNG, JPG, WebP, GIF and TIFF images through image-to-pdf; HEIC/HEIF photos through heic-to-pdf; EPUB through epub-to-pdf; PS/EPS through ps-to-pdf; HTML through html-to-pdf. An unknown extension fails locally, with no request made.
  • convert_url_to_pdf — render a public web page to PDF from its address. It always takes an output_path, because there is no input file to write next to.
  • convert_heic_to_jpg — an iPhone HEIC or HEIF photo as a JPG.
  • convert_pdf_to_word — a PDF with real text as an editable DOCX document. Pass password to open a protected PDF.
  • convert_pdf_to_images — one PNG (default) or JPG per page, delivered in a ZIP file.
  • merge_pdfs — combine 2 to 20 PDFs into one, in the order given in paths.
  • extract_pdf_pages — copy the pages listed in ranges (such as 1-5,7,10-12) into a new PDF, in the order written.
  • split_pdf — one PDF per page, in a ZIP file.
  • rotate_pdf — turn every page by rotation: 90, 180 or 270 degrees.
  • add_page_numbers — number the pages, as "3 / 12" (format: "full", the default) or "3" (format: "simple"), at position bottom-center (default), bottom-left or bottom-right.
  • add_watermark — stamp a text of up to 50 characters on every page.
  • compress_pdf — reduce the size, with quality low, medium (default) or high, keeping images at 72, 150 or 300 DPI.
  • protect_pdf — set a new password (6 to 64 characters), with prevent_print and prevent_copy to forbid printing or copying.
  • unlock_pdf — remove a password you know (pass it as password), or the printing and copying restrictions.
  • get_quota — the plan, usage and limits of the API key, returned verbatim.

Most PDF-reading tools accept an optional password that opens a protected PDF; the result has no password.

How a conversion behaves

  1. The input file is read locally and POSTed as multipart/form-data to <base>/convert/<api-tool>, the file in the file field plus the tool's fields as string fields.
  2. On HTTP 429 or 503 the server waits for the delay the API gives (the Retry-After header, else the body's retry_after seconds) and retries, at most twice and only for delays of 30 seconds or less.
  3. The convert response carries a job_id and a relative download_url; the result is downloaded from the API origin, written to disk, and the job is then deleted from the service on a best-effort basis.

Results are never overwritten. By default the output sits next to the input: a conversion swaps the extension (report.docx gives report.pdf), a PDF operation adds a suffix (report.pdf gives report-compressed.pdf for compress_pdf, report-images.zip for convert_pdf_to_images, and so on), and a merge writes merged.pdf next to the first input. When the target name is taken, (2), (3), ... is appended before the extension until a free name is found. With an explicit output_path, an existing file there is refused before anything is sent.

A successful conversion answers with a JSON summary: {"job_id": ..., "output_path": ..., "size_bytes": ...}, plus the quota object copied from the convert response when the service sends one. get_quota returns the service's response body verbatim.

Errors: a non-2xx reply fails with conv2pdf error: <error> when the body carries an error code, else conv2pdf error: HTTP <status>; an unreachable API fails with conv2pdf unreachable.

CLI

Each tool is a subcommand taking one JSON argument string:

bash
npx @reneturcios/pdfporter convert_to_pdf '{"path":"report.docx"}'npx @reneturcios/pdfporter convert_url_to_pdf '{"url":"https://example.com/article","output_path":"article.pdf"}'npx @reneturcios/pdfporter convert_heic_to_jpg '{"path":"IMG_0001.heic"}'npx @reneturcios/pdfporter convert_pdf_to_word '{"path":"report.pdf"}'npx @reneturcios/pdfporter convert_pdf_to_images '{"path":"report.pdf","format":"jpg"}'npx @reneturcios/pdfporter merge_pdfs '{"paths":["a.pdf","b.pdf"]}'npx @reneturcios/pdfporter extract_pdf_pages '{"path":"report.pdf","ranges":"1-5,7,10-12"}'npx @reneturcios/pdfporter split_pdf '{"path":"report.pdf"}'npx @reneturcios/pdfporter rotate_pdf '{"path":"scan.pdf","rotation":90}'npx @reneturcios/pdfporter add_page_numbers '{"path":"report.pdf","position":"bottom-right"}'npx @reneturcios/pdfporter add_watermark '{"path":"contract.pdf","text":"CONFIDENTIAL"}'npx @reneturcios/pdfporter compress_pdf '{"path":"big.pdf","quality":"low"}'npx @reneturcios/pdfporter protect_pdf '{"path":"confidential.pdf","password":"secret123","prevent_print":true}'npx @reneturcios/pdfporter unlock_pdf '{"path":"protected.pdf","password":"secret123"}'npx @reneturcios/pdfporter get_quota '{}'npx @reneturcios/pdfporter --version

Exit codes: 0 on success, 1 on a runtime error, 2 on a usage error.

MCP server

bash
npx -y @reneturcios/pdfporter mcp

MCP client config:

json
{  "mcpServers": {    "pdfporter": {      "command": "npx",      "args": ["-y", "@reneturcios/pdfporter", "mcp"],      "env": {        "CONV2PDF_API_KEY": "<your key>"      }    }  }}

Docker

bash
docker run -i ghcr.io/cloudcorprecords/pdfporterdocker run --rm ghcr.io/cloudcorprecords/pdfporter get_quota '{}'

Development

bash
npm installnpm run build   # tsc -> dist/npm test        # tsx --test test/*.test.ts (fake fetch only, no network)npm run dev     # run the CLI from source

License

MIT — Copyright (c) 2026 Rene Turcios

Source: README.md at commit 6294b71

Tools

15

convert_to_pdf

Word, Excel, PowerPoint, OpenDocument, Apple Pages, RTF, TXT, CSV, PNG, JPG, WebP, GIF, TIFF, HEIC, EPUB, PostScript (PS, EPS) or HTML file to PDF, chosen from the extension. Reads the local file, uploads it to the conv2pdf API, writes the converted PDF to output_path (or next to the input) and deletes the conversion job afterwards.

Parameterspathrequiredoutput_path

convert_url_to_pdf

Public web page to PDF, from its address, printed as a browser would. Sends the URL to the conv2pdf API, writes the resulting PDF to the local output_path and deletes the conversion job afterwards.

Parametersurlrequiredoutput_pathrequired

convert_heic_to_jpg

iPhone HEIC or HEIF photo to JPG. Reads the local file, uploads it to the conv2pdf API, writes the JPG to output_path (or next to the input) and deletes the conversion job afterwards.

Parameterspathrequiredoutput_path

convert_pdf_to_word

PDF with real text to an editable DOCX document. Reads the local file, uploads it to the conv2pdf API, writes the DOCX to output_path (or next to the input) and deletes the conversion job afterwards.

Parameterspathrequiredpasswordoutput_path

convert_pdf_to_images

One PNG or JPG per page, in a ZIP file. Reads the local file, uploads it to the conv2pdf API, writes the ZIP to output_path (or next to the input) and deletes the conversion job afterwards.

Parameterspathrequiredformatpasswordoutput_path

merge_pdfs

Combine several PDFs into one, in the order given. Reads the local files, uploads them to the conv2pdf API, writes the merged PDF to output_path (or next to the first input) and deletes the conversion job afterwards.

Parameterspathsrequiredoutput_path

extract_pdf_pages

Copy the pages you list, such as 1-5,7,10-12, into a new PDF, in the order written. Reads the local file, uploads it to the conv2pdf API, writes the new PDF to output_path (or next to the input) and deletes the conversion job afterwards.

Parameterspathrequiredrangesrequiredpasswordoutput_path

split_pdf

One PDF per page, in a ZIP file. Reads the local file, uploads it to the conv2pdf API, writes the ZIP to output_path (or next to the input) and deletes the conversion job afterwards.

Parameterspathrequiredpasswordoutput_path

rotate_pdf

Turn every page by 90, 180 or 270 degrees. Reads the local file, uploads it to the conv2pdf API, writes the rotated PDF to output_path (or next to the input) and deletes the conversion job afterwards.

Parameterspathrequiredpasswordrotationrequiredoutput_path

add_page_numbers

Number the pages, as "3 / 12" or "3", bottom center, left or right. Reads the local file, uploads it to the conv2pdf API, writes the numbered PDF to output_path (or next to the input) and deletes the conversion job afterwards.

Parameterspathrequiredformatpasswordpositionoutput_path

add_watermark

Stamp a text of up to 50 characters on every page. Reads the local file, uploads it to the conv2pdf API, writes the watermarked PDF to output_path (or next to the input) and deletes the conversion job afterwards.

Parameterspathrequiredtextrequiredpasswordoutput_path

compress_pdf

Reduce the size, keeping images at 72, 150 or 300 DPI. Reads the local file, uploads it to the conv2pdf API, writes the compressed PDF to output_path (or next to the input) and deletes the conversion job afterwards.

Parameterspathrequiredqualitypasswordoutput_path

protect_pdf

Set a password, and optionally forbid printing or copying. Reads the local file, uploads it to the conv2pdf API, writes the protected PDF to output_path (or next to the input) and deletes the conversion job afterwards.

Parameterspathrequiredpasswordrequiredoutput_pathprevent_copyprevent_print

unlock_pdf

Remove a password you know, or the printing and copying restrictions. Reads the local file, uploads it to the conv2pdf API, writes the unlocked PDF to output_path (or next to the input) and deletes the conversion job afterwards.

Parameterspathrequiredpasswordoutput_path

get_quota

Plan, usage and limits of the API key

Takes no parameters.

Version history

1
  1. v0.1.0LatestNov 5, 2026

Score

90% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts
  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts