# PDF.co — how to use (mcp.ai)

Connect your PDF.co account and use 35 tools for documents straight from your AI agent. Connect with your own API key. PDF.co is a REST API platform for PDF automation including PDF extraction, generation, editing, splitting, merging, form filling, barcode processing, OCR, document parsing, file conversion (PDF to Excel/CSV/JSON/XML/HTML/Image and vice versa), and AI-powered invoice parsing.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_pdf_co?ms=1787293500000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `pdf_co_account_balance_info`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/pdf_co`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/pdf_co/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/pdf_co/account/balance/info` — Tool to get account balance info. Use after authenticating to check remaining credits.
- `POST https://api.mcp.ai/api/pdf_co/barcode/generate` — DEPRECATED: Use PDFCOPostBarcodeGenerate instead. Tool to generate barcode images (QR, Code128, Code39, PDF417, etc.). Use when you need to encode data into barcodes on the fly.
  - body: { name?: string, type: string, value: string, async_?: boolean, margin?: integer, addText?: boolean, fontName?: string, fontSize?: integer, backColor?: string, foreColor?: string, resolution?: integer, aspectRatio?: number, pdfPassword?: string, barcodeWidth?: integer, outputFormat?: string, barcodeHeight?: integer, caseSensitive?: boolean }
- `POST https://api.mcp.ai/api/pdf_co/convert/excel/to/csv` — Tool to convert an Excel file (XLS/XLSX) to CSV. Use when you have a public Excel file URL and need CSV output. Inline option returns data inline; otherwise provides download URL.
  - body: { url: string, name?: string, pages?: string, inline?: boolean, password?: string, profiles?: string }
- `POST https://api.mcp.ai/api/pdf_co/convert/excel/to/html` — Tool to convert an Excel file to HTML. Use when you have an Excel URL and need HTML output.
  - body: { url: string, name?: string, async?: boolean, profiles?: string }
- `POST https://api.mcp.ai/api/pdf_co/convert/excel/to/json` — Tool to convert an online Excel or CSV file to JSON format. Use when you have a public file URL and need structured data extraction.
  - body: { url: string, name?: string, pages?: string, password?: string, profiles?: string }
- `POST https://api.mcp.ai/api/pdf_co/convert/excel/to/text` — Tool to convert Excel files to plain text. Use after providing an Excel file URL to extract spreadsheet content.
  - body: { url: string, name?: string, pages?: string, inline?: boolean, encrypt?: boolean, password?: string, profiles?: string }
- `POST https://api.mcp.ai/api/pdf_co/convert/excel/to/xml` — Tool to convert an Excel file to XML. Use when needing XML output from xls/xlsx/csv synchronously or asynchronously.
  - body: { url: string, name?: string, async?: boolean, inline?: boolean, callback?: string, profiles?: object, expiration?: integer, httppassword?: string, httpusername?: string, worksheetIndex?: string, DataDecryptionIV?: string, DataEncryptionIV?: string, DataDecryptionKey?: string, DataEncryptionKey?: string, DataDecryptionAlgorithm?: string, DataEncryptionAlgorithm?: string }
- `POST https://api.mcp.ai/api/pdf_co/document/parser` — Tool to parse documents based on predefined templates to extract structured data. Use when you need to extract structured fields from a PDF by supplying a custom template.
  - body: { url?: string, file?: string, name?: string, pages?: string, inline?: boolean, password?: string, template: string, async_req?: boolean, outputFormat?: string }
- `POST https://api.mcp.ai/api/pdf_co/file/upload` — Tool to upload a local file or remote URL to PDF.co, returning a hosted URL for downstream processing. Use when a PDF.co tool (e.g., PDF_CO_PDF_FROM_HTML) requires a remote URL but you have a local fi
  - body: { url?: string, file?: object, name?: string, run_async?: boolean }
- `POST https://api.mcp.ai/api/pdf_co/job/check` — Tool to check status and result of an asynchronous job. Use after submitting a job to poll for completion.
  - body: { force?: boolean, job_id: string }
- `POST https://api.mcp.ai/api/pdf_co/pdf/add` — Tool to add content to an existing PDF. Use when you need to overlay text, images, barcodes, or links before distributing the file.
  - body: { url: string, name?: string, pages?: string, objects: object[], password?: string, run_async?: boolean }
