# PolyDoc

PolyDoc lets an MCP client turn HTML, URLs, and templates into PDFs, capture screenshots, and create Factur-X or ZUGFeRD invoices. Use it when an agent needs document-generation tools.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI
- Author: polydoc-tech
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/polydoc-tech/polydoc-mcp
- Updated: 2026-10-20
- HTML: https://affpapa.org/en/nevibecode/mcp/polydoc

## What it does

PolyDoc exposes tools for PDF conversion, screenshots, and electronic invoices to an MCP client. An agent can take HTML, a URL, or a saved template with Liquid data and produce a PDF; screenshot output can be PNG, JPEG, or WebP. Invoice generation uses structured data and supports Factur-X and ZUGFeRD.

By default, generated files go to a local output folder, and the server returns their paths. Results can also be sent to cloud storage or a webhook. For PDF/A or PDF/UA-1, enable `verify` to have veraPDF check the result; a failed check returns error 422 rather than the file.

The server requires Node.js 20.15 or later and a `POLYDOC_API_KEY`. Without that key, it cannot call the PolyDoc API.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `POLYDOC_API_KEY`, `POLYDOC_SANDBOX`, `POLYDOC_BASE_URL`, `POLYDOC_OUTPUT_DIR` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env POLYDOC_API_KEY=<POLYDOC_API_KEY> --env POLYDOC_SANDBOX=<POLYDOC_SANDBOX> --env POLYDOC_BASE_URL=<POLYDOC_BASE_URL> --env POLYDOC_OUTPUT_DIR=<POLYDOC_OUTPUT_DIR> --transport stdio polydoc -- npx -y polydoc-mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add polydoc --env POLYDOC_API_KEY=<POLYDOC_API_KEY> --env POLYDOC_SANDBOX=<POLYDOC_SANDBOX> --env POLYDOC_BASE_URL=<POLYDOC_BASE_URL> --env POLYDOC_OUTPUT_DIR=<POLYDOC_OUTPUT_DIR> -- npx -y polydoc-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "polydoc": {
            "command": "npx",
            "args": [
                "-y",
                "polydoc-mcp"
            ],
            "env": {
                "POLYDOC_API_KEY": "<POLYDOC_API_KEY>",
                "POLYDOC_SANDBOX": "<POLYDOC_SANDBOX>",
                "POLYDOC_BASE_URL": "<POLYDOC_BASE_URL>",
                "POLYDOC_OUTPUT_DIR": "<POLYDOC_OUTPUT_DIR>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "polydoc": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "polydoc-mcp"
            ],
            "env": {
                "POLYDOC_API_KEY": "<POLYDOC_API_KEY>",
                "POLYDOC_SANDBOX": "<POLYDOC_SANDBOX>",
                "POLYDOC_BASE_URL": "<POLYDOC_BASE_URL>",
                "POLYDOC_OUTPUT_DIR": "<POLYDOC_OUTPUT_DIR>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e POLYDOC_API_KEY=<POLYDOC_API_KEY> -e POLYDOC_SANDBOX=<POLYDOC_SANDBOX> -e POLYDOC_BASE_URL=<POLYDOC_BASE_URL> -e POLYDOC_OUTPUT_DIR=<POLYDOC_OUTPUT_DIR> polydoc npx -y polydoc-mcp
```
Replace <…> with your own values

## When to use it
- turn HTML or a URL into a PDF
- render a Liquid template as a PDF
- capture a page as a PNG, JPEG, or WebP image
- create a Factur-X or ZUGFeRD invoice from structured data
- check PDF/A or PDF/UA-1 output with veraPDF

## Example prompts
- Create a PDF/A from this project's HTML and save the result locally.
- Capture this page URL as a WebP screenshot.
- Generate a ZUGFeRD invoice from this structured data.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89609
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [Front-End Checklist](https://affpapa.org/en/nevibecode/mcp/front-end-checklist.md) — MCP server · ★ 74569
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89899

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
