# Gotenberg MCP MCP

> Gotenberg converts URLs, raw HTML, Markdown, and Office documents into high-quality PDFs or screenshots. It also handles complex PDF management tasks like merging multiple files, splitting large reports, reading metadata, and embedding attachments. This MCP lets your agent manage the entire document lifecycle from source code to final, usable PDF.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** pdf-generation, html-to-pdf, web-screenshot, libreoffice-conversion, pdf-manipulation

## Description

Need to turn something messy—like a live website link or a chunk of raw HTML—into a clean, professional PDF? Gotenberg handles it. You give your AI client the content, and this connector spits out perfectly formatted PDFs using Chromium for rendering. It's not just about conversion; you can also take screenshots of web pages or Markdown notes when a full PDF isn't necessary. Need to work with existing documents? Merge multiple reports into one file, split huge annual reviews into chapters, or read the hidden metadata embedded in any PDF. If your workflow requires turning diverse sources—from DOCX files to simple URLs—into structured PDFs, this is what you need. You connect it through Vinkius and let your agent handle the heavy lifting.

## Tools

### convert_html_to_pdf
Turns raw HTML code into a PDF file using Chromium rendering.

### convert_office_to_pdf
Transforms Microsoft Office files (docx, xlsx, pptx) into PDFs using LibreOffice integration.

### convert_markdown_to_pdf
Converts Markdown text directly into a PDF document.

### convert_url_to_pdf
Takes a live website URL and converts it into a PDF document.

### embed_pdf_attachments
Adds supplemental files or documents into an existing PDF file.

### get_health
Checks the operational status of the Gotenberg service instance.

### merge_pdfs
Combines multiple separate PDF files into a single, unified document.

### read_pdf_bookmarks
Extracts and displays the table of contents (bookmarks) from an uploaded PDF file.

### read_pdf_metadata
Reads identifying information, such as creation date or author, embedded in a PDF.

### screenshot_html
Captures an image snapshot of raw HTML content instead of creating a document.

### screenshot_markdown
Takes a visual screenshot of Markdown source code for documentation purposes.

### screenshot_url
Returns an image snapshot (PNG) of the content found at a specific URL.

### split_pdf
Splits one large PDF document into multiple, separate files based on user input.

### get_version
Retrieves the current software version number for verification purposes.

### write_pdf_bookmarks
Writes a new set of bookmarks (a table of contents) to an existing PDF file.

### write_pdf_metadata
Updates or adds identifying information to the metadata layer of a PDF document.

## Prompt Examples

**Prompt:** 
```
Convert https://gotenberg.dev to a PDF in landscape orientation.
```

**Response:** 
```
I've converted the URL to a landscape PDF. You can download the generated document now.
```

**Prompt:** 
```
Take a PNG screenshot of this HTML: '<h1>Hello MCP</h1>'
```

**Response:** 
```
I've generated a PNG screenshot of your HTML content. Here is the image.
```

**Prompt:** 
```
Read the metadata of the PDF I just uploaded.
```

**Response:** 
```
Accessing metadata... The PDF was created by 'Gotenberg' on 2023-10-27, with the title 'Project Report'.
```

## Capabilities

### Convert Web Content
Turns live website URLs, raw HTML code, or Markdown notes into PDF documents.

### Handle Office Files
Converts Word, Excel, and PowerPoint files into a standard PDF format using LibreOffice.

### Manipulate Existing PDFs
Allows you to merge multiple PDFs into one file or split a single large document into smaller parts.

### Extract Document Data
Reads the metadata, bookmarks, and attachments from any given PDF file.

### Capture Screenshots
Takes an image snapshot (screenshot) of a URL or raw HTML content instead of generating a full document.

## Use Cases

### Archiving Web Content
A marketing manager needs to save a press release page from a competitor's website. Instead of printing it or taking a blurry photo, the agent calls `screenshot_url` to get a clean PNG image, and then uses `convert_url_to_pdf` for a full archive PDF.