- `POST https://api.mcp.ai/api/pdf_co/pdf/change/text/searchable` — Tool to make PDF text searchable using OCR. Use when you need to add a searchable text layer to scanned or image-only PDF documents.
  - body: { url: string, rect?: string, pages?: string, inline?: boolean, language?: string, password?: string, profiles?: string }
- `POST https://api.mcp.ai/api/pdf_co/pdf/delete/pages` — Tool to delete specific pages from a PDF file. Use when you need to remove unwanted pages before further processing.
  - body: { url: string, name?: string, pages: string, password?: string, profiles?: string, async_job?: boolean }
- `POST https://api.mcp.ai/api/pdf_co/pdf/extract/attachments` — Tool to extract embedded attachments from a PDF. Use when you need to retrieve embedded files from a PDF after uploading.
  - body: { url: string, inline?: boolean, callback?: string, password?: string, async_job?: boolean, expiration?: integer, httppassword?: string, httpusername?: string }
- `POST https://api.mcp.ai/api/pdf_co/pdf/find` — Tool to find text in a PDF document. Use when you need to locate keywords or regex patterns and get their page positions.
  - body: { url: string, pages?: string, password?: string, profiles?: string, regexSearch?: boolean, searchString: string, caseSensitive?: boolean }
- `POST https://api.mcp.ai/api/pdf_co/pdf/forms/info/reader` — Tool to extract form field information from a PDF. Use when you need to retrieve names, types, and values of form fields. Returns field names, types (CheckBox, EditBox, RadioButton, ComboBox), values,
  - body: { url: string, async?: boolean, password?: string }
- `POST https://api.mcp.ai/api/pdf_co/pdf/from/document/txt` — Tool to convert a plain text (.txt) file to PDF. Use when you have a public URL to a text file; raw inline text is not accepted by the endpoint.
  - body: { url: string, name: string, profiles?: string, async_job?: boolean }
- `POST https://api.mcp.ai/api/pdf_co/pdf/from/email` — Tool to convert email files (.eml/.msg) to PDF. Use when you need to transform standalone email messages into PDF documents.
  - body: { url: string, name?: string, profiles?: string, async_job?: boolean }
- `POST https://api.mcp.ai/api/pdf_co/pdf/from/html` — Tool to convert HTML code or webpage URL into a PDF document. Use when you need to capture a webpage or HTML snippet as a PDF file.
  - body: { url: string, name?: string, async?: boolean, footer?: string, header?: string, margins?: string, callback?: string, profiles?: string, mediaType?: string, paperSize?: string, expiration?: integer, orientation?: string, printBackground?: boolean, DoNotWaitFullLoad?: boolean }
- `POST https://api.mcp.ai/api/pdf_co/pdf/info/reader` — Tool to retrieve detailed information and metadata of a PDF. Use when you need page count, author, encryption details, and other document properties.
  - body: { url: string }
- `POST https://api.mcp.ai/api/pdf_co/pdf/merge` — Tool to merge multiple PDF files into one document. Use when you need to combine several PDF URLs into a single PDF file.
  - body: { name?: string, urls: string|string[], profiles?: string, run_async?: boolean }
- `POST https://api.mcp.ai/api/pdf_co/pdf/rotate` — Tool to rotate selected pages in a PDF. Use when you need to adjust the orientation of specific pages in an online PDF file before further processing.
  - body: { url: string, name?: string, angle: integer, pages: string, password?: string, run_async?: boolean }
- `POST https://api.mcp.ai/api/pdf_co/pdf/search/and/delete/text` — Tool to search for and delete text in a PDF by keyword or regex. Use when you need to remove sensitive or unwanted text from a PDF document.
  - body: { url: string, name?: string, async?: boolean, pages?: string, regex?: boolean, password?: string, searchString: string, caseSensitive?: boolean }
- `POST https://api.mcp.ai/api/pdf_co/pdf/search/and/replace/text` — Tool to search for and replace text in a PDF document. Use when you need to update specific text instances within an existing PDF file (e.g., changing invoice numbers).
  - body: { url: string, name?: string, async?: boolean, password?: string, regexSearch?: boolean, searchString: string, replaceString: string }
