Skip to main content
Glama
JustFill PDF Forms

JustFill PDF Forms

JustFill MCP Server

Let AI agents (Claude, ChatGPT, n8n — any MCP client) detect, review and fill PDF form fields through justfill.app.

Fill PDF forms in ChatGPT

Install the published JustFill PDF Forms plugin from the ChatGPT plugin directory, then connect your JustFill account. This hosted path does not require installing the Python client or configuring an MCP server manually.

Try this prompt with the one-page, six-field sample:

Use JustFill to open https://justfill.app/examples/chatgpt/project-intake.pdf.
List its fields and show a preview. Do not fill anything yet.

Ask for a filled preview with fictional values and approve it before generating the PDF. Save the reviewed layout, then open the same original blank PDF for the next client or project. Your saved template is available in the same JustFill account; generated files follow that account's plan.

Try the two-project example and download the real editable results. The example includes prompts for two fictional clients, the blank PDF, and two generated PDFs with their free-output watermark.

Related MCP server: pdf-filler-mcp

Hosted server — no local installation

If your MCP client supports remote servers with OAuth, use this server URL:

https://justfill.app/api/mcp

Connect from your client, sign in to JustFill, and review the access request. You do not need to install the Python package or copy an API key for this path. Access can be revoked in JustFill under Account → API Keys.

Connection guide. The client is MIT-licensed; PDF processing uses your JustFill account's allowance. For a first check, use a blank form and fictional values, and review the filled preview before exporting. Save the reviewed layout to reuse it with new data when the same form comes up again.

Excel or CSV batch workflow

If the source data is already in a spreadsheet and you need one filled copy of the same existing PDF per row, an MCP client is optional. The guided browser workflow imports XLSX or CSV, maps columns to reviewed PDF fields, previews each record, and exports the approved PDFs in a ZIP.

Try the five-row PDF mail merge sample — no card or sales call.

Import-ready n8n workflows

Start with the deterministic workflow JSON in this repository. It collects a PDF and JSON payload, reuses the reviewed field names saved for that exact form, fills the original layout and returns a temporary download link.

The workflow is listed in the n8n template library. For new runs, import the current strict-mapping JSON from this repository, which includes the synthetic fixture and validation evidence alongside it. The workflow is free to download; running it uses a JustFill account and its PDF-processing allowance. It uses built-in nodes, not the separate JustFill community node.

The repository also includes the exact deterministic workflow JSON, synthetic test PDF, production evidence and a separate two-pass vision workflow for an unfamiliar form. Both call the hosted MCP endpoint with standard HTTP Request nodes and can be inspected before adding credentials.

Inspect the source workflows and evidence, or follow the step-by-step n8n setup.

Business example: recurring supplier intake

An operations team can keep the supplier's required intake PDF unchanged, save its reviewed field layout once, and let n8n map approved vendor data from a webhook or CRM record into that exact form. The workflow returns a temporary filled-PDF link that can be reviewed before it is uploaded to Drive, attached to a draft email, or written back to the vendor record. The repository's synthetic supplier-intake PDF exercises this exact path without customer data.

Gemini CLI extension

Install the same reviewed MCP tools plus the included PDF workflow guidance:

gemini extensions install https://github.com/mrmaciej1/justfill-mcp

The extension manifest lives at the repository root and uses the published justfill-mcp package. Gemini CLI asks for normal third-party extension consent before enabling it.

Why agents can trust it

Source

Confidence

What it means

Saved template

1.0

This exact PDF was filled before; geometry is human/agent-verified. No ML runs at all.

AcroForm

1.0

The PDF has embedded form fields — read from the file, filled natively.

ML detection

0.0–0.95

An honest draft. Review it visually (render_preview), fix it, then save_template to lock it in.

ML confidence is calibrated: the detector's raw scores are not probabilities (its server-side filter accepts boxes from raw ~0.02 and auto-accepts at raw 0.15), so they are mapped onto 0–1 to mean what you'd expect — ≥0.75 "detector is sure", 0.4–0.75 "probably right, glance at the preview", <0.4 "borderline accept, verify". The raw detector score is kept on each field as raw_score.

The correction loop (render_preview → add/update/remove_field) exists precisely because ML detection has false positives and negatives. A false positive costs nothing (leave it unfilled or remove it); a false negative is visible on the preview and fixable with one add_field call. Once reviewed, save_template makes every future fill of that form deterministic.

Local client setup

uv tool install justfill-mcp

Authorize once (opens the browser, one click while logged in to justfill.app):

justfill-mcp login

Then the config needs no credentials at all:

