PdfCraft comes with a command-line tool, pdfcraft-cli. It inspects, renders, edits, combines, splits and batch-processes PDFs without opening a window, and it runs an MCP (Model Context Protocol) server, so AI agents such as Claude can open, change and save PDFs. Every engine feature is reachable this way, through one table of tools with JSON-Schema descriptions, according to the README.

This page summarises the official documentation at version 0.22.0, released on 23 November 2026. We haven’t tried these setups ourselves yet, so check the MCP docs if something doesn’t match.

Where to find pdfcraft-cli

You installed pdfcraft-cli is
Windows installer (.msi) In the folder PdfCraft is installed in, next to pdfcraft.exe: %LOCALAPPDATA%\Programs\ArtCraft\PdfCraft\pdfcraft-cli.exe when installed for your account (the default since 0.15.0), or C:\Program Files\ArtCraft\PdfCraft\ for everyone. The installer doesn’t add it to your PATH, so use the full path.
Windows portable (.zip) In the unzipped folder, next to pdfcraft.exe
macOS A separate download, the pdfcraft-cli-…-macos-universal.zip on the Mac download page. It is signed and notarized like the app.
Linux .deb, .rpm or Arch package /usr/bin/pdfcraft-cli, already on your PATH
Linux tarball (.tar.gz) bin/pdfcraft-cli in the unpacked folder
Linux command-line tool (.tar.gz) A separate download with only pdfcraft-cli, for servers, CI and agents
Linux Flatpak Run it with flatpak run --command=pdfcraft-cli ai.storyteller.pdfcraft. The sandbox lets it reach only your Documents and Downloads folders.
Linux AppImage Not available. The AppImage starts only the app.

The examples below write pdfcraft-cli. Replace it with the full path if it isn’t on your PATH.

Everyday commands

These come from the README and the tool’s own help (pdfcraft-cli --help):

pdfcraft-cli info    form.pdf                       # structure as JSON, any PDF/A or PDF/UA claim, and repairs
pdfcraft-cli text    paper.pdf --page 3             # text in reading order
pdfcraft-cli render  paper.pdf --page 1 --dpi 150 --out page1.png
pdfcraft-cli combine report.pdf appendix.pdf --out combined.pdf
pdfcraft-cli extract report.pdf --pages 1,3,5-8 --out highlights.pdf
pdfcraft-cli split   report.pdf --every 10 --out-dir parts/
pdfcraft-cli edit    in.pdf --rotate 1,2:90 --delete 5 --title "Q3" --out out.pdf
pdfcraft-cli audit   redacted.pdf                   # fails when it finds text left under a black box

edit runs its options in order, and page numbers refer to the document after the earlier options. render writes PNG, JPEG, TIFF or PAM, by the file name you give; since 0.20.0 it needs the document to allow copying, as text does, or the owner password. Since 0.20.0 info also lists the repairs made while opening a damaged file.

Batch conversion, OCR and compression

pdfcraft-cli batch runs the same steps over files or folders, one file at a time, and never changes the source files (docs/cli-batch.md):

# Compress every PDF in a folder and its subfolders
pdfcraft-cli batch scans --root . --recursive --steps optimize --out-dir compressed
# Turn images and text files into PDFs, then compress them
pdfcraft-cli batch inputs --root . --recursive --steps convert,optimize --out-dir pdfs
# Add searchable text to scans, then compress
pdfcraft-cli batch scans --root . --recursive --steps ocr,optimize --out-dir searchable

Compression resamples images and can lose detail; the docs say it isn’t a lossless preset. batch picks up PDFs, images and text files only; Office documents in a folder are skipped. OCR reads English only (Latin script without accents), and pages that already contain text are skipped unless you add --ocr-all-pages. batch never replaces an existing output file: it numbers the new one instead (book (2).pdf). The docs add that guided actions (action_run) and folder OCR (ocr_recognize_files) don’t give that guarantee yet.

Run tools and scripts

Every engine feature is also a tool with a JSON Schema. pdfcraft-cli tools lists them, and run calls one, or a script of several in one session:

pdfcraft-cli tools                                  # every tool and its JSON Schema
pdfcraft-cli run text_find doc=1 query=invoice      # key=value; values are read as JSON
pdfcraft-cli run --script steps.json --root ./work  # several steps in one session
pdfcraft-cli run --script steps.json --report       # one JSON document with each step's result or error

With --root, every file the script’s steps read or write must be inside that folder. Edits stay in memory, and can be undone, until a step saves the document. Saving to the same file appends the changes and keeps the original bytes.

