# PDFShift MCP

> PDFShift converts URLs or raw HTML content into high-fidelity documents, images, and web formats. This MCP lets your agent pull data from live websites or internal templates and output professional PDFs, PNGs, JPEGs, or WebPs automatically. It handles complex CSS and JavaScript, making it ideal for automated reporting, archiving, and dynamic document creation.

## Overview
- **Category:** productivity
- **Price:** Free
- **Tags:** pdf-generation, html-to-pdf, web-capture, document-automation, api-conversion

## Description

This connector gives your AI client the power to turn anything viewable on a screen into a usable file format. Whether you're grabbing a screenshot of an article or converting an entire web page to print-ready PDF, this MCP handles it. It’s built for high performance, managing complex modern layouts that often trip up basic conversion tools.

Beyond simple snapshots, the system lets you build and manage reusable HTML templates. You can use these templates to dynamically populate documents with variable data—think generating 100 unique invoices using one master layout. This process of automated document generation is key for operational teams. Because we host this MCP on Vinkius, your agent connects once and gains access to this robust conversion engine alongside thousands of other tools.

Your client can convert content into multiple formats—PDF, PNG, JPEG, WebP—and even manage the resulting files by exporting them directly to cloud storage like S3. This means you don't just get a file; you get an automated process that handles the entire lifecycle.

## Tools

### convert_to_jpeg
Converts an entire URL or HTML string into a JPEG image format.

### convert_to_pdf
Turns any web page or raw HTML into a printable PDF document, returning a link instead of binary data.

### convert_to_png
Converts an entire URL or HTML string into a high-quality PNG image format.

### convert_to_webp
Converts web content from a URL or HTML string into the modern WebP format.

### create_template
Saves a new, reusable master layout (HTML) that can be used to generate documents later.

### delete_template
Removes an existing template from the system after it's no longer needed.

### generate_from_template
Fills a stored template with specific data to create a brand new, unique document.

### get_account
Retrieves general details about the connected user account.

### get_credits_usage
Checks how many usage credits have been consumed so far.

### get_log
Retrieves a specific operational log entry using a request ID.

### get_template_html
Fetches the raw HTML code of an existing template for review or modification.

### list_invoices
Pulls a list of billing invoices associated with the account.

### list_logs
Retrieves a history of recent conversion or generation attempts.

### list_templates
Lists all available HTML templates stored and managed by the account.

### update_template
Modifies an existing template's content or settings while keeping its name.

## Prompt Examples

**Prompt:** 
```
Convert https://news.ycombinator.com to a PDF in landscape orientation.
```

**Response:** 
```
I've initiated the conversion for Hacker News. The PDF has been generated in landscape mode. [Download Link/Binary Data]
```

**Prompt:** 
```
List all my saved HTML templates and show the credits I have left.
```

**Response:** 
```
You have 3 templates: 'invoice-v1', 'report-monthly', and 'welcome-email'. Your current balance is 450 credits.
```

**Prompt:** 
```
Show me the logs for my last 5 conversion attempts.
```

**Response:** 
```
Fetching your recent logs... Here are the last 5 conversions, including status codes, source URLs, and processing times.
```

## Capabilities

### Convert web content
Takes any live URL or pasted HTML and converts it into specific image (PNG, JPEG, WebP) or document formats (PDF).

### Automate document generation
Creates new documents by filling reusable, stored HTML templates with custom data.

### Manage and store templates
Allows the user to create, view, update, and delete master HTML layouts for future use.

### Monitor usage and billing
Retrieves account details, checks credit consumption, or lists past invoices and system logs.

## Use Cases

### Archiving news sites
A content team needs to archive a week's worth of online press releases. They prompt their agent: 'Convert these 10 URLs into PDF format.' The MCP handles the bulk conversion using `convert_to_pdf`, providing ten clean, shareable files without manual effort.

### Creating monthly financial statements
The finance department runs a report that needs to go into a standardized letterhead. They use `create_template` to save the letterhead and then call `generate_from_template`, passing in the raw data variables so every statement is correctly branded.

### Generating product catalogs
A marketing user needs a quick visual of a new webpage. Instead of taking multiple screenshots, they use `convert_to_webp` on the live URL to get an optimized image version for their website assets.

### Preparing client onboarding packets
An operations worker needs to compile several pieces of information (agreement text, pricing tables) into a single document. They manage the content using `get_template_html` and then run `generate_from_template` to create a clean, final PDF.

## Benefits

- Automate reporting: Use the `generate_from_template` tool to pull dynamic data and instantly create unique documents like payroll stubs or client reports. You don't have to manually fill out fields anymore.
- Capture visuals perfectly: Need a screenshot of an article? Convert any URL into PNG, JPEG, or WebP using dedicated tools like `convert_to_png` for instant social media assets.
- Build reusable layouts: The system lets you use `create_template` to save master documents. You set the structure once, and your agent fills it out endlessly with fresh data.
- Handle complex web code: This MCP processes modern layouts that include JavaScript and CSS, ensuring the resulting PDF or image looks exactly like the source page.
- Audit everything: If a conversion goes wrong, use `list_logs` or `get_log` to check detailed history, including status codes and processing times.

## How It Works

The bottom line is you send instructions to your agent, which uses this MCP to handle all the complex web rendering and formatting behind the scenes.

1. First, subscribe to this MCP and provide your unique API key to your AI client.
2. Next, prompt your agent with a task—like converting a specific URL or generating a document using a stored template name.
3. Your agent sends the request; the MCP executes the conversion or generation and returns the file data or a cloud storage link.

## Frequently Asked Questions

**How do I convert a web page to PDF using PDFShift?**
You use the `convert_to_pdf` tool by providing the target URL or HTML content. The system handles complex layouts and returns a link that you can immediately download.

**Can I reuse my document layout with PDFShift?**
Yes, you manage reusable layouts using `create_template` to build your master template. Then, the `generate_from_template` tool fills it out automatically whenever you need a new version.

**Is there a way to check my credit limit with PDFShift?**
You monitor your spending by calling the `get_credits_usage` tool. This gives you an immediate count of how many credits remain in your account.

**What if I need multiple image formats from a URL? Does PDFShift support that?**
The MCP supports several dedicated tools, including `convert_to_png`, `convert_to_jpeg`, and `convert_to_webp`. You can run these sequentially to get various optimized versions of the same content.

**How do I see past conversion attempts with PDFShift?**
You use the `list_logs` tool. This fetches a history of recent activity, allowing you to review status codes and processing times for troubleshooting.