🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@exactpdf/mcp

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@exactpdf/mcp

MCP server for ExactPDF — target-size compression, structured Markdown/RAG, PDF JSON, bounded PDF audio jobs, and API credits.

latest
Source
npmnpm
Version
0.2.17
Version published
Weekly downloads
856
553.44%
Maintainers
1
Weekly downloads
 
Created
Source

@exactpdf/mcp

Model Context Protocol (stdio) server for ExactPDF — production PDF tools for Cursor, Claude Desktop, Codex, and any MCP client.

Use it when an agent needs to inspect, merge, split, rotate, compress to upload limits, extract text, export PDF JSON, export structured Markdown for RAG, or build images-to-PDF workflows without writing fragile PDF plumbing.

Design principle: every tool should work on first run, explain credit cost before risky work, return a local output path for files, and expose precise HTTP/API errors when something fails.

Developer quickstart: https://exactpdf.com/developers

One-minute Setup

ExactPDF MCP is free to install. Hosted ExactPDF API workflows include 20 free test credits, then pay-as-you-go credits when the workflow is worth automating.

  • Create an API key at max.exactpdf.com/account. New accounts get 20 free test credits. Buy one-time credit packs only after the workflow works; no subscription is required for API/MCP.
  • Export:
export EXACTPDF_API_KEY="sk_live_…"
# Optional: default https://exactpdf.com
export EXACTPDF_API_BASE="https://exactpdf.com"
# Optional: where API binary outputs are written (default: OS temp dir)
export EXACTPDF_API_OUTPUT_DIR="/tmp"
# Backward-compatible alias:
export EXACTPDF_MERGE_OUTPUT_DIR="/tmp"
  • Add to your MCP config (Cursor → Settings → MCP):
{
  "mcpServers": {
    "exactpdf": {
      "command": "npx",
      "args": ["-y", "@exactpdf/mcp"],
      "env": {
        "EXACTPDF_API_KEY": "sk_live_…"
      }
    }
  }
}

For a local checkout of this monorepo:

"command": "node",
"args": ["/path/to/ExactPDF/packages/exactpdf-mcp/dist/run.js"]

Copy-paste Configs

Use this bare config when your client lets you set environment variables separately:

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

Use this config when the client supports env values inside JSON:

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

Claude Desktop

Add to claude_desktop_config.json, then restart Claude Desktop:

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

Claude Code

Add the server from your project terminal:

claude mcp add exactpdf -- npx -y @exactpdf/mcp
export EXACTPDF_API_KEY="sk_live_..."

If your Claude Code setup stores env values in its MCP config, use the JSON block above instead.

Cursor

Add to .cursor/mcp.json or Cursor Settings -> MCP:

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

Windsurf

Add ExactPDF as a custom MCP server:

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

VS Code / Cline

Add to your Cline MCP settings:

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

Five Agent Recipes

Paste one of these after the MCP server is connected. Use absolute local file paths.

Merge these 3 PDFs into one file:
/Users/me/Desktop/cover.pdf
/Users/me/Desktop/form.pdf
/Users/me/Desktop/id.pdf
Compress /Users/me/Desktop/application.pdf under 500KB for a government upload.
Use ExactPDF MCP and save the output next to the original.
Convert /Users/me/Desktop/manual.pdf to structured Markdown for RAG.
Keep headings and page references.
Extract metadata and per-page JSON from /Users/me/Desktop/contract.pdf.
Show me the page count, title, author, and first-page text.
Turn these images into one PDF:
/Users/me/Desktop/photo-1.jpg
/Users/me/Desktop/photo-2.jpg
/Users/me/Desktop/photo-3.jpg

30-Second Demo

ExactPDF MCP setup demo

Video: https://exactpdf.com/demos/exactpdf-mcp-demo.mp4

Install ExactPDF MCP, paste one config block, ask your agent to fix a PDF, and get a local output file.

Tools

Safe first run:

1. exactpdf_first_run_checklist
2. exactpdf_account
3. exactpdf_pdf_info(path="/absolute/path/document.pdf")
4. exactpdf_voice_preview(text="Short sample...", voice_style="professional")
5. exactpdf_estimate_speech_cost(path="/absolute/path/document.pdf", mode="audiobook")
6. exactpdf_generate_audiobook(path="/absolute/path/document.pdf", output_format="m4b")

Document outputs are saved to EXACTPDF_API_OUTPUT_DIR or your OS temp directory. Paid document tools consume credits only on successful output.

English PDF speech, audiobook, and presentation narration use a dedicated queue and worker. Launch limits are 1 MB, 20 selected pages, 18,000 narrated characters, 20 generated minutes, and one active audio job per account. Translation remains disabled until multilingual pronunciation and provider-cost gates pass.

Credit model:

  • Free probes: checklist, account, PDF info, voice preview, speech cost estimate, and job polling.
  • New accounts: 20 free test credits for API/MCP workflows.
  • Standard document tools: 1 credit only after a successful output.
  • MP3/M4B narration: 15 credits per generated minute.
  • MP4 presentation narration: 20 credits per generated minute.
  • One-time packs: available in Max Account when you need more; no subscription required for API/MCP.
