Skip to content
Back to search

typst-mcp

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.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/johannesbrandenburger--typst-mcp/badge.svg)](/listings/johannesbrandenburger--typst-mcp)

HTML

<a href="/listings/johannesbrandenburger--typst-mcp"><img src="/api/listings/johannesbrandenburger--typst-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

- Clone this repository - `git clone https://github.com/johannesbrandenburger/typst-mcp.git` - Clone the [typst repository](https://github.com/typst/typst.git) - `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.json` and the assets in the `typst-docs` folder - Install required dependencies: `uv sync` (install [uv](https://github.com/astral-sh/uv) if not already installed)

- Install Typst

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 262 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Typst MCP Server
  2. Typst MCP Server is an [MCP (Model Context Protocol)](https://github.com/modelcontextprotocol) implementation that helps AI models interact with [Typst](https://github.com/typst/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.
  3. ## Available Tools
  4. >⚠️ Currently all the functionality is implemented as `tools`, because Cursor and VS Code are not able to handle the other primitives yet.
  5. The server provides the following tools:
  6. 1. **`list_docs_chapters()`**: Lists all chapters in the Typst documentation.
  7. - Lets the LLM get an overview of the documentation and select a chapter to read.
  8. - The LLM should select the relevant chapter to read based on the task at hand.
  9. 2. **`get_docs_chapter(route)`**: Retrieves a specific chapter from the Typst documentation.
  10. - Based on the chapter selected by the LLM, this tool retrieves the content of the chapter.
  11. - Also available as `get_docs_chapters(routes: list)` for retrieving multiple chapters at once.
  12. 3. **`latex_snippet_to_typst(latex_snippet)`**: Converts LaTeX code to Typst using Pandoc.
  13. - LLMs are better at writing LaTeX than Typst, so this tool helps convert LaTeX code to Typst.
  14. - Also available as `latex_snippets_to_typst(latex_snippets: list)` for converting multiple LaTeX snippets at once.
  15. 4. **`check_if_snippet_is_valid_typst_syntax(typst_snippet)`**: Validates Typst code.
  16. - Before sending Typst code to the user, the LLM should check if the code is valid.
  17. - Also available as `check_if_snippets_are_valid_typst_syntax(typst_snippets: list)` for validating multiple Typst snippets at once.
  18. 5. **`typst_to_image(typst_snippet)`**: Renders Typst code to a PNG image.
  19. - Before sending complex Typst illustrations to the user, the LLM should render the code to an image and check if it looks correct.
  20. - Only relevant for multi modal models.
  21. ## Getting Started
  22. - Clone this repository
  23. - `git clone https://github.com/johannesbrandenburger/typst-mcp.git`
  24. - Clone the [typst repository](https://github.com/typst/typst.git)
  25. - `git clone https://github.com/typst/typst.git`
  26. - Run the docs generation in the typst repository
  27. - `cargo run --package typst-docs -- --assets-dir ../typst-mcp/typst-docs --out-file ../typst-mcp/typst-docs/main.json`
  28. - Make sure to adjust the path to your local clone of the typst-mcp repository
  29. - This will generate the `main.json` and the assets in the `typst-docs` folder
  30. - Install required dependencies: `uv sync` (install [uv](https://github.com/astral-sh/uv) if not already installed)
  31. - Install Typst
  32. ## Running the Server
  33. ### Local Installation
  34. Execute the server script:
  35. ```bash
  36. python server.py
  37. ```
  38. Or install it in Claude Desktop with MCP:
  39. ```bash
  40. mcp install server.py
  41. ```
  42. Or use the new agent mode in VS Code:
  43. [Agent mode: available to all users and supports MCP](https://code.visualstudio.com/blogs/2025/04/07/agentMode)
  44. ### Docker
  45. For Docker installation and usage, see [DOCKER.md](DOCKER.md) for detailed build information and instructions.
  46. ## Platform Configuration
  47. This MCP server can be integrated with various AI coding platforms. Below are configuration instructions for popular platforms:
  48. ### Claude Desktop
  49. Add the following to your Claude Desktop configuration file (`claude_desktop_config.json`):
  50. **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
  51. **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
  52. ```json
  53. {
  54. "mcpServers": {
  55. "typst": {
  56. "command": "docker",
  57. "args": [
  58. "run", "--rm", "-i",
  59. "ghcr.io/johannesbrandenburger/typst-mcp:latest"
  60. ]
  61. }
  62. }
  63. }
  64. ```
  65. Or for local installation:
  66. ```json
  67. {
  68. "mcpServers": {
  69. "typst": {
  70. "command": "docker",
  71. "args": [
  72. "run", "--rm", "-i",
  73. "ghcr.io/johannesbrandenburger/typst-mcp:latest"
  74. ]
  75. }
  76. }
  77. }
  78. ```
  79. ### Cursor
  80. Create `.cursor/mcp.json` in your project root for project-specific configuration:
  81. ```json
  82. {
  83. "mcpServers": {
  84. "typst": {
  85. "command": "docker",
  86. "args": [
  87. "run", "--rm", "-i",
  88. "ghcr.io/johannesbrandenburger/typst-mcp:latest"
  89. ]
  90. }
  91. }
  92. }
  93. ```
  94. Or create `~/.cursor/mcp.json` for global configuration. For local installation:
  95. ```json
  96. {
  97. "mcpServers": {
  98. "typst": {
  99. "command": "python",
  100. "args": ["/path/to/typst-mcp/server.py"]
  101. }
  102. }
  103. }
  104. ```
  105. ### Roo Code
  106. Create `.roo/mcp.json` in your project root for project-specific configuration:
  107. ```json
  108. {
  109. "mcpServers": {
  110. "typst": {
  111. "command": "docker",
  112. "args": [
  113. "run", "--rm", "-i",
  114. "ghcr.io/johannesbrandenburger/typst-mcp:latest"
  115. ]
  116. }
  117. }
  118. }
  119. ```
  120. Or edit global settings via Roo Code MCP settings view. For local installation:
  121. ```json
  122. {
  123. "mcpServers": {
  124. "typst": {
  125. "command": "python",
  126. "args": ["/path/to/typst-mcp/server.py"]
  127. }
  128. }
  129. }
  130. ```
  131. ### OpenCode
  132. Create or edit the `opencode.json` file in your project root:
  133. ```json
  134. {
  135. "$schema": "https://opencode.ai/config.json",
  136. "mcp": {
  137. "typst": {
  138. "type": "local",
  139. "command": ["docker", "run", "--rm", "-i",
  140. "ghcr.io/johannesbrandenburger/typst-mcp:latest"
  141. ],
  142. "enabled": true
  143. }
  144. }
  145. }
  146. ```
  147. For local installation:
  148. ```json
  149. {
  150. "$schema": "https://opencode.ai/config.json",
  151. "mcp": {
  152. "typst": {
  153. "type": "local",
  154. "command": ["python", "/path/to/typst-mcp/server.py"],
  155. "enabled": true
  156. }
  157. }
  158. }
  159. ```
  160. ### Claude Code
  161. Configure MCP servers in your Claude Code settings file (`~/.claude/settings.json`):
  162. ```json
  163. {
  164. "mcpServers": {
  165. "typst": {
  166. "command": "docker",
  167. "args": [
  168. "run", "--rm", "-i",
  169. "ghcr.io/johannesbrandenburger/typst-mcp:latest"
  170. ]
  171. }
  172. }
  173. }
  174. ```
  175. Or for local installation:
  176. ```json
  177. {
  178. "mcpServers": {
  179. "typst": {
  180. "command": "python",
  181. "args": ["/path/to/typst-mcp/server.py"]
  182. }
  183. }
  184. }
  185. ```
  186. ### VS Code with Agent Mode
  187. VS Code's Agent Mode has native MCP support (no extension required):
  188. 1. Enable Agent Mode in VS Code settings (`chat.agent.enabled`)
  189. 2. Create `.vscode/mcp.json` in your workspace:
  190. ```json
  191. {
  192. "servers": {
  193. "typst": {
  194. "command": "docker",
  195. "args": [
  196. "run", "--rm", "-i",
  197. "ghcr.io/johannesbrandenburger/typst-mcp:latest"
  198. ]
  199. }
  200. }
  201. }
  202. ```
  203. For global configuration, add to your user profile via **MCP: Open User Configuration** command.
  204. ## JSON Schema of the Typst Documentation
  205. >⚠️ 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.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.