Skip to main content
Glama

Unsliced

Turn Markdown or HTML into searchable PDFs that never slice tables or diagrams in half.

npm Glama score License: MIT

English · 中文

Fixed-height slicing cuts the 3 May table row across two pages; Unsliced keeps the row whole on page 2

Unsliced is a local MCP tool for AI assistants such as Claude, Cursor and OpenCode. It chooses page breaks across the whole document instead of page by page:

  • Tables split only between complete rows, with the header repeated on continuation pages.

  • Diagrams, cards and images stay whole whenever they fit on a page, and headings stay with the content that follows.

  • Real text, not screenshots. You can search and copy everything in the PDF.

  • Chinese works out of the box with a bundled font.

Install

Install Node.js 22 or newer, then add a local stdio MCP server with this launch command:

npx -y unsliced-pdf-mcp

Any MCP client that can launch a local stdio server can use it. No HTTP URL or separate installation from source is required.

Merge into claude_desktop_config.json via Settings → Developer → Edit Config, then quit and reopen Claude Desktop. Official documentation.

{
  "mcpServers": { "unsliced": { "command": "npx", "args": ["-y", "unsliced-pdf-mcp"] } }
}

Merge into .cursor/mcp.json (project) or ~/.cursor/mcp.json (global). Official documentation.

{
  "mcpServers": { "unsliced": { "type": "stdio", "command": "npx", "args": ["-y", "unsliced-pdf-mcp"] } }
}

Merge into opencode.jsonc. Official documentation.

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": { "servers": { "unsliced": { "type": "local", "command": ["npx", "-y", "unsliced-pdf-mcp"] } } }
}

Ask your assistant to use create_pdf and return the saved path. By default, PDF files go to Documents/Unsliced. Source archiving is off by default; set UNSLICED_KEEP_SOURCE=1 to save the unchanged source and its generation record under sources/ in the PDF output directory. Setup and troubleshooting.

Related MCP server: md-mermaid-to-pdf-mcp

How it works

1 Measure each block in Chromium. 2 Score every possible page break across the whole document. 3 Print with rows kept whole and the table header repeated.

Each page break has a cost: blank space left at the bottom of a page, an extra page, or a table split. Unsliced adds up the cost of every complete plan and picks the lowest, instead of filling one page at a time.

Compare pagination

Fixed-height slices

The image at the top shows the same fictional Northline quarterly report on A4 with 15 mm margins. Fixed-height jsPDF slices cut through the 3 May table row between pages 1 and 2. Unsliced keeps the entire row on page 2.

jsPDF fixed slices

Unsliced

4 pages · 3 cut table rows

4 pages · 0 cut blocks

This jsPDF baseline uses raster slices, so its pages are images and the text cannot be searched or copied. It does not represent every jsPDF export mode.

Page by page vs whole document

Page-by-page planning moves the whole table to page 2 and leaves page 1 71% blank, ending with a near-empty page 3. Unsliced splits the table between rows and fits the invoice on 2 pages.

A sample service invoice. Planning one page at a time moves the whole table to page 2, leaving page 1 71% blank and pushing the payment note onto a third page. Unsliced splits the table between complete rows and fits the invoice on 2 pages. On ordinary reports, both approaches often choose the same breaks; the difference shows up mainly around long tables.

Pagination rules · More comparisons · Local preference review

Credits and development

Unsliced is based on BreakFlow and retains its MIT license and copyright notice. The bundled Unsliced Sans SC font is based on Noto Sans SC and is licensed under SIL Open Font License 1.1. BreakFlow · MIT license · Font license

Unsliced’s approach belongs to the family of globally optimized pagination methods and draws on the work of Donald Knuth and Michael Plass (global line breaking, 1981); Michael Plass (doctoral dissertation on optimal pagination, 1981); Frank Mittelbach (global pagination framework, 2016); and Brüggemann-Klein et al. (pagination of complex documents, 2003).

Install dependencies with pnpm install --frozen-lockfile and python -m pip install -r scripts/requirements.txt. Use UNSLICED_PYTHON to select a Python environment if needed. Run pnpm exec playwright install chromium, pnpm test, pnpm test:mcp, and pnpm acceptance.

Available Tools

1 tool
create_pdf用 Unsliced 生成 PDFA

当用户需要可搜索、可复制、自动分页的 PDF 时使用。必须把完整原稿传入 markdown 或 html 的其中一个字段,不要缩写、删减或改写,再给出 filename。默认 A4。普通报告用 Markdown。涉及流程图、卡片、复杂版面或内联 SVG 时,请提交包含样式和图形的完整 HTML。图片请用内嵌 data URL。HTML 可用 data-unsliced-root 指定排版容器。返回本机文件路径和中文排版体检。请直接调用本工具,避免自行写 jsPDF 或 html2canvas。

Inputs: filename (required), html, markdown, paper_size.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 1 tool

    Disambiguation5/5

    There is only one tool, so there is no possibility of selection confusion. Its purpose (produce a searchable, paginated PDF from Markdown or HTML) is stated explicitly and unambiguously.

    Naming Consistency5/5

    create_pdf follows a clean verb_noun snake_case convention. With a single tool there is no cross-tool inconsistency to penalize.

    Tool Count3/5

    The surface is extremely thin: one tool must carry the entire server's purpose. It is defensible for a narrowly scoped PDF-generation service, but leaves no room for companion operations such as validation, templating, or file retrieval.

    Completeness4/5

    Creation is the core operation and the description covers input formats, defaults, images, and layout containers, plus a returned file path. Minor gaps remain: no way to list, inspect, or delete previously generated files, and no explicit preview/validation step.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides tools for converting Markdown content and files into professional PDF documents with full support for Mermaid diagrams and LaTeX rendering. It allows for high-quality output customization, including paper size, table of contents, and syntax highlighting styles.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Converts Markdown files and raw content into professionally styled PDFs with full support for Mermaid diagrams and syntax highlighting. It offers customizable page formats, margins, and modern typography for high-quality document generation.
      11
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Turn markdown into designed PDFs with cover page, table of contents, and code blocks that hold across pages. One command from Claude Desktop, Claude Code, Cursor, Cline, Zed, or any MCP-capable client.
      2
      98 npm
      2
      MIT