原型 · 预览版:收录官方注册中心里的全部服务器,每 30 分钟同步一次。评价和账户功能将在后续阶段推出。
PopNx MCP为使用 AI 的人准备的 MCP 服务器 · 用大白话讲清楚

boxpdf-html

作者:earonesty版本 1.7.0i★ –i在你的电脑上运行
注册名称io.github.earonesty/boxpdf-html

安装

概览

作者提供的说明(英文原文)

Render HTML to PDF (html_to_pdf) plus boxpdf library docs and templates, for AI agents.

PopNx MCP 的三大支柱

这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。

它能帮你做什么

我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。

  • 连接方式: 在你的电脑上运行
  • 传输方式: stdio
  • 分类: 文档、表格与办公

安装

选择你使用的 AI 应用,然后复制设置。

安装之前

  • 基础检查:1 项中通过 1 项
  • 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
  • 注册中心没有列出需要填写的密钥。

你需要

  • npm已安装 Node.js(用于 npx 命令)

你用的是哪个应用?

在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。

打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json

{
  "mcpServers": {
    "boxpdf-html": {
      "command": "npx",
      "args": [
        "-y",
        "boxpdf-html",
        "mcp"
      ]
    }
  }
}

在终端中运行这条命令

claude mcp add boxpdf-html -- npx -y boxpdf-html mcp

在 Cursor 中打开

或者自己复制设置

粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json