### Consolidating Research Papers
A researcher has ten separate academic papers (PDFs) from different sources. They use the agent to call `merge_pdfs`, creating one master document that preserves all original structure and metadata.

### Generating Code Documentation
A developer writes a new feature using raw HTML for documentation. Instead of manually pasting it into a PDF generator, they use `convert_html_to_pdf` to instantly create the polished technical guide.

### Preparing Client Pitches
An operations team has several client-specific reports in different formats (DOCX, XLSX). They call `convert_office_to_pdf` on each and then use `merge_pdfs` to create a single, unified presentation packet.

## Benefits

- Stop wasting time on manual conversions. Whether you use `convert_html_to_pdf` or `convert_markdown_to_pdf`, your agent handles the formatting, guaranteeing a clean PDF every time.
- Need to manage existing documents? The `merge_pdfs` tool lets you combine separate reports into one file without opening ten different PDFs in Acrobat.
- Don't just generate; analyze. Use `read_pdf_metadata` or `read_pdf_bookmarks` to pull structured data about the document—like who created it or what chapters exist—before processing further.
- It’s not always a PDF, though. If you only need an image, use `screenshot_url` or `screenshot_html` to grab a quick visual proof without generating a full file.
- The `convert_office_to_pdf` tool handles the tricky stuff, taking native Word and Excel files and reliably turning them into PDF format.

## How It Works

The bottom line is that your agent sends content to this MCP, and it gives you back a usable, processed PDF or image file.

1. Subscribe to this MCP and enter your specific Gotenberg instance URL.
2. Your agent calls the relevant tool, passing the source data (e.g., an HTML string or a list of PDF files).
3. The service runs the conversion or manipulation, returning the finished document either as a base64 PDF file or a ZIP archive.

## Frequently Asked Questions

**How do I combine multiple PDFs using merge_pdfs?**
You pass the MCP a list of the PDF files you want to include. The tool combines them into one output file, preserving their original structure and pages.

**Can I convert a URL directly to a PDF? Use convert_url_to_pdf.**
Yes, `convert_url_to_pdf` takes any live website link and converts the entire visible page into a single PDF document.

**What is the difference between screenshot_html and convert_html_to_pdf?**
`screenshot_html` gives you an image file (like PNG) of what the code looks like. `convert_html_to_pdf` creates a fully structured, printable PDF document from that same code.

**Can I add metadata after creating the PDF? Use write_pdf_metadata.**
Absolutely. After you generate your core document with `convert_markdown_to_pdf`, you can run `write_pdf_metadata` to stamp it with version numbers, author names, or other identifying data.

**How does convert_office_to_pdf handle non-web documents like Word or Excel?**
It converts Office files using LibreOffice integration. You simply pass the document type, and it generates a PDF format while maintaining complex layouts better than other methods.

**If I have a huge report, how can the split_pdf tool help me manage sections?**
The split_pdf function breaks one large PDF into multiple files. You receive these separate documents in a ZIP archive, letting you process or share specific chapters individually.

**How do I make a generated PDF navigable by adding bookmarks using write_pdf_bookmarks?**
You use the write_pdf_bookmarks tool to define internal links and structural points. Your agent can then read these defined sections with read_pdf_bookmarks, giving the end user an instant table of contents.

**Can I include extra supporting files like receipts or reports using embed_pdf_attachments?**
Yes, you can embed attachments directly into the PDF structure. This keeps all related documents together in one secure file without requiring separate uploads or handling.

**Can I convert a live website to a PDF with specific margins?**
Yes! Use the `convert_url_to_pdf` tool. You can provide the URL and optional parameters like `marginTop`, `marginBottom`, `marginLeft`, and `marginRight` to customize the output.

**Is it possible to merge multiple PDF files into one?**
Absolutely. The `merge_pdfs` tool allows you to combine multiple PDF documents into a single file efficiently.

**Can I take a screenshot of a webpage instead of a PDF?**
Yes, you can use `screenshot_url` for live websites or `screenshot_html` for raw HTML content. You can even specify the format (png, jpeg, webp) and viewport dimensions.