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.
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
| Input | Use when |
|---|---|
source | The content is small enough to send inline. This is the most stable option. |
url | The document is available through a public HTTPS URL. |
file | Your MCP client provides a file object with a download URL. |
path | The file already exists on the server inside an allowed input root. |
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
| Tool | Purpose |
|---|---|
render_typst | Render Typst source to PDF, SVG, or PNG. |
render_typst_file | Render a Typst file from file, URL, path, or source. |
render_typst_from_template | Render predefined report, letter, or lab templates. |
convert_document_to_typst | Convert Markdown, GFM, HTML, or LaTeX to Typst. |
render_converted_document | Convert a document and render it directly. |
latex_snippet_to_typst | Convert a single LaTeX snippet, including bare formulas. |
latex_snippets_to_typst | Convert multiple LaTeX snippets. |
check_if_snippet_is_valid_typst_syntax | Validate one Typst snippet with compiler diagnostics. |
check_if_snippets_are_valid_typst_syntax | Validate multiple Typst snippets. |
list_docs_chapters | List available Typst documentation chapters. |
get_docs_chapter | Read one Typst documentation chapter. |
get_docs_chapters | Read multiple Typst documentation chapters. |