# PDF.co MCP

> PDF.co lets your AI client handle all document processing—parsing, converting, merging, and securing PDFs right in the chat window. You use it to extract structured data like tables into JSON or CSV formats, perform OCR on scanned images, or combine multiple reports into one file. It’s a full suite of tools for turning messy documents into clean, actionable data pipelines without ever leaving your conversation.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** pdf-manipulation, ocr, data-extraction, document-conversion, api-automation

## Description

Listen up. This isn't some basic converter you use when you're bored. The PDF.co server gives your AI client a full suite of tools to handle documents—it’s for parsing, converting, merging, and locking down PDFs right in the chat window. You'll use it anytime you need your agent to deal with messy files and turn them into clean, actionable data without you having to copy-paste a single thing.

**Converting Documents to Structured Data**
You can make your AI client read every kind of PDF structure using dedicated conversion tools. If the document has tables, use `pdf_to_csv` and it'll spit out a perfect Comma Separated Values file you can use in any spreadsheet program. For deeper data analysis, run `pdf_to_json` to extract and structure *all* the content into a standardized JSON object that your code can actually read. If you need something more rigid, `pdf_to_xml` converts the entire document's structure into an XML file format. Even if all you need is raw reading material, `pdf_to_text` handles converting the whole PDF down to simple, clean plain text.

**Extracting Specific Data and Handling Scans**
Sometimes you don't want the whole thing; you just need pieces of info. You can pull basic document information—like who created it, what the title is, or when it was made—by running `extract_pdf_meta`. If you've got a scanned invoice or some old paperwork that isn't digital text, don't sweat it. Use `ocr_image` to run Optical Character Recognition on an uploaded image; it extracts usable text even if the original document was just ink on paper. For massive PDFs, if you only need sections three through five, use `split_pdf`, and it’ll cut that one big file into several smaller parts for you.

**Combining and Managing Files**
When your workflow requires multiple inputs, this server handles the heavy lifting. You can run `merge_pdfs` to take two or more separate PDF documents—say, quarterly reports from different departments—and combine them into a single output file. On the flip side of organization, you might need to mess with security. If a document is locked down and you need access, use `unprotect_pdf` to strip away existing passwords so your agent can work on it. Conversely, if you're sending something sensitive, you can run `protect_pdf` to add password protection, restricting who can view or edit the file.

**Utility and Monitoring**
Your AI client keeps track of everything running in the background. When a big job—like converting 50 files—is queued up, use `check_job_status` to see exactly where that document processing is at. Plus, you can keep an eye on your usage with `get_account_info`, which pulls up your current service credit balance and account metrics so you know what's left. Basically, it gives you the whole damn toolbox for making PDFs into usable data.

## Tools

### check_job_status
Checks the status of any document processing job that was run asynchronously.

### pdf_to_csv
Converts data presented in PDF tables directly into a Comma Separated Values (CSV) file.

### pdf_to_json
Extracts and structures the entire content of a PDF document into a standardized JSON object.

### pdf_to_text
Converts an entire PDF file into simple, clean plain text format.

### pdf_to_xml
Converts a PDF document's content and structure into an XML file.

### extract_pdf_meta
Extracts general metadata (like creation date, author, and title) from a PDF file.

### get_account_info
Retrieves your current account usage metrics and service credit balance.

### merge_pdfs
Combines two or more separate PDF documents into a single output file.

### ocr_image
Runs Optical Character Recognition on an uploaded image to extract text, even if the original document was scanned.

### protect_pdf
Adds password protection to a PDF, restricting access or editing capabilities.

### split_pdf
Cuts one large PDF document into multiple smaller PDFs based on page numbers or ranges.

### unprotect_pdf
Removes existing password protection from a locked PDF file.

## Prompt Examples

**Prompt:** 
```
Convert the PDF at 'https://example.com/invoice.pdf' to structured JSON.
```

**Response:** 
```
I've processed the document. I have the structured JSON data containing all text and layout metadata. Would you like me to summarize the financial totals?
```

**Prompt:** 
```
Convert the uploaded invoice PDF into a structured JSON with all line items extracted.
```

**Response:** 
```
Invoice parsed successfully. Vendor: Acme Supplies Ltd. Invoice #INV-2025-0847. Date: May 8, 2025. 4 line items extracted: Widget A ($125 x 10), Widget B ($89 x 5), Service Fee ($250 x 1), Shipping ($45 x 1). Subtotal: $2,040. Tax (8%): $163.20. Total: $2,203.20. Payment terms: NET30. All fields extracted with 98% confidence.
```

**Prompt:** 
```
Merge these 3 quarterly report PDFs into a single document and add page numbers.
```

**Response:** 
```
3 PDFs merged successfully into a single document (42 pages total). Q1 Report (14 pages), Q2 Report (16 pages), and Q3 Report (12 pages) combined in order. Sequential page numbers added in the footer. Output file size: 2.8 MB. Download link generated and valid for 24 hours.
```

## Capabilities

### Convert Documents to Structured Data
Transform PDFs and images into specific formats like JSON, CSV, XML, or plain text using tools such as `pdf_to_json` or `pdf_to_csv`.