{
  "mcpServers": {
    "justfill": { "command": "justfill-mcp" }
  }
}

For a zero-install configuration, use uvx directly:

{
  "mcpServers": {
    "justfill": {
      "command": "uvx",
      "args": ["justfill-mcp"]
    }
  }
}

Alternatives, in the order the server checks them:

  1. JUSTFILL_API_KEY env — create a key at justfill.app → Account → API Keys and put "env": {"JUSTFILL_API_KEY": "jf_live_…"} in the config.

  2. The key saved by justfill-mcp login (~/.config/justfill/credentials.json).

  3. JUSTFILL_EMAIL + JUSTFILL_PASSWORD — legacy fallback; an API key is better (no password in config files, revocable per client, never expires mid-session).

Tools

  • open_pdf(path, min_confidence=0.0, max_pages=10, force_detect=False) — template → AcroForm → ML resolution order. Accepts scanned images too (jpg/png/tiff → converted to PDF, deterministically, so templates still match). force_detect=True ignores a saved template and re-runs ML.

  • render_preview(page_index) — page image with labeled field boxes (blue = deterministic, green/orange/red = ML confidence)

  • render_filled_preview(values, page_index) — the same page with your values drawn in place (checkboxes get an X). Costs no fills — check before you fill.

  • list_fields(page_index?)

  • add_field(x, y, w, h, name, page_index, field_type, align?, vertical_align?) — coords in % of page, top-left origin

  • update_field(field_id, …) / remove_field(field_id)

  • update_fields([{field_id, …}, …]) / remove_fields([ids]) — batch versions

  • prune_fields(field_type?, confidence_below?, width_below?, height_below?, page_index?, exclude_ids?) — bulk-delete detection noise in one call (criteria AND-ed, removed ids returned)

  • fill_pdf(values, output_path, flatten=True) — values = {field_id: text}; responds with warnings for values that will be shrunk/truncated to fit

  • save_template(name) — persist the reviewed layout for deterministic repeat fills

  • list_templates()

Text alignment: align = left|center|right, vertical_align = top|middle|bottom — set per field (e.g. right for RTL forms, center for boxed digits). Persisted in templates.

Example agent flow

open_pdf("~/forms/w-9.pdf")            → acroform, 27 fields, confidence 1.0
fill_pdf({"f1": "Jane Doe", …}, "~/out/w-9-filled.pdf")
open_pdf("~/forms/scan.jpg")           → converted to PDF; ml, 34 fields
render_preview(0)                      → agent sees noise + one missed line
prune_fields(field_type="cell", width_below=3)   → 16 removed in one call
add_field(x=18, y=62.5, w=40, h=3, name="Phone")
render_filled_preview({…})             → values sit right, no overflow
fill_pdf({…}, "~/out/filled.pdf")
save_template("Client intake form")    → next time: deterministic

Notes

  • Auth is a regular justfill.app account; tokens auto-refresh on expiry.

  • 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.

  • One PDF open at a time per server session (by design — keeps ids stable).

  • This repository mirrors released versions of the MCP client (development happens in a private monorepo alongside the justfill.app backend). Bug reports and feature requests are very welcome in the issue tracker here.

Available Tools

14 tools
add_fieldAInspect

Add a field the detector missed (a false negative).

Coordinates are percentages of the page (0-100), top-left origin — read them off the render_preview image proportionally. align ('left'|'center'|'right') and vertical_align ('top'|'middle'|'bottom') control where the value sits inside the box when the PDF is filled.

Inputs: h (required), w (required), x (required), y (required), +5 more. Returns: result

close_workspaceAInspect

Release the current PDF and field data when work is finished.

Saved templates and output PDFs are not deleted. This operation is idempotent, which makes it safe to call from automation cleanup blocks.

Inputs: no named parameters. Returns: result

fill_pdfAInspect

Fill the PDF and save it.

values maps field id -> text value (checkboxes: "true"/"yes"/"x" to tick). Fields not present in values stay empty. AcroForm fields are filled natively inside the PDF; everything else is drawn at its exact box. The response's warnings list flags values that will be shrunk or truncated to fit their box — fix those before delivering the document.

Inputs: values (required), output_path (required), flatten. Returns: result

list_fieldsCInspect

List the current working fields (optionally one page only).

Inputs: page_index. Returns: result

list_templatesCInspect

List saved templates on this account (name + field count + hash).

Inputs: limit. Returns: result

open_pdfAInspect

Open a PDF (or a scanned image: jpg/png/tiff) and detect its fillable fields.

Images are converted to a single-page PDF automatically (deterministically, so a template saved for a photo matches the same photo next time).

