
boxpdf-html
io.github.earonesty由 GitHub 帳號 earonesty 發布v1.7.0更新於 Oct 24, 2026
Render HTML to PDF (html_to_pdf) plus boxpdf library docs and templates, for AI agents.
發布方自己的服務:captcha.cc Human Verification
概覽
一個本機 stdio MCP 伺服器,將撰寫好的 HTML 轉譯為靜態 PDF,並向助理提供 boxpdf 函式庫文件與範本。
- 可以做什麼
- 將 HTML 字串(可選擇附上 CSS)轉譯為 PDF,寫入指定檔案路徑或以 base64 資源內嵌回傳,並一律回傳警告與不支援的 CSS 診斷。依主題查詢 boxpdf 使用指南,例如快速入門、字型、主題、表格、分頁、串流處理、HTML API 與 Cloudflare。讀取內建資源:一份指南、若干說明文件,以及五個文件範本(收據、登機證、履歷、訂單確認、證書)。
- 適用情境
- 當助理需要在不使用瀏覽器的情況下,把發票、收據、報告、電子郵件等撰寫好的文件 HTML 轉成靜態 PDF,並希望在同一個伺服器中取得函式庫使用指南與起步範本時使用。
- 執行需求
- 以 stdio 本機程序執行,例如透過 npx 啟動,需要 Node.js 與該 npm 套件。未宣告帳號、API 金鑰或環境變數。除非啟用 allowRemote 選項,否則遠端 http(s) 圖片會被阻擋。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 boxpdf-html,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
@boxpdf/html-reader
Readable HTML-to-PDF rendering built on @boxpdf/writer. It is for invoices, receipts, reports, emails, and other authored document HTML where a useful static PDF matters more than browser pixel emulation.
The original boxpdf-html package and boxpdf-html command remain supported. They are published
from the same build and at the same version as @boxpdf/html-reader. New projects should use the
scoped package; existing projects do not need to change.
CLI
Render an HTML file directly:
The scoped package also provides html-reader as a shorter command name.
With generated Tailwind CSS:
For very large inputs, add --stream:
Streaming makes two bounded passes over the HTML: one for CSS, fonts, and
images, then one for incremental layout and PDF output. Stdin is spooled to a
temporary file so it can be reopened. The output replaces its destination only
after a successful conversion. This path requires boxpdf 1.12.0 or newer.
With PDF 2.0 AES-256 password encryption:
--password-env accepts an environment-variable name. The variable must be
set to a non-empty password. The password value is never accepted as a command
argument, which keeps it out of the command line and process listing.
With custom fonts and local images:
Useful flags:
The CLI defaults to pdf-lib's built-in Helvetica family. Use real embedded fonts for production output when brand matching, unicode coverage, or exact metrics matter.
MCP server
boxpdf-html mcp is a stdio MCP server for AI agents. It's batteries-included: an html_to_pdf tool plus the full boxpdf library docs, so an agent never has to add a second server.
Tools
html_to_pdf— render an HTML string (and optionalcss) to a PDF. Writes tooutputPath, or returns the PDF inline as a base64 resource. Always returnswarningsandunsupportedCssdiagnostics so the agent can fix its input.- Args:
html(required),css,outputPath,size(Letter/A4/Legal/Tabloid, defaultLetter),margin(default 40),baseUrl,fonts: { regular, bold, italic, boldItalic }(TTF/OTF paths),allowRemote(defaultfalse— http(s) image fetches are blocked unless enabled),debug.
- Args:
boxpdf_docs— focused guidance for building PDFs with the libraries directly.topic:quickstart(default),fonts,themes,tables,pagination,streaming,html-api,cloudflare.
Resources: boxpdf-html://guide, boxpdf-html://readme, boxpdf://readme, and the five boxpdf://templates/<name> sources (receipt, boarding-pass, resume, order-confirmation, certificate).
The server runs no JavaScript and (by default) makes no network requests. outputPath writes with the agent's filesystem permissions; without it, PDFs over 1 MB are summarized rather than inlined.
API
htmlToPdf — one call to bytes
htmlToPdf(html, options?) is the simplest path: it creates the document, embeds fonts, renders, and returns the PDF bytes. Fonts default to the built-in Helvetica family, so the minimal call needs no setup.
Pass embedded fonts (via loadFont) and a resolveImage callback for production output:
Options: font / boldFont / italicFont / boldItalicFont (default to Helvetica), pdf (render into an existing document), margin (default 40), size (default US Letter), width (CSS containing-block width; defaults to the page's content width), debug, plus everything htmlToBoxpdf accepts (resolveFont, resolveImage, baseUrl, defaultFontSize, defaultColor, diagnostics, profile).
htmlToBoxpdf — the nodes, for full control
htmlToBoxpdf turns HTML into normal boxpdf nodes without rendering. Reach for it when you need the nodes themselves, the warnings/diagnostics, multiple render passes, or renderFlow headers/footers.
width is the CSS containing block width in PDF points. A US Letter page with 40pt margins has a 532pt content width, so width: 532 is a good default.
streamHtmlToPdf — bounded large-document conversion
streamHtmlToPdf accepts a function that reopens the HTML for each of its two
passes and writes PDF bytes incrementally. Embed fonts before calling it; use
prepare to embed images found by the resource preflight before output begins.
Ordinary block wrappers and tables are released in bounded continuation fragments. Atomic layouts such as flex/grid, positioned or transformed containers, and single uninterrupted text nodes have explicit safety caps and fail with a useful error when they cannot be streamed safely. Selectors whose meaning depends on sibling position conservatively disable wrapper fragmentation.
Fonts
Fonts are explicit. boxpdf-html does not discover system fonts and does not ship a browser font stack. This keeps rendering deterministic and works in serverless runtimes.
At minimum, pass font. Pass boldFont and italicFont if your HTML uses bold or italic text:
For CSS font-family, use fontFamily():
The resolver receives { families, weight, style } and returns a pdf-lib PDFFont. You can provide your own resolver when you need looser mapping, font aliases, language-specific fallbacks, or weight synthesis.
Gotchas:
font-family: system-uionly works if your resolver mapssystem-ui.- Standard pdf-lib fonts are convenient but limited; use embedded TTF/OTF fonts for real documents.
- Complex shaping depends on pdf-lib/fontkit behavior. Western-language invoice/report text is the target.
- Font metrics affect layout. Use the same embedded fonts in tests and production when visual stability matters.
Tailwind CSS
Tailwind works when you render its generated CSS, not raw class names alone. The usual flow is:
- Write document HTML with Tailwind classes.
- Run Tailwind against that HTML.
- Inline or pass the generated CSS to
boxpdf-html. - Render with a containing width that matches your intended PDF content area.
Example source:
Build CSS:
Supported Tailwind patterns include common spacing, color, text, border, radius, width/height, flex, grid, table, image, and arbitrary-value utilities. Unsupported utility declarations can be reported with --unsupported-css or diagnostics: { unsupportedCss: true }.
Tailwind gotchas:
- Responsive/state variants are parsed as CSS; there is no viewport interaction. Choose a single generated CSS target for the PDF you want.
- Two-dimensional transforms support ordered
translate,scale,rotate,skew, andmatrixfunction lists, their X/Y variants,transform-origin, and the standalonetranslate,rotate, andscaleproperties. Length/percentage translations anddeg,grad,rad, andturnangles are supported. Three-dimensional transforms, shadows, filters, transitions, and browser-only effects are ignored or reported as unsupported. - Tailwind preflight resets are mostly harmless. Diagnostics intentionally focus on utility selectors instead of noisy base selectors.
- If text layout matters, use the same fonts in Tailwind design review and PDF rendering.
Images
The API uses resolveImage because pdf-lib images must be embedded before rendering:
The CLI preloads local, http(s), and data: image URLs referenced by <img src> and CSS url(...). Missing images preserve their layout box when width/height can be inferred.
CSS And HTML Surface
Supported:
- HTML fragments and full documents via
parse5. - Stylesheets and inline styles via
css-tree. - Selectors: tag, class, id, attributes, descendants, child/sibling combinators, common structural pseudos, and escaped Tailwind selectors.
- Cascade basics: stylesheet rules, inline style,
!important, inheritance, custom properties,var(), and commoncalc(). - Layout: block, inline, inline-block, inline-flex, inline-grid, flex, grid fallback, tables, floats, absolute/relative positioning, z-index, overflow hidden, and replaced images.
- Text: rich inline runs, hard breaks, normal/no-wrap/pre-like whitespace, transforms, decoration, alignment, vertical-align, list hanging indents, and wrapping.
- Sizing/styling: CSS px to points, pt, em/rem, vw/vh, percentages in common places, min/max widths, box-sizing, margin/padding/gap, backgrounds, background images, borders, per-side borders, border collapse, radius, object-fit.
Not a browser:
- No JavaScript execution.
- No interactive or dynamic layout.
- No full browser paint model.
- No system font discovery.
- CSS support is intentionally expanded around static document output. Use diagnostics to find unsupported declarations in real templates.
Diagnostics
Unsupported CSS diagnostics are aggregated by property/value pair and include selector samples. Profile events cover parsing, CSS, style computation, render-tree construction, and output node counts.
Useful commands:
來源:README.md,提交 d0aa81d
工具
0版本歷史
2- v1.7.0最新Oct 9, 2026
- v1.6.0Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
其他 Captcha 整合

captcha.cc Human Verification
cc.captcha官方發布者
面向 captcha.cc 的遠端 MCP 伺服器,協助助理產生 CAPTCHA 整合程式碼片段,並建立即時挑戰供測試使用。

CaptchaNo
由 GitHub 帳號 DishantSinghDev2 發布
CaptchaNo MCP 伺服器讓 AI 助理透過付費解碼服務破解 reCAPTCHA v2/v3/Enterprise、Turnstile、DataDome 與圖片驗證碼。

rea-captcha
由 GitHub 帳號 masakaai 發布
一個本機 stdio MCP 伺服器,在代理既有的瀏覽器工作階段中偵測 CAPTCHA 驗證挑戰,協調授權完成或人工接手,然後恢復原任務。

Capmonster Mcp Patchright Captcha Solver
由 GitHub 帳號 CapMonsterCloud 發布
隱身瀏覽器自動化 MCP 伺服器,提供 66 個工具,用於頁面導覽、內容擷取以及工作階段、Cookie 與設定檔管理。

Capmonster Mcp Captcha Solver
由 GitHub 帳號 CapMonsterCloud 發布
讓 AI 助理向 CapMonster Cloud 提交驗證碼求解任務並輪詢結果,涵蓋 reCAPTCHA、Turnstile 等反機器人挑戰。