### Extract Specific Data Types
Pull metadata from a PDF with `extract_pdf_meta`, extract tables into structured formats via `pdf_to_json`, or perform OCR on images using `ocr_image`.

### Combine and Divide Files
Use `merge_pdfs` to combine multiple PDFs into a single file, or use `split_pdf` to break one large document into smaller parts.

### Manage Document Security
Apply password protection with `protect_pdf`, or remove existing passwords using `unprotect_pdf` on PDF files.

### Monitor Job Status and Account Info
Check the progress of background processing jobs with `check_job_status`, and view your service credit balance via `get_account_info`.

## Use Cases

### Processing a Batch of Client Invoices
An accountant gets 50 scanned invoices (JPEGs). Instead of manually typing in the vendor name, invoice number, and total for each one, they ask their agent to run `ocr_image` on all 50 files. The server extracts the necessary metadata from every image, allowing them to compile a master spreadsheet with zero manual data entry.

### Building an Annual Compliance Binder
An operations manager needs to combine annual reports (Q1 through Q4) and ensure they're secure. They first use `merge_pdfs` to compile the 4 reports into one, then run `protect_pdf` on the final file before uploading it to the archive.

### Converting Raw Report Data for a Database
A data analyst has a PDF report full of financial tables. They use `pdf_to_json`, which pulls out all column headers and values into a structured JSON object. The agent then passes this clean, predictable data directly to the database API.

### Splitting Master Legal Documents
A legal team receives one massive 300-page agreement PDF. Instead of reading it all at once, they ask their agent to run `split_pdf` to separate the 'Definitions' section (pages 1-25) from the 'Exhibit A' section (pages 280-300), giving them smaller, manageable files.

## Benefits

- Stop losing time on manual extraction. Use `pdf_to_json` or `pdf_to_csv` to turn complex tables directly into machine-readable data, eliminating spreadsheet copy/paste errors.
- Handle mixed media inputs instantly. Run `ocr_image` on scanned invoices and handwriting samples; it extracts text that simple PDF readers miss entirely.
- Simplify document management workflows. Need to combine three quarterly reports? Use `merge_pdfs`; the server handles stitching them together into one file, keeping all pages sequential.
- Maintain data integrity across systems. Convert files using `pdf_to_xml` or `pdf_to_json`, ensuring your downstream application gets a clean, predictable schema every time.
- Control document access right from chat. Apply security locks with `protect_pdf` immediately after processing sensitive client documents.

## How It Works

The bottom line is: you tell your agent what needs doing with the PDF; it handles all the API calls and spits out the usable result.

1. Subscribe to this server and provide your PDF.co API Key in the settings.
2. Ask your AI client to perform a document action (e.g., 'Convert this invoice to JSON').
3. The agent calls the appropriate tool, processes the file, and returns the structured data or resulting document.

## Frequently Asked Questions

**How do I convert PDF tables into structured data using pdf_to_csv?**
You simply tell the agent to 'Convert this document's tables to CSV.' The tool handles identifying all tabular content and outputs it in a standard, delimited format ready for import.

**What is the difference between pdf_to_text and pdf_to_json?**
The key difference is structure. `pdf_to_text` gives you one big block of raw text, losing all formatting. `pdf_to_json` analyzes the document's layout and organizes the content into labeled fields, keeping context.

**Can I use ocr_image to read handwritten notes in a PDF?**
Yes. You pass the image through `ocr_image`. It runs Optical Character Recognition specifically designed for scanned or handwritten documents, extracting text that standard digital readers can't see.

**How do I combine several PDFs into one using merge_pdfs?**
Just upload the files and tell your agent to 'Merge these three reports.' The `merge_pdfs` tool combines them sequentially into a single, cohesive PDF document for you.

**How do I use `protect_pdf` to add password security to a document?**
The tool encrypts your PDF file. You provide the document and the desired credentials, which locks it down so only authorized users can view or edit the content.

**What is the purpose of `check_job_status` after a conversion task?**
It lets you track long-running processes. Complex conversions take time; use this tool to monitor if your document job completed successfully or if it ran into an error.

**How can I use `extract_pdf_meta` to get information about the PDF itself?**
It pulls out hidden document properties. This function reads key metadata like the author, creation date, and title embedded deep within the file structure.

**If I only need specific pages, how does `split_pdf` work?**
You can break a large PDF into smaller parts. Just specify the exact page range or individual pages you want to extract and create new, separated documents.

**Can my AI automatically find and extract a specific table from a PDF?**
Yes! Use the `convert_to_csv` or `convert_to_json` tools. Your agent will respond with the structured tabular data from the document in seconds, ready for analysis.

**How do I find my PDF.co API Key?**
Log in to your PDF.co account, navigate to the main dashboard, and you will find your unique secret API key (starting with your email reference or key string) there.

**Does this support handwritten text recognition?**
Absolutely. PDF.co's high-fidelity OCR engine is designed to handle both printed and handwritten text with high accuracy across multiple languages.