ToolEndpointCredits
exactpdf_first_run_checklistlocal guidance0
exactpdf_accountGET /api/v1/account0
exactpdf_pdf_infoPOST /api/v1/pdf-info0
exactpdf_merge_pdfsPOST /api/v1/merge1
exactpdf_merge_and_compress_pdfsPOST /api/v1/merge-compress1
exactpdf_split_pdfPOST /api/v1/split1
exactpdf_rotate_pdfPOST /api/v1/rotate1
exactpdf_compress_pdfPOST /api/v1/compress1
exactpdf_compress_pdf_to_targetPOST /api/v1/compress + target_bytes1
exactpdf_compress_pdf_to_100kbPOST /api/v1/compress + 102400 target_bytes1
exactpdf_compress_pdf_to_200kbPOST /api/v1/compress + 204800 target_bytes1
exactpdf_compress_pdf_to_500kbPOST /api/v1/compress + 512000 target_bytes1
exactpdf_compress_pdf_to_1mbPOST /api/v1/compress + 1048576 target_bytes1
exactpdf_pdf_to_imagesplanned /api/v1/pdf-to-imagesbackend required
exactpdf_images_to_pdfPOST /api/v1/images-to-pdf1
exactpdf_images_to_pdf_and_compressPOST /api/v1/images-to-pdf-compress1
exactpdf_extract_textPOST /api/v1/extract-text1
exactpdf_pdf_to_jsonPOST /api/v1/pdf-to-json1
exactpdf_pdf_structured_markdownPOST /api/v1/pdf-structured-markdown1
exactpdf_ocr_pdfplanned /api/v1/ocrbackend required
exactpdf_estimate_speech_costlocal estimate0
exactpdf_voice_previewPOST /api/v1/voice-preview0
exactpdf_pdf_to_speechPOST /api/v1/pdf-to-speech15/min MP3/M4B; 20/min MP4
exactpdf_pdf_to_audiobookPOST /api/v1/pdf-to-audiobook15/min MP3/M4B; 20/min MP4
exactpdf_generate_audiobookPOST /api/v1/generate-audiobook15/min MP3/M4B; 20/min MP4
exactpdf_translate_and_speakPOST /api/v1/translate-and-speakdisabled / multilingual hardening
exactpdf_presentation_narrationPOST /api/v1/presentation-narration20/min MP4
exactpdf_job_statusGET /api/v1/jobs/:id0 / polling
exactpdf_get_speech_jobGET /api/v1/speech-jobs/:id0 / polling
exactpdf_download_audioGET /api/v1/speech-jobs/:id/download0 / download

Tool behavior

Tool familyWhat the agent providesWhat ExactPDF returns
Account / inspectAPI key, local PDF pathJSON balance, page count, metadata
PDF operationsAbsolute local PDF pathsSaved PDF/ZIP path plus remaining credits and measured size headers
Target-size compressionAbsolute local PDF path, target bytes or presetSaved PDF plus X-Target-Reached, original bytes, output bytes
Text / JSON / MarkdownAbsolute local PDF pathJSON text/pages/metadata or Markdown, page count, structured content
Backend-required PDF images/OCRDesired path/optionsClear backend-required message plus live browser tool URL
Voice previewShort text, voice style/languageSaved MP3/WAV preview, no credit charge
Audio planningShort text, character count, rough PDF sizeVoice preview or estimated minutes/credits
Audio generationEnglish PDF up to launch limitsQueued job, pricing, progress, and saved MP3/M4B/MP4

Bounded audio workflow:

1. exactpdf_estimate_speech_cost(path="/abs/book.pdf", mode="audiobook")
2. exactpdf_voice_preview(text="Read the first paragraph in an audiobook tone", voice_style="audiobook")
3. exactpdf_generate_audiobook(path="/abs/book.pdf", output_format="m4b", language="en")
4. exactpdf_get_speech_job(job_id="...", download=true)

Audio submissions are rejected before queueing when they exceed launch limits. Translate-and-speak intentionally returns an error before paid work begins.

Reliability rules for agent builders

  • Always call exactpdf_account once before paid tools.
  • Use absolute file paths. Relative paths are client-dependent and may fail.
  • Use exactpdf_pdf_info before large jobs to confirm the file is readable.
  • Use exactpdf_estimate_speech_cost and obtain user approval before paid audio.
  • Use exactpdf_voice_preview before making any narration-quality decision.
  • Do not promise translated audio; translate-and-speak remains disabled.
  • If a tool returns isError, show the HTTP status and response body to the user. The API returns structured error details.
  • Keep API keys out of prompts, logs, screenshots, and commits.

Publish checklist

npm run mcp:package:check
cd packages/exactpdf-mcp
npm publish --access public
npx -y mcp-publisher publish --file server.json

The package must exist on the public npm registry before the MCP Registry can verify mcpName.

Docs

License

MIT

Keywords

mcp

FAQs

Package last updated on 05 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts