Typst MCP Server

Typst MCP Server Docs

A practical reference for connecting AI assistants to Typst rendering, validation, documentation lookup, and Markdown/HTML/LaTeX conversion.

Endpoint

https://typst.grenz.net/mcp

Transport: streamable HTTP MCP.

ChatGPT currently requires Developer Mode for remote MCP servers.

Quickstart

ChatGPT

Add a remote MCP server in Developer Mode:

{
  "server_url": "https://typst.grenz.net/mcp"
}

Claude and MCP clients

Use a streamable HTTP MCP server config:

{
  "mcpServers": {
    "typst-renderer": {
      "type": "streamable-http",
      "url": "https://typst.grenz.net/mcp"
    }
  }
}

Input sources

InputUse when
sourceThe content is small enough to send inline. This is the most stable option.
urlThe document is available through a public HTTPS URL.
fileYour MCP client provides a file object with a download URL.
pathThe file already exists on the server inside an allowed input root.
File upload bridging, including ChatGPT local file handoff, is client-dependent. If bridging is unavailable, use inline source or an HTTPS URL.

Conversion

Supported input formats:

markdowngfmhtmllatex

Convert to editable Typst

{
  "input_format": "markdown",
  "source": "# Hello\n\nThis is **bold**."
}

Use tool: convert_document_to_typst

Convert and render directly

{
  "input_format": "latex",
  "source": "\\documentclass{article}\\begin{document}Hello $x^2$.\\end{document}",
  "format": "pdf",
  "filename": "converted-report",
  "lifespan_hours": 12
}

Use tool: render_converted_document

Rendering

Rendered outputs are temporary and token-protected. Files use a 6-hour lifespan by default; render calls can set lifespan_hours up to 48 hours.

Each render gets a random token generated with nanoid(32). The server stores the token, filename, and expiry locally, reloads that metadata after restarts, and only serves the file when the URL includes the matching ?token=....

{
  "source": "= Report\n\nHello from Typst.",
  "format": "pdf",
  "filename": "report",
  "lifespan_hours": 6
}

Use tool: render_typst

Tool reference

ToolPurpose
render_typstRender Typst source to PDF, SVG, or PNG.
render_typst_fileRender a Typst file from file, URL, path, or source.
render_typst_from_templateRender predefined report, letter, or lab templates.
convert_document_to_typstConvert Markdown, GFM, HTML, or LaTeX to Typst.
render_converted_documentConvert a document and render it directly.
latex_snippet_to_typstConvert a single LaTeX snippet, including bare formulas.
latex_snippets_to_typstConvert multiple LaTeX snippets.
check_if_snippet_is_valid_typst_syntaxValidate one Typst snippet with compiler diagnostics.
check_if_snippets_are_valid_typst_syntaxValidate multiple Typst snippets.
list_docs_chaptersList available Typst documentation chapters.
get_docs_chapterRead one Typst documentation chapter.
get_docs_chaptersRead multiple Typst documentation chapters.