- Explore MCP Servers
- typst-mcp
Typst Mcp
What is Typst Mcp
Typst MCP Server is an implementation of the Model Context Protocol (MCP) that facilitates interaction between AI models and Typst, a markup-based typesetting system. It provides tools for converting LaTeX to Typst, validating Typst syntax, and generating images from Typst code.
Use cases
Use cases for Typst MCP include converting existing LaTeX documents to Typst, validating Typst code before publication, and generating visual representations of Typst code for presentations or educational materials.
How to use
To use Typst MCP, you can utilize its various tools through API calls. For example, you can list documentation chapters, convert LaTeX snippets to Typst, validate Typst syntax, and render Typst code to images. Each tool serves a specific purpose to enhance the interaction with Typst.
Key features
Key features of Typst MCP include: 1) Listing and retrieving documentation chapters, 2) Converting LaTeX code to Typst format, 3) Validating Typst syntax, and 4) Rendering Typst code to PNG images.
Where to use
Typst MCP can be used in fields such as academic publishing, technical documentation, and any area that requires high-quality typesetting and document preparation. It is particularly useful for AI applications that need to generate or manipulate typeset documents.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Overview
What is Typst Mcp
Typst MCP Server is an implementation of the Model Context Protocol (MCP) that facilitates interaction between AI models and Typst, a markup-based typesetting system. It provides tools for converting LaTeX to Typst, validating Typst syntax, and generating images from Typst code.
Use cases
Use cases for Typst MCP include converting existing LaTeX documents to Typst, validating Typst code before publication, and generating visual representations of Typst code for presentations or educational materials.
How to use
To use Typst MCP, you can utilize its various tools through API calls. For example, you can list documentation chapters, convert LaTeX snippets to Typst, validate Typst syntax, and render Typst code to images. Each tool serves a specific purpose to enhance the interaction with Typst.
Key features
Key features of Typst MCP include: 1) Listing and retrieving documentation chapters, 2) Converting LaTeX code to Typst format, 3) Validating Typst syntax, and 4) Rendering Typst code to PNG images.
Where to use
Typst MCP can be used in fields such as academic publishing, technical documentation, and any area that requires high-quality typesetting and document preparation. It is particularly useful for AI applications that need to generate or manipulate typeset documents.
Clients Supporting MCP
The following are the main client software that supports the Model Context Protocol. Click the link to visit the official website for more information.
Content
Typst MCP Server
Typst MCP Server is an MCP (Model Context Protocol) implementation that helps AI models interact with Typst, a markup-based typesetting system. The server provides tools for converting between LaTeX and Typst, validating Typst syntax, and generating images from Typst code.
Available Tools
⚠️ Currently all the functionality is implemented as
tools, because Cursor and VS Code are not able to handle the other primitives yet.
The server provides the following tools:
-
list_docs_chapters(): Lists all chapters in the Typst documentation.- Lets the LLM get an overview of the documentation and select a chapter to read.
- The LLM should select the relevant chapter to read based on the task at hand.
-
get_docs_chapter(route): Retrieves a specific chapter from the Typst documentation.- Based on the chapter selected by the LLM, this tool retrieves the content of the chapter.
- Also available as
get_docs_chapters(routes: list)for retrieving multiple chapters at once.
-
latex_snippet_to_typst(latex_snippet): Converts LaTeX code to Typst using Pandoc.- LLMs are better at writing LaTeX than Typst, so this tool helps convert LaTeX code to Typst.
- Also available as
latex_snippets_to_typst(latex_snippets: list)for converting multiple LaTeX snippets at once.
-
check_if_snippet_is_valid_typst_syntax(typst_snippet): Validates Typst code.- Before sending Typst code to the user, the LLM should check if the code is valid.
- Also available as
check_if_snippets_are_valid_typst_syntax(typst_snippets: list)for validating multiple Typst snippets at once.
-
typst_to_image(typst_snippet): Renders Typst code to a PNG image.- Before sending complex Typst illustrations to the user, the LLM should render the code to an image and check if it looks correct.
- Only relevant for multi modal models.
Getting Started
-
Clone this repository
git clone https://github.com/johannesbrandenburger/typst-mcp.git
-
Clone the typst repository
git clone https://github.com/typst/typst.git
-
Run the docs generation in the typst repository
cargo run --package typst-docs -- --assets-dir ../typst-mcp/typst-docs --out-file ../typst-mcp/typst-docs/main.json- Make sure to adjust the path to your local clone of the typst-mcp repository
- This will generate the
main.jsonand the assets in thetypst-docsfolder
-
Install required dependencies:
uv sync(install uv if not already installed) -
Install Typst
Running the Server
Execute the server script:
python server.py
Or install it in Claude Desktop with MCP:
mcp install server.py
Or use the new agent mode in VS Code:
Agent mode: available to all users and supports MCP
JSON Schema of the Typst Documentation
⚠️ The schema of the typst documentation is not stable and may change at any time. The schema is generated from the typst source code and is not guaranteed to be complete or correct. If the schema changes, this repository will need to be updated accordingly, so that the docs functionality works again.
Dev Tools Supporting MCP
The following are the main code editors that support the Model Context Protocol. Click the link to visit the official website for more information.










