Back to the catalog

PdfBroker.io

Cloud PDF generation from HTML, CSS and XSL-FO, with PDF/A and PDF/UA support.

Open source Open in the app JSON README (API)

About

Cloud PDF generation from HTML, CSS and XSL-FO, with PDF/A and PDF/UA support.

Details

Kind
MCP servers
Topic
Files & documents
Publisher
io.pdfbroker
Origin
official
Category
ferramentas
Transport
http
Version
1.2.0
Added
2026-08-29 04:01:45
Updated
2026-08-29 04:01:45
Origin id
io.pdfbroker/pdf

README

# @pdfbroker/mcp-server

Generate PDFs from HTML using AI agents via [PdfBroker.io](https://www.pdfbroker.io).

This package connects Claude Desktop, Cursor, and other MCP clients to the
PdfBroker.io cloud PDF generation API.

## Setup

1. Sign up at [pdfbroker.io](https://www.pdfbroker.io/signup)
2. Go to **Members → API Credentials** and copy your Client ID and Client Secret
3. Add to your Claude Desktop config (`Settings → Developer → Edit Config`):

```json
{
  "mcpServers": {
    "pdfbroker": {
      "command": "npx",
      "args": ["-y", "@pdfbroker/mcp-server"],
      "env": {
        "PDFBROKER_CLIENT_ID": "pb_cid_your_id_here",
        "PDFBROKER_CLIENT_SECRET": "pb_sec_your_secret_here"
      }
    }
  }
}
```

4. Restart Claude Desktop

## Available Tools

- **html_to_pdf** — Convert HTML/CSS to PDF using WeasyPrint (PDF/A, PDF/UA support)
- **html_to_pdf_wk** — Convert HTML to PDF using wkhtmltopdf (JS support, free tier)

Both tools accept:

- **`html` or `url`** — the document, either inline or as an https address PdfBroker fetches
  for you. Exactly one is needed; `url` wins if both are given. Passing a URL keeps a large
  template out of the conversation entirely.
- **`pdfForms`** — set to `true` for a fillable PDF, where `<input>`, `<select>` and
  `<textarea>` become interactive form fields. Works on both engines.
- **`paperSize` / `orientation`** — both default to `Auto`, which leaves the page to the
  document's own `@page { size: ... }` CSS on WeasyPrint (A4 portrait when it says nothing).
  Name a size to override the document. Note that wkhtmltopdf does not honour CSS `@page`
  geometry — use `html_to_pdf` when the stylesheet must decide.
- **`extraArguments`** — a string-to-string map of engine flags for anything without a
  dedicated parameter.
- **`resources`** — base64-encoded files keyed by relative path, for embedded images and
  custom fonts. Has no effect on a `url` render, where relative paths resolve against the
  document's own URL.

Connected clients can read the full argument list from the
`docs://pdfbroker/api-reference` resource the server exposes.

## Example

Ask Claude: *"Create a PDF invoice for Acme Corp with 3 line items"*

Claude will generate HTML, call the `html_to_pdf` tool, and return a download link for the PDF.

## Cursor / VS Code

Add to `.vscode/mcp.json`:

```json
{
  "servers": {
    "pdfbroker": {
      "command": "npx",
      "args": ["-y", "@pdfbroker/mcp-server"],
      "env": {
        "PDFBROKER_CLIENT_ID": "pb_cid_your_id_here",
        "PDFBROKER_CLIENT_SECRET": "pb_sec_your_secret_here"
      }
    }
  }
}
```

## Claude Code

Claude Code supports direct HTTP connections — no wrapper needed:

```bash
claude mcp add-json pdfbroker '{
  "type": "http",
  "url": "https://mcp.pdfbroker.io/",
  "headers": {
    "X-PdfBroker-ClientId": "pb_cid_your_id_here",
    "X-PdfBroker-ClientSecret": "pb_sec_your_secret_here"
  }
}'
```

## Requirements

- Node.js 18+
- PdfBroker.io account with API credentials

## Environment Variables

| Variable | Required | Description |
|----------|----------|-------------|
| `PDFBROKER_CLIENT_ID` | Yes | Your Client ID from pdfbroker.io |
| `PDFBROKER_CLIENT_SECRET` | Yes | Your Client Secret from pdfbroker.io |

> Note: earlier versions accepted a `PDFBROKER_MCP_URL` override. As of `1.1.0` the
> server URL is fixed at `https://mcp.pdfbroker.io/` (the MCP server is hosted-only).
> If the variable is still set in your environment the wrapper logs a warning and
> ignores it.

More