Tools added since 0.19.0 include:

  • text_replace, find and replace in existing text (0.21.0), and object_copy and object_paste, to copy page objects within and between documents (0.20.0).
  • doc_fix_hairlines (0.20.0), doc_printer_marks and doc_convert_colours (0.21.0) for print production, and print_color_profiles with colour management in doc_print (0.22.0).
  • page_templates, page_template_spawn and page_template_set_hidden for forms that add pages from templates (0.22.0), and attachment_edit (0.21.0).
  • A dry run in doc_batch, a target size in doc_optimize, and a regular expression with checksum tests (Luhn, IBAN) in redact_mark (0.20.0).
  • doc_create_multiple and doc_combine take Word, Excel, PowerPoint, OpenDocument and RTF files through an installed LibreOffice (0.21.0).
  • With JavaScript turned off, guided actions and doc_batch run no form scripts (0.21.0).

The OCR tools from 0.19.0 (ocr_recognize with a choice of engine, ocr_words, ocr_review_apply, ocr_dictionary) still read English only.

Connect an AI agent over MCP

The MCP server is off unless an agent starts it. It runs only while the agent runs pdfcraft-cli mcp, talks through that command’s input and output, opens no network port, and stops when the agent disconnects. Installing PdfCraft doesn’t register it anywhere.

For Claude Code, the docs give this command (replace /work/project with an existing folder):

claude mcp add pdfcraft -- pdfcraft-cli mcp --root /work/project

Other MCP clients take the same command in their configuration:

{ "mcpServers": { "pdfcraft": { "command": "pdfcraft-cli", "args": ["mcp", "--root", "/work/project"] } } }

If the client says it can’t find pdfcraft-cli, put the full path to the program in "command". The docs warn against a literal ~ or $HOME there.

--compact makes the tool list the agent has to read much shorter: about ten core tools plus tool_search and tool_call, which find and run all the others. Every tool still works. The agent can also browse PdfCraft’s command catalogue with command_list, run a command with command_run or several with command_batch, and see a page with render_preview.

Keep the agent to your folders

--root DIR keeps every file the agent reads or writes inside one folder. For finer control, the docs describe two separate limits, which the other Crafting Apps take too:

pdfcraft-cli mcp --automation-read-root /work/project --automation-write-root /work/project/out
  • Every file a tool reads (opening, combining, importing, fonts, certificates…) must be inside the read root, and every file it writes (saving, exporting, extracting, splitting, reports…) inside the write root. Give the same folder twice for both.
  • A root you leave out grants none of its access: with only a read root, nothing can be written to disk.
  • Each path is resolved, links included, before the check, so a link or a .. that leads out of a root is outside it. A refused path comes back as an ordinary error the agent can read.

The limits don’t cover everything. Tools that take no path still read and change the documents already open, and text and inspection tools hand their contents to the agent. Certificates in the macOS Keychain or the Windows certificate store aren’t files, so the limits don’t apply to signing with them, and sending a job to a printer isn’t a file write. The desktop app isn’t limited by these options.

Let an agent drive the app

The desktop app can also be operated by a script or an agent: it sees the window’s controls (from the accessibility tree), clicks, types, presses keys, runs commands and takes screenshots. This is also off by default. Start the app with a control file:

pdfcraft --control ~/.pdfcraft-control.json report.pdf
pdfcraft-cli ui --control ~/.pdfcraft-control.json inspect query=rotate
pdfcraft-cli ui --control ~/.pdfcraft-control.json click label="Organize pages"
pdfcraft-cli ui --control ~/.pdfcraft-control.json screenshot --out window.png

It listens only on your own computer, and every connection must present the random key the app writes to that file. Keep the file in a folder only you can write to, not a shared one such as /tmp: the README warns that another user could create it there first and receive your commands. pdfcraft-cli ui refuses a control file that is a link, or one that another user owns or can read. Since 0.20.0 that holds on Windows too, where the app gives the file an access list with only you and SYSTEM on it. On Windows, cmd.exe doesn’t expand ~: use %USERPROFILE%\.pdfcraft-control.json there. When asked to quit, the app still asks about unsaved changes rather than discarding them.

Before you use it

  • Work on copies. PdfCraft is alpha software, and an agent can make many changes quickly. Edits are undoable until saved, but a saved file is changed.
  • Use the limits. Give the agent a working folder with --root, or separate read and write roots, rather than your whole home folder.
  • Leave it out entirely if you prefer. The developers say a build without the MCP server is possible (cargo build -p pdfcraft-cli --no-default-features); the released downloads include it, switched off until an agent starts it.

Is PdfCraft safe? covers what the app itself does with your files and the network.