PDF Generator MCP Server
Generate PDF documents from markdown, structured sections, data tables or HTML
The PDF Generator MCP server creates PDF documents and saves them in your organization's file storage - the same storage the Files server uses. It provides 4 tools, one per kind of input: markdown text, structured sections, a single data table, and HTML.
How It Works
- An Agent or Action node calls a PDF tool with its content.
- The PDF is rendered and saved to the workspace's file storage.
- The tool returns the file's key, its size, and a download link valid for one hour.
Send the PDF on by passing its key - gmail_send attachments (s3_key) and Telegram's send_document (s3_key) read it directly. There is no need to read the file back first.
Setup
None. The PDF Generator is enabled by default: every organization has it, and it is available in each workspace without configuration. An OWNER or ADMIN can switch it off in Resources > MCP Servers, or remove it from one workspace in that workspace's settings (Enabled resources tab > MCP Servers). Generated files count toward your plan's storage limit.
Which tool to use
Pick the tool by the content you have - each accepts one input shape:
| You have | Tool | Parameter |
|---|---|---|
HTML (starts with <!DOCTYPE or <html>, or an Agent's HTML output) | generate_pdf_html | html |
| Markdown or plain text | generate_pdf | content |
| Structured JSON sections (headings, paragraphs, lists, tables, separators) | generate_pdf_report | sections |
| Exactly one table as headers plus rows | generate_pdf_table | headers, rows |
generate_pdf does not understand HTML - tags would appear as literal text.
Tools
generate_pdf
Generate a PDF from markdown or plain text passed in content. Supports headings (#, ##, ###), lists (-, *, 1.), horizontal rules (---) and paragraphs. Not for HTML - use generate_pdf_html. Returns the file's key and a download link.
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | Yes | Markdown or plain text content for the PDF. |
title | string | No | Document title (displayed at top of PDF) |
filename | string | No | Output file name (default: 'document.pdf') |
path | string | No | Subfolder path in storage (default: 'pdf') |
page_size | string | No | Page size: A4, Letter, A3, Legal (default: A4) |
orientation | string | No | Page orientation: portrait or landscape (default: portrait) |
header_text | string | No | Text shown in the header of each page. |
footer_text | string | No | Text shown in the footer (default: 'Page X of Y') |
generate_pdf_report
Generate a PDF from structured JSON sections passed in sections - typical for reports that mix headings, text, lists and tables. Returns the file's key and a download link.
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | No | Report title (displayed at top) |
sections | array of object | Yes | Array of content sections. |
filename | string | No | Output file name (default: 'report.pdf') |
path | string | No | Subfolder path in storage (default: 'pdf') |
page_size | string | No | Page size: A4, Letter, A3, Legal (default: A4) |
orientation | string | No | Page orientation: portrait or landscape (default: portrait) |
header_text | string | No | Header text on each page. |
footer_text | string | No | Footer text (default: 'Page X of Y') |
Section types:
| Type | Fields | Description |
|---|---|---|
heading | text, level (1-3) | Section heading |
paragraph | text | Body text |
list | items[], ordered? | Bulleted or numbered list |
table | headers[], rows[][] | Data table with headers |
separator | (none) | Horizontal line |
Example sections array:
[
{ "type": "heading", "level": 1, "text": "Monthly Report" },
{ "type": "paragraph", "text": "Summary of activities for March 2026." },
{ "type": "table", "headers": ["Metric", "Value"], "rows": [["Revenue", "$12,000"], ["Users", "340"]] },
{ "type": "separator" },
{ "type": "heading", "level": 2, "text": "Action Items" },
{ "type": "list", "items": ["Review Q1 targets", "Update forecasts"], "ordered": true }
]
generate_pdf_table
Generate a PDF of one data table, passed as headers plus rows (each row an array of cell text). For several tables or mixed content use generate_pdf_report. From a Wialon run_report table, pass its headers and its matrix (ask the report for matrix: true). Returns the file's key and a download link.
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | No | Table title. |
headers | array of string | Yes | Column header names. |
rows | array | Yes | Data rows, each an array of cell text. From a Wialon run_report table, pass its matrix. |
filename | string | No | Output file name (default: 'table.pdf') |
path | string | No | Subfolder path in storage (default: 'pdf') |
orientation | string | No | portrait or landscape (default: landscape for wide tables) |
generate_pdf_html
Render an HTML document or fragment, passed in html, into a PDF. The only tool that accepts HTML, and the right choice when the design matters: branded reports, email-style layouts, multi-column pages, custom fonts. Returns the file's key and a download link.
| Parameter | Type | Required | Description |
|---|---|---|---|
html | string | Yes | Full HTML document or fragment. Only inline CSS, data: images and Google Fonts load - see the notes below. |
filename | string | No | Output file name (default: 'document.pdf') |
path | string | No | Subfolder path in storage (default: 'pdf') |
page_size | string | No | Paper format: A4, Letter, A3, Legal, Tabloid (default: A4) |
orientation | string | No | portrait or landscape (default: portrait) |
margin_top | string | No | e.g. '20mm', '1in', '0' (default: '20mm') |
margin_bottom | string | No | (default: '20mm') |
margin_left | string | No | (default: '15mm') |
margin_right | string | No | (default: '15mm') |
header_template | string | No | HTML for the per-page header. Supports the template classes: <span class='title'></span>, <span class='date'></span>, <span class='pageNumber'></span>, <span class='totalPages'></span>. Wrap in styled divs for layout. |
footer_template | string | No | HTML for the per-page footer (same template-class support as header). |
print_background | boolean | No | Render CSS backgrounds and images (default: true). |
page_break_css | boolean | No | Apply the default page-break rules (rows, list items and cards kept whole, table headers repeated). Default true; your own CSS overrides them. |
Notes on HTML:
- Pass the raw document - do not wrap it in markdown code fences.
- Only inline content loads: images must be
data:URLs and CSS must be inline (<style>). Google Fonts are the one exception. Any other external image or stylesheet is shown as missing. - Page breaks are handled for you: table rows, list items, images and
.cardblocks are kept whole, table headers repeat on every page, and a heading stays with the text below it. Your own@media printrules still win. Setpage_break_css: falseto turn the defaults off.
Example Workflows
Weekly report by email
- Trigger - Schedule (weekly).
- Action - HTTP request that fetches metrics.
- Agent - Turns the metrics into report sections (JSON).
- Action - MCP tool
pdf:generate_pdf_reportwith a title and the sections. - Action - MCP tool
google-workspace:gmail_sendwith an attachment{ "s3_key": "{{steps.report.output.response.key}}" }.
Export data as a PDF table
- Trigger - Webhook with query parameters.
- Action - HTTP request that fetches the data.
- Action - MCP tool
pdf:generate_pdf_tablewithheadersandrows. - Return
{{steps.table.output.response.downloadUrl}}in the webhook response.
Branded document from an Agent
- Trigger - Manual, with a topic.
- Agent - Writes the document as a full HTML page with inline CSS.
- Action - MCP tool
pdf:generate_pdf_htmlwithhtmlset to the Agent's output. - Action - Send it with Telegram's
send_document(s3_key).