PolyDoc

tech.polydoc由 polydoc.tech 發布v0.1.10更新於 Nov 4, 2026

HTML/URL to PDF, screenshots, e-invoices. PDF/A and PDF/UA output with optional veraPDF verify.

已驗證STDIO僅桌面商業與電商媒體與設計

概覽

AI 產生的概覽

PolyDoc 透過 PolyDoc API 將 HTML、網址或範本轉成 PDF、截圖與歐盟合規電子發票,並把檔案存到本機。

可以做什麼
  • 將 HTML、網址或已儲存的範本轉成 PDF,可設定版面、邊界、頁面格式、書籤與標記化輸出
  • 把 HTML、網址或範本渲染成 PNG、JPEG 或 WebP 截圖,可控制視窗尺寸與像素比
  • 依結構化發票資料產生 Factur-X 或 ZUGFeRD 混合式 PDF/A-3 電子發票
  • 以 PDF/A 與 PDF/UA-1 合規為目標,並可選擇用 veraPDF 驗證結果
  • 支援本機下載、雲端儲存上傳或 webhook 交付,並可檢查已設定的 API 金鑰
適用情境
適合需要從網頁或 HTML 產生文件與圖片、產出典藏或無障礙合規 PDF,或產生歐盟電子發票的情境,不必自行建置渲染流程。
執行需求
透過 npx 以 stdio 在本機執行,需要 Node.js 20.15 以上版本。必須提供來自 PolyDoc 儀表板的 POLYDOC_API_KEY。可選變數 POLYDOC_BASE_URL、POLYDOC_OUTPUT_DIR 與 POLYDOC_SANDBOX 分別調整 API 位址、下載資料夾與沙箱預設值。需要能連線至 PolyDoc API 的網路。
安裝前請注意
API 金鑰是付費服務憑證,以環境變數傳入;除非開啟沙箱模式,轉換會消耗正式配額,而沙箱輸出帶浮水印且有限流。送交轉換的內容(包含發票資料)會傳到 PolyDoc API,webhook 或雲端儲存交付會把結果送到你指定的第三方位址。檔案會寫入所設定的輸出資料夾。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 PolyDoc,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

polydoc-mcp

An MCP server for PolyDoc, a REST API that converts HTML or URLs to PDF, captures screenshots, and generates EU-compliant e-invoices (Factur-X / ZUGFeRD hybrid PDF/A-3). It lets MCP clients (Claude Desktop, Claude Code, Cursor, and others) drive PolyDoc directly.

PDF output can target PDF/A (archival) and PDF/UA-1 (accessible, ISO 14289-1). Both are best-effort by default; set verify on either to validate the result with veraPDF and fail the request instead of returning a non-conforming file.

Tools

  • polydoc_html_to_pdf - HTML, URL, or saved template to PDF (layout, margins, page format, page ranges, bookmarks, tagged PDFs, PDF/A and PDF/UA conformance).
  • polydoc_screenshot - HTML, URL, or template to PNG / JPEG / WebP, with viewport and device-pixel-ratio control. Returns an inline image preview when small enough.
  • polydoc_generate_einvoice - Factur-X or ZUGFeRD hybrid PDF/A-3 from structured invoice data, profiles basic, en16931 and extended.
  • polydoc_test_credentials - verify the configured API key with a minimal sandbox render (never draws production quota).

Content can come from a URL, an inline HTML string, or a saved template (with Liquid templateData). Downloads are written to a local directory and the file path is returned; you can also deliver to your cloud storage (presigned URL) or a webhook.

Installation

Requires Node.js >= 20.15. Published to npm, so clients can run it with npx:

npx -y polydoc-mcp

The server is configured entirely through environment variables (see below).

Configuration

VariableRequiredDefaultDescription
POLYDOC_API_KEYyes-API key from dashboard.polydoc.tech.
POLYDOC_SANDBOXnofalseDefault sandbox mode (watermarked, rate-limited). A tool call can override per request.
POLYDOC_BASE_URLnohttps://api.polydoc.techOverride for self-hosted or staging.
POLYDOC_OUTPUT_DIRnoOS temp dir + /polydocWhere downloads are written. Output never escapes this folder.

Client setup

Claude Desktop

Add to claude_desktop_config.json (Settings > Developer > Edit Config):

json
{  "mcpServers": {    "polydoc": {      "command": "npx",      "args": ["-y", "polydoc-mcp"],      "env": {        "POLYDOC_API_KEY": "your-key",        "POLYDOC_OUTPUT_DIR": "/Users/you/Documents/polydoc"      }    }  }}