{
  "mcpServers": {
    "boxpdf-html": {
      "command": "npx",
      "args": [
        "-y",
        "boxpdf-html",
        "mcp"
      ]
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

在 VS Code 中打开

或者自己复制设置

粘贴到项目中的 .vscode/mcp.json

{
  "servers": {
    "boxpdf-html": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "boxpdf-html",
        "mcp"
      ]
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。

你的选择通过 Cookie 保存在这台设备上,无需账户。

这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。

它能做什么

它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。

基础检查i

我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月7日

  • ✓ 通过

    作者与仓库一致

    注册名称已通过 GitHub 账户 earonesty 验证,该账户拥有此仓库

  • … 尚未检查

    仍在维护

    我们还没有从 GitHub 读取这个仓库

  • … 尚未检查

    有许可证

    我们还没有从 GitHub 读取这个仓库

  • – 不适用

    端点有响应

    它在你的电脑上运行,没有互联网端点

  • – 不适用

    使用 OAuth 登录

    在你的电脑上运行,改用本地设置

  • … 尚未检查

    工具描述中没有隐藏指令

    它在你的电脑上运行;我们只能读取互联网端点的工具列表

与“文档、表格与办公”中的其他服务器比较i

  • 星标数多于此分类中其他 2183 个服务器的 0%
  • 发布到注册中心的时间比此分类中其他 2183 个服务器的 51% 更新
  • 基础检查结果等于或优于此分类中其他 2183 个服务器的 100%

与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。

常见问题

boxpdf-html 安全吗?

它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。

它需要哪些密钥或代码?

注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。

它在我的电脑上运行还是在云端?

它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。

它还在维护吗?

GitHub 仓库最后更新于–,最新版本(1.7.0)于29天前进入注册中心。

哪些应用可以使用它?

支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。

有什么可以替代它?

同一分类中有:Agent-Native Calendar, Excel MCP Server, MCP Server for Excel

替代选择

同一分类中其他作者的服务器,按星标数排序。

如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i

Agent-Native Calendar

作者:BuilderIO

Agent-Native Google Calendar - manage events, sync, and public booking

在云端运行★ 7,620MIT2个月前更新
安装

Excel MCP Server

作者:haris-musa

Create and edit Excel files with AI: charts, PivotTables, formulas. No Excel needed.

在你的电脑上运行★ 4,276MIT6天前更新
安装

MCP Server for Excel

作者:sbroenne

Excel automation for AI - Sheets, Power Query, DAX, VBA, Tables, Ranges and more. Windows only.

在你的电脑上运行★ 847MIT3天前更新
安装

作者的 README

打开 README

按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。

@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.

npm install @boxpdf/html-reader @boxpdf/writer pdf-lib

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:

npx @boxpdf/html-reader invoice.html invoice.pdf

The scoped package also provides html-reader as a shorter command name.

With generated Tailwind CSS:

npx tailwindcss -i ./tailwind.css -o ./dist/tailwind.css --minify

npx @boxpdf/html-reader invoice.html invoice.pdf --css ./dist/tailwind.css

For very large inputs, add --stream:

npx @boxpdf/html-reader archive.html archive.pdf --stream

type archive.html | npx @boxpdf/html-reader - archive.pdf --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:

BOXPDF_PASSWORD='open me' \

npx @boxpdf/html-reader invoice.html invoice.pdf --password-env BOXPDF_PASSWORD

--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:

npx @boxpdf/html-reader invoice.html invoice.pdf \

--font ./Inter-Regular.ttf \ --bold-font ./Inter-Bold.ttf \ --font-family 'Inter=normal:Inter-Regular.ttf,bold:Inter-Bold.ttf'

Useful flags:

html-reader <input.html> <output.pdf>

html-reader - # read HTML from stdin html-reader input.html output.pdf --css app.css html-reader input.html output.pdf --base-url ./public html-reader input.html output.pdf --password-env BOXPDF_PASSWORD html-reader input.html output.pdf --debug html-reader input.html output.pdf --unsupported-css html-reader input.html output.pdf --profile html-reader input.html output.pdf --stream

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.

claude mcp add boxpdf-html -- npx -y @boxpdf/html-reader mcp

Tools

  • html_to_pdf — render an HTML string (and optional css) to a PDF. Writes to outputPath, or returns the PDF inline as a base64 resource. Always returns warnings and unsupportedCss diagnostics so the agent can fix its input.
  • Args: html (required), css, outputPath, size (Letter/A4/Legal/Tabloid, default Letter), margin (default 40), baseUrl, fonts: { regular, bold, italic, boldItalic } (TTF/OTF paths), allowRemote (default false — http(s) image fetches are blocked unless enabled), debug.
  • 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/ 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.

import { htmlToPdf } from "@boxpdf/html-reader";

const bytes = await htmlToPdf(" Invoice Thanks for your order. ");

Pass embedded fonts (via loadFont) and a resolveImage callback for production output:

import { readFile } from "node:fs/promises";

import { PDFDocument } from "pdf-lib"; import { loadFont, loadImage } from "@boxpdf/writer"; import { htmlToPdf } from "@boxpdf/html-reader";

const pdf = await PDFDocument.create(); const inter = await loadFont(pdf, await readFile("Inter-Regular.ttf")); const interBold = await loadFont(pdf, await readFile("Inter-Bold.ttf")); const logo = await loadImage(pdf, await readFile("logo.png"));

const bytes = await htmlToPdf(await readFile("invoice.html", "utf8"), { pdf, // reuse the document you embedded into font: inter, boldFont: interBold, resolveImage: ({ url }) => (url === "logo.png" ? logo : undefined), margin: 40 });

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.

import { readFile } from "node:fs/promises";

import { PDFDocument } from "pdf-lib"; import { loadFont, loadImage, renderFlow } from "@boxpdf/writer"; import { fontFamily, htmlToBoxpdf } from "@boxpdf/html-reader";

const html = await readFile("invoice.html", "utf8"); const pdf = await PDFDocument.create();

const inter = await loadFont(pdf, await readFile("Inter-Regular.ttf")); const interBold = await loadFont(pdf, await readFile("Inter-Bold.ttf")); const logo = await loadImage(pdf, await readFile("logo.png"));

const result = htmlToBoxpdf(html, { font: inter, boldFont: interBold, resolveFont: fontFamily({ Inter: { normal: inter, bold: interBold }, "sans-serif": { normal: inter, bold: interBold } }), resolveImage: ({ url }) => (url === "logo.png" ? logo : undefined), baseUrl: process.cwd(), width: 532 });

console.log(result.warnings); await renderFlow(pdf, result.nodes, { margin: 40 }); const bytes = await pdf.save();

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.

import { createReadStream, createWriteStream } from "node:fs";

import { PDFDocument, StandardFonts } from "pdf-lib"; import { nodeAdapter } from "@boxpdf/writer"; import { streamHtmlToPdf } from "@boxpdf/html-reader";

const pdf = await PDFDocument.create(); const font = await pdf.embedFont(StandardFonts.Helvetica);

const result = await streamHtmlToPdf( () => createReadStream("archive.html"), nodeAdapter(createWriteStream("archive.pdf")), { pdf, font, width: 532, margin: 40 } );

console.log(result.pageCount, result.dom.maxBufferedNodes);

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:

const result = htmlToBoxpdf(html, {

font, boldFont, italicFont, width: 532 });

For CSS font-family, use fontFamily():

const resolveFont = fontFamily({

Inter: { normal: interRegular, bold: interBold, italic: interItalic, boldItalic: interBoldItalic }, Helvetica: { normal: fallback, bold: fallbackBold }, "sans-serif": { normal: fallback, bold: fallbackBold } });

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-ui only works if your resolver maps system-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:

  1. Write document HTML with Tailwind classes.
  2. Run Tailwind against that HTML.
  3. Inline or pass the generated CSS to boxpdf-html.
  4. Render with a containing width that matches your intended PDF content area.

Example source:

<div class="p-6 bg-[#f8fafc] text-gray-900">

Status Paid

Notes Two fraction column wraps later.

Build CSS:

@import "tailwindcss";

@source "./invoice.html";

npx tailwindcss -i ./tailwind-input.css -o ./tailwind-output.css --minify

npx @boxpdf/html-reader invoice.html invoice.pdf --css ./tailwind-output.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, and matrix function lists, their X/Y variants, transform-origin, and the standalone translate, rotate, and scale properties. Length/percentage translations and deg, grad, rad, and turn angles 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

只显示了开头部分;其余内容请在仓库中阅读

问 PopNx