- `POST https://api.mcp.ai/api/pdf_co/pdf/split` — Tool to split a PDF into multiple files by page ranges. Use when you need to extract specific pages or page ranges from a PDF.
  - body: { url?: string, file?: object, name?: string, pages?: string, inline?: boolean, callback?: string, password?: string, profiles?: object, run_async?: boolean, expiration?: integer, httppassword?: string, httpusername?: string, DataEncryptionIV?: string, outputDataFormat?: string, DataEncryptionKey?: string, DataEncryptionAlgorithm?: string }
- `POST https://api.mcp.ai/api/pdf_co/pdf/to/csv` — Tool to convert PDF or scanned images to CSV format. Use when you need to extract tabular data from a PDF into CSV format.
  - body: { url: string, lang?: string, name?: string, pages?: string, inline?: boolean, encrypt?: boolean, password?: string, profiles?: string, run_async?: boolean }
- `POST https://api.mcp.ai/api/pdf_co/pdf/to/html` — Tool to convert PDF documents to HTML. Use when you need an HTML rendition of a PDF or scanned image.
  - body: { url?: string, file?: string, name?: string, pages?: string, inline?: boolean, encrypt?: boolean, password?: string, profiles?: string, run_async?: boolean }
- `POST https://api.mcp.ai/api/pdf_co/pdf/to/image` — Tool to convert PDF pages to images (PNG, JPG, TIFF). Use when you need image previews of PDF content.
  - body: { dpi?: integer, url: string, async?: boolean, pages?: string, password?: string, profiles?: string, imageFormat?: string }
- `POST https://api.mcp.ai/api/pdf_co/pdf/to/json` — Tool to convert PDF or scanned images to JSON format. Use when you need a structured JSON representation of PDF content.
  - body: { url?: string, file?: string, name?: string, async?: boolean, pages?: string, inline?: boolean, password?: string, profiles?: string, searchString?: string }
- `POST https://api.mcp.ai/api/pdf_co/pdf/to/text` — Tool to convert PDF or scanned images to plain text. Use when you need raw text output preserving layout.
  - body: { url: string, lang?: string, name?: string, rect?: string, pages?: string, inline?: boolean, unwrap?: boolean, callback?: string, password?: string, run_async?: boolean, expiration?: integer, httppassword?: string, httpusername?: string, lineGrouping?: string }
- `POST https://api.mcp.ai/api/pdf_co/pdf/to/xls` — Tool to convert PDF or scanned images to XLS format. Use when you need to extract tabular data into an Excel spreadsheet.
  - body: { url: string, name?: string, pages?: string, password?: string, profiles?: string, run_async?: boolean }
- `POST https://api.mcp.ai/api/pdf_co/pdf/to/xlsx` — Tool to convert PDF or scanned images to XLSX (Excel) format. Use when you need structured spreadsheet output from a PDF.
  - body: { url: string, name?: string, async?: boolean, pages?: string, inline?: boolean, encrypt?: boolean, password?: string, profiles?: string, expiration?: integer, optimization?: string, columns0Based?: boolean }
- `POST https://api.mcp.ai/api/pdf_co/pdf/to/xml` — Tool to convert PDF or scanned images to XML format. Use when you need to extract structured data from PDF into XML.
  - body: { url: string, pages?: string, password?: string, profiles?: string, run_async?: boolean }
- `POST https://api.mcp.ai/api/pdf_co/pdfco/post/barcode/generate` — Tool to generate high quality barcode images in 45+ formats including QR Code, Code 128, Code 39, and more. Use when you need to create barcodes with customization options like rotation, decoration im
  - body: { name?: string, type?: string, async?: boolean, value: string, inline?: boolean, encrypt?: boolean, callback?: string, expiration?: integer, profiles.Angle?: integer, decorationImage?: string, outputDataFormat?: string, profiles.CaptionFont?: string, profiles.NarrowBarWidth?: integer }
- `POST https://api.mcp.ai/api/pdf_co/pdfco/post/file/upload/base64` — Tool to create a temporary file using base64-encoded source data. Use when you need to upload file content as base64 to PDF.co for downstream processing. Temporary files are automatically deleted afte
  - body: { file: string, name?: string, expiration?: integer }

## Example prompts
- "What can I do in PDF.co?"
- "Show me a summary of my PDF.co account"

## More
- Page: https://mcp.ai/pdf_co
- Agent spec (llms.txt): https://mcp.ai/pdf_co/llms.txt
- Postman collection: https://mcp.ai/pdf_co/postman.json
