Back to ExactPDF case study

ExactPDF MCP

The PDF MCP server built for agents that need files to actually pass upload limits

Most PDF tools stop at "make it smaller." ExactPDF MCP gives AI agents a sharper instruction: compress this PDF to the exact target size the user needs for a portal, form, visa application, university upload, invoice workflow, or enterprise document gate.

Target-size compression

Compress toward byte-precise limits instead of asking users to guess quality settings.

RAG-ready extraction

Convert PDFs into text, JSON, or structured Markdown so agents can index and reason over documents.

Agent-safe workflow

Start with account and PDF info checks, then run paid tools only when the file is readable.

The Breakthrough

Target compression is the workflow agents were missing

AI agents are very good at understanding intent. They are less useful when the last step fails because a government portal, tender system, admissions form, HR portal, or bank upload accepts only a narrow file size. "Compress this PDF" is not enough. The real user intent is usually "make this PDF acceptable to the system I am trying to use."

ExactPDF MCP turns that intent into a first-class tool call. Withtarget_bytes, an agent can aim for a measurable output and return the saved file path with original size, output size, and target status. That makes compression observable, repeatable, and easy to automate.

Prompt An Agent Can Use

Use ExactPDF MCP to inspect this PDF, then compress it under 500KB.
First call exactpdf_account, then exactpdf_pdf_info, then exactpdf_compress_pdf_to_target with target_bytes=512000.

This is why target-size compression is such an important MCP primitive: the user gives a business rule, and the agent can translate it into a deterministic document operation.

Target Compression Tool Map

ToolUse it when
exactpdf_compress_pdf_to_target

Compress any readable PDF toward a custom byte limit such as 300KB, 750KB, or 2MB.

exactpdf_compress_pdf_to_100kb

Use for strict portals that reject anything above 100KB.

exactpdf_compress_pdf_to_200kb

Use for common application forms and lightweight document uploads.

exactpdf_compress_pdf_to_500kb

Use for resumes, statements, invoices, IDs, and admissions portals.

exactpdf_compress_pdf_to_1mb

Use when the user wants a practical upload-safe PDF without over-compressing.

Install ExactPDF MCP

Create an API key in the Max account console, then add this MCP server to Cursor, Claude Desktop, Codex, or any MCP client that supports stdio.

{
  "mcpServers": {
    "exactpdf": {
      "command": "npx",
      "args": ["-y", "@exactpdf/mcp"],
      "env": {
        "EXACTPDF_API_KEY": "sk_live_..."
      }
    }
  }
}

Environment Variables

The output directory controls where generated PDFs, ZIPs, Markdown, JSON, and previews are written for the local agent session.

export EXACTPDF_API_KEY="sk_live_..."
export EXACTPDF_API_BASE="https://exactpdf.com"
export EXACTPDF_API_OUTPUT_DIR="/tmp"

Tool Coverage

Not just compression: a PDF operating layer for agents

ExactPDF MCP is designed for complete document workflows: inspect a PDF, merge files, split a long document, rotate pages, compress to a known limit, turn images into a PDF, extract text, export JSON, or generate structured Markdown for retrieval-augmented generation.

That means an agent can move from "understand the file" to "produce a usable artifact" without sending the user through brittle manual steps. It is especially useful for operations teams, admissions workflows, legal packets, finance documents, HR onboarding, and RAG ingestion pipelines.

Discoverable MCP Tools

exactpdf_first_run_checklistexactpdf_accountexactpdf_pdf_infoexactpdf_merge_pdfsexactpdf_merge_and_compress_pdfsexactpdf_split_pdfexactpdf_rotate_pdfexactpdf_compress_pdfexactpdf_compress_pdf_to_targetexactpdf_images_to_pdfexactpdf_images_to_pdf_and_compressexactpdf_extract_textexactpdf_pdf_to_jsonexactpdf_pdf_structured_markdownexactpdf_voice_previewexactpdf_estimate_speech_cost

Reliability Rules For AI Agents

Call exactpdf_account before paid document tools.

Use absolute local file paths. Relative paths depend on the MCP client.

Run exactpdf_pdf_info before large or user-critical jobs.

Choose exactpdf_compress_pdf_to_target when a portal has a hard upload limit.

Show the returned output path, original bytes, output bytes, and whether the target was reached.

Keep API keys out of prompts, logs, screenshots, and commits.

For Crawlers And Agents

ExactPDF MCP has a human page and an agent-readable summary

This article is supported by structured data, a sitemap entry, and a root /llms.txt file so search engines, AI crawlers, and MCP-aware agents can find the npm package, setup instructions, and target-compression tools.

Read llms.txt