Claude Code

claude mcp add polydoc -e POLYDOC_API_KEY=your-key -- npx -y polydoc-mcp

Cursor

Add to ~/.cursor/mcp.json (or a project .cursor/mcp.json) using the same mcpServers block shown for Claude Desktop.

Output and delivery

  • Download (default): the file is written under POLYDOC_OUTPUT_DIR and the absolute path is returned with metadata (size, conversion id, credits). Screenshots also return an inline image block. Pass returnBase64: true to also receive the bytes as base64 (heavy; for clients without a filesystem).
  • Cloud storage: set delivery: "cloudStorage" and presignedUrl. The upload URL is returned.
  • Webhook: set delivery: "webhook" and a webhook object ({ url, async?, method?, headers? }).

PDF/A and PDF/UA

polydoc_html_to_pdf takes two conformance targets inside pdfOptions:

json
{  "pdfOptions": {    "pdfa": { "level": "3b", "verify": true },    "pdfua": { "verify": true }  }}

pdfa.level is 1b, 2b, or 3b. Setting pdfua forces a tagged render, so you do not need tagged as well.

Without verify, output is best-effort: it targets the standard but the request still succeeds if the toolchain cannot satisfy every machine-checkable rule. With verify: true, veraPDF validates the result and a non-conforming file fails with 422 instead of being returned. Use it when a downstream system will reject a bad file anyway.

Anything not in a tool's schema?

Every conversion tool has an advanced object that is deep-merged into the request body, so any API capability not surfaced as a typed field (for example pdf.watermark, pdf.encryption, render, request) is still reachable. See the field reference at docs.polydoc.tech.

Examples

Worked tool inputs for each angle live in examples/: a branded PDF from a template, a URL screenshot, and a ZUGFeRD / EN 16931 e-invoice.

Development

  • yarn install
  • yarn build - compile to dist/
  • yarn lint
  • yarn test - unit tests (request builder, output jail, tool handlers) and an in-memory MCP round-trip
  • POLYDOC_API_KEY=your-key yarn test:integration - live smoke tests against the sandbox
  • yarn scrub:check - check for em-dashes in source and docs

Run the built server directly for a quick check:

POLYDOC_API_KEY=your-key node dist/index.js

License

MIT

來源:README.md,提交 c2f3c8a

工具

4

polydoc_html_to_pdf

PolyDoc: HTML/URL to PDF

Convert a web page, inline HTML, or a saved PolyDoc template to a PDF. Provide exactly one source: url, html, or templateId (with optional templateData). By default the PDF is written to the configured output directory and the file path is returned. Note: HTML that loads scripts from a CDN can hang the renderer; prefer self-contained HTML.

輸入參數tagurlhtmlsandboxtimeoutwebhookadvanceddeliveryfilenamepdfOptionstemplateIdpresignedUrl另有 2 個

polydoc_screenshot

PolyDoc: Capture Screenshot

Capture a screenshot of a web page, inline HTML, or a saved PolyDoc template. Provide exactly one source: url, html, or templateId. Returns PNG/JPEG/WebP written to the configured output directory, plus an inline image preview when small enough to display.

輸入參數tagurlhtmlsandboxtimeoutwebhookadvanceddeliveryfilenametemplateIdpresignedUrlreturnBase64另有 2 個

polydoc_generate_einvoice

PolyDoc: Generate E-Invoice

Generate an EU electronic invoice as a hybrid PDF/A-3 (ZUGFeRD or Factur-X): a human-readable PDF with embedded structured invoice XML. Provide the visible document via one source (html, templateId, or url) and the structured data via the invoice object. For EN 16931 (profile en16931), include a dueDate or paymentTerms (rule BR-CO-25), a seller taxId when a line uses VAT category S, a taxSummary, and totals where totalNetAmount + totalTaxAmount = totalGrossAmount.

輸入參數tagurlhtmlverifyinvoice必填profilesandboxtimeoutwebhookadvanceddeliveryfilename另有 5 個

polydoc_test_credentials

PolyDoc: Test Credentials

Verify the configured PolyDoc API key by running a minimal sandbox render. Reports whether the key is accepted; never draws production quota.

無需輸入參數。

版本歷史

6
  1. v0.1.10最新Nov 3, 2026
  2. v0.1.9Oct 30, 2026
  3. v0.1.8Sep 24, 2026
  4. v0.1.7Sep 20, 2026
  5. v0.1.6Sep 18, 2026
  6. v0.1.4Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分