Resolution order (best source wins):

  1. Saved template matching this exact file (deterministic, confidence 1.0)

  2. Embedded AcroForm fields (deterministic, confidence 1.0)

  3. ML detection (each field carries a confidence score)

force_detect=True skips steps 1-2 and re-runs ML detection from scratch — use it to rebuild a layout when the saved template is wrong or stale. min_confidence drops ML fields scored below it (templates/AcroForm are always kept). Returns a JSON summary + the field list.

Inputs: path (required), max_pages, force_detect, min_confidence. Returns: result

prune_fieldsAInspect

Bulk-delete fields matching ALL given criteria (e.g. detection noise).

field_type: exact type match (e.g. 'cell'); confidence_below / width_below / height_below: strictly-less-than thresholds (w/h in % of page); page_index: limit to one page; exclude_ids: always keep these. Returns the removed ids so the operation is auditable (and reversible via add_field if it cut too much).

Inputs: field_type, page_index, exclude_ids, width_below, +2 more. Returns: result

remove_fieldCInspect

Delete a field that isn't a real input (a false positive).

Inputs: field_id (required). Returns: result

remove_fieldsBInspect

Delete many fields in one call (batch version of remove_field).

Inputs: field_ids (required). Returns: result

render_filled_previewAInspect

Preview how the filled page will look BEFORE generating the PDF.

Draws values (field id -> text; checkboxes get an X) into their boxes on the rendered page. Costs nothing — no fill is consumed. Typography is an approximation of the final output (the server typesets the real PDF), so use it to verify placement, alignment and obvious overflow, then fill_pdf.

Inputs: values (required), page_index.

render_previewAInspect

Render a page with the working field boxes drawn on it.

Look at this image to VERIFY placement: blue boxes are deterministic (template/AcroForm/agent-placed); green/orange/red are ML detections by confidence (>=0.7 / >=0.4 / <0.4). Each box is labeled with its field id.

Inputs: page_index.

save_templateAInspect

Save the current (reviewed) field layout as a reusable template.

Next time this exact PDF is opened — by you or another agent session on this account — open_pdf returns these fields with confidence 1.0 and no ML pass at all. This is what makes repeat filling deterministic.

Before saving, give every field a short semantic name (update_fields with name=..., e.g. 'age_score', 'total_abcd2') — names are stored in the template, so the next session maps values by meaning instead of guessing from coordinates. Also remove false positives first (remove_fields).

Inputs: name (required). Returns: result

update_fieldCInspect

Move/resize/rename a field, or set its text alignment.

align: 'left'|'center'|'right'; vertical_align: 'top'|'middle'|'bottom' — where the value sits inside the box in the filled PDF.

Inputs: field_id (required), h, w, x, +5 more. Returns: result

update_fieldsAInspect

Update many fields in one call (batch version of update_field).

Each item: {"field_id": "...", and any of x, y, w, h, name, field_type, align, vertical_align}. Items with an unknown field_id are reported back, the rest are still applied.

Inputs: updates (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 14 tools

    Disambiguation5/5

    Each tool has a clear, distinct purpose. Despite multiple tools for field removal and update, they differentiate by batch/single/targeted criteria. Preview tools are separated by whether they show boxes or filled content. No two tools are ambiguous.

    Naming Consistency5/5

    All tools use consistent snake_case with verb_noun pattern (e.g., remove_fields, fill_pdf, list_templates). Batch versions are indicated by plural nouns (fields vs field), which is intuitive. No mixing of styles.

    Tool Count5/5

    14 tools cover the full workflow of PDF form filling: opening, detection, field manipulation, templates, preview, fill, and cleanup. This is well-scoped for the domain without being excessive or sparse.

    Completeness4/5

    The tool surface covers the main lifecycle: open, detect, add/remove/update fields, preview, fill, save templates, and close. Minor gaps: no explicit retrieval of the output PDF path or deletion of templates, but these are not critical for the core filling task.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      FormFill MCP — AI-powered web form automation. Fill out any online form by describing what you want. Supports Stripe payments via x402 protocol.
      3
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables filling any PDF form, including scanned or AcroForm, through a browser-based drag-and-drop editor. Works entirely locally with no data leaving the machine.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Gives AI agents tools to read PDFs, list form fields, apply operations, highlight, add notes, fill fields, place signatures, list signatures, and flatten PDFs.
      1
      AGPL 3.0
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to perform comprehensive PDF operations locally, including compression, text extraction, PII redaction, page organization, splitting, merging, watermarking, creation, and form filling, all without cloud uploads.
      13 npm
      -