JustFill MCP Server lets AI agents (Claude, ChatGPT, n8n, or any MCP client) detect, review, and fill PDF form fields via justfill.app.
-
Purpose and Positioning This tool is aimed at scenarios that require filling in "existing PDF forms," covering AcroForm forms, flat PDFs, and scanned PDFs. The core approach is to first review the field layout once, save it as a template, and thereafter reuse it for deterministic filling with new data.
-
Main Capabilities
- Field detection and review: Detect fields via open_pdf; field sources are resolved in the order "template → AcroForm → ML recognition," and scanned images (jpg/png/tiff) are deterministically converted to PDF to ensure templates can still match.
- Preview: render_preview outputs page images with annotated field boxes (blue for deterministic fields, green/orange/red for ML confidence); render_filled_preview shows the filled-in values on the same page (checkboxes display X) and does not consume filling quota.
- Field editing: list_fields, add_field, update_field, remove_field, update_fields, remove_fields, as well as prune_fields for batch-removing detection noise. add_field coordinates are in page percentages, with the origin at the top-left corner.
- Templates: save_template persists the reviewed layout, list_templates lists templates; when the same form appears again, deterministic repeated filling can be achieved.
- Filling: fill_pdf fills according to {field_id: text}, defaults to flatten=True, and gives warnings for values that will be shrunk or truncated; whether the output is watermarked is determined by the account service.
- Text alignment: align (left|center|right) and vertical_align (top|middle|bottom) can be set per field and persisted to the template (e.g., use right for RTL forms, center for boxed numbers).
- ML confidence calibration: The detector's raw scores are not probabilities and have been mapped to 0–1: ≥0.75 means "the detector is confident," 0.4–0.75 means "possibly correct, recommend taking a look at the preview,"<0.4 indicates "edge case, requires manual review"; the original score is stored in the raw_score field.
- Correction loop: render_preview → add/update/remove_field. False positives have no cost (simply leave blank or delete); false negatives will be visible in the preview and can be fixed with a single add_field. After review, save_template makes subsequent filling deterministic.
III. How to Use
- ChatGPT: Install the published JustFill PDF Forms plugin from the ChatGPT plugin directory and connect a JustFill account; no need to install a Python client or manually configure an MCP server.
- Hosted server (no local installation required): If the client supports a remote server with OAuth, you can connect directly using the server URL, log in to JustFill, and confirm the access request; no need to install a Python package or copy an API key. Access can be revoked in JustFill under Account → API Keys. For a first check, it is recommended to use a blank form with fictitious values, and to review the filling preview before exporting.
- Excel/CSV batch: If the data is already in a spreadsheet and you need to generate a filled copy of the same PDF for each row, you can skip the MCP client. The guided browser workflow supports importing XLSX or CSV, mapping columns to reviewed PDF fields, previewing item by item, and exporting the approved PDFs as a ZIP.
- n8n workflow: The repository provides a directly importable deterministic workflow JSON that collects the PDF and JSON payload, reuses the reviewed field names saved for that form, fills the original layout, and returns a temporary download link. The workflow is listed in the n8n template library and can be downloaded for free; running it uses a JustFill account and its PDF processing quota, and it uses built-in nodes rather than a separate JustFill community node. The repository also includes the exact deterministic workflow JSON, synthetic test PDFs, production evidence, and a two-pass visual workflow for unfamiliar forms, all using the standard HTTP Request node to call the hosted MCP endpoint, which can be reviewed before adding credentials.
- Gemini CLI extension: Install the same set of reviewed MCP tools along with the accompanying PDF workflow guidance; the extension manifest is located at the repository root and uses the published justfill-mcp package; before enabling it, Gemini CLI will request the usual third-party extension consent.
- Local client: first run justfill-mcp login once to authorize (it opens a browser, and a single click is enough while logged in to justfill.app); no credentials are needed in the configuration; uvx allows zero-install execution. Credentials are checked in the following order: the JUSTFILL_API_KEY environment variable (created in justfill.app → Account → API Keys); the key saved by justfill-mcp login (~/.config/justfill/credentials.json); the legacy fallback of JUSTFILL_EMAIL + JUSTFILL_PASSWORD (less preferable than an API key, because no password needs to be stored in a configuration file, it can be revoked per client, and it does not expire mid-session).
IV. Use cases (examples)
- Business example: recurring supplier information registration. An operations team can keep the supplier-required PDF unchanged, save its reviewed field layout once, and let n8n map approved supplier data from a webhook or CRM into that form; the workflow returns a link to the temporarily filled PDF, which after review can be uploaded to Drive, attached to a draft email, or written back to the supplier record. The repository's synthetic supplier registration PDF can exercise this path without using customer data.
V. Limitations and notes
- Authentication uses a regular justfill.app account, and tokens are automatically refreshed when they expire; usage and document output rules are enforced by the same account service as the web app; fill_pdf reports whether the output is clean or watermarked.
- Only one PDF is open per server session at a time (by design, to keep ids stable).
- Generated files follow the corresponding account's plan; this client is MIT-licensed, and PDF processing consumes JustFill account credits.
- This repository mirrors the published version of the MCP client (development takes place in the same private monorepo as the justfill.app backend); issues and feature requests are welcome in this repository's issue tracker.