typeset-mcp
v0.2.1MCP server that typesets Markdown documents to PDF with the Typst engine (CJK-first)
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
validate_document Validate a Markdown document
Lint a Markdown document before typesetting. Checks YAML frontmatter, heading hierarchy, code fences, table columns, and local image or link targets. Fix every *error* finding; treat *advisory* findings as judgment calls. Read guide 'authoring' for the habits behind these checks.
| Parameter | Type | Description |
|---|---|---|
path * | string |
typeset_document Typeset a Markdown document to PDF
Convert a Markdown document to PDF via the Typst engine. Runs validation first and refuses to build while error findings exist (re-run validate_document for the list). Writes the draft pair <stem>.build.typ and <stem>.build.pdf beside the document; the receipt carries pages, compile time, and the sha256 fingerprint that publish_document's expected_fingerprint expects. Read guide 'workflow' before first use.
| Parameter | Type | Description |
|---|---|---|
path * | string |
measure_document Measure a Markdown document
Estimate layout risks before compiling. Returns table widths, code line widths, image sizes, and a rough page count, each compared against the text area (textWidthPt). Run it when planning a long or dense document; risks name TABLE_TOO_WIDE, CODE_LINE_TOO_LONG, and IMAGE_TOO_WIDE with line numbers.
| Parameter | Type | Description |
|---|---|---|
path * | string |
inspect_document Inspect a built PDF
Report pages, fonts, metadata, and a bounded text sample of a PDF.
| Parameter | Type | Description |
|---|---|---|
path * | string |
audit_document Audit a built PDF
Audit a built PDF for typography defects. Findings come from the rendered output: unembedded fonts (error), missing text layer (error), text near page edges, orphan headings, and blank pages (advisories). Fix errors; weigh advisories against what the reader feels. Geometry estimates are approximate by design.
| Parameter | Type | Description |
|---|---|---|
path * | string |
render_pages Render PDF pages as images
Render pages of a built PDF to PNG files for visual review. Returns the first three page images inline plus a JSON receipt listing every rendered file (page, file, width, height). Files land in <stem>.pages/page-N.png next to the PDF. Render the changed pages after edits and inspect them before publishing; keep dpi between 24 and 400.
| Parameter | Type | Description |
|---|---|---|
path * | string | |
dpi | integer | |
pages |
create_project Create a project from a template
Scaffold a new project from a named template. Available templates: report (multi-chapter book with cover and outline), homework (compact answer sheet with student info header, no cover page), slides (beamer presentation). Creates a manifest (book.yaml/project.yaml) plus chapter files; call typeset_project on the manifest after editing.
| Parameter | Type | Description |
|---|---|---|
path * | string | |
template | string |
convert_figures Convert PDF figures to PNG
Batch-convert PDF vector figures in a directory to PNG siblings. LaTeX papers typically reference PDF vector figures that cannot be embedded directly. Run this on the figure directory before typesetting; the output PNGs land beside the originals and markdown image references are rewritten from .pdf to .png automatically.
| Parameter | Type | Description |
|---|---|---|
path * | string | |
dpi | integer |
typeset_project Build a multi-chapter project into one PDF
Build multiple Markdown chapters into a single PDF book. Reads a YAML manifest (path) with a chapters list, title, author, and theme settings. Each chapter is a separate .md file; frontmatter and H1 are stripped to avoid duplication. Produces one PDF with cover, outline, and all chapters. Chapters are joined in manifest order.
| Parameter | Type | Description |
|---|---|---|
path * | string |
publish_document Publish a built PDF
Copy a built draft PDF to its final destination. Parameters: path (the draft .build.pdf), output (the final file), replace (overwrite a differing target), expected_fingerprint (the 64-hex sha256 fingerprint from the typeset_document receipt), remove_source (delete the draft pair after copying). Passing expected_fingerprint fails loudly if the draft changed since it was built; remove_source leaves exactly one final file.
| Parameter | Type | Description |
|---|---|---|
output * | string | |
path * | string | |
expected_fingerprint | ||
remove_source | boolean | |
replace | boolean |
list_guides List bundled guides
List the methodology guides. Read 'workflow' before first use.
read_guide Read one bundled guide
Read one bundled guide by name (from list_guides).
| Parameter | Type | Description |
|---|---|---|
name * | string |