Typst MCP Server

Typst MCP Server

Facilitates AI-driven Typst interactions with LaTeX conversion, validation, and image generation tools.

79
Stars
7
Forks
79
Watchers
3
Issues
Typst MCP Server implements the Model Context Protocol, enabling AI models to interface seamlessly with Typst, a markup-based typesetting system. It provides tools for tasks such as converting LaTeX to Typst, validating Typst syntax, listing and retrieving Typst documentation chapters, and rendering Typst code as images. The server is compatible with MCP agent clients, such as Claude Desktop and VS Code’s agent mode. All functionalities are exposed as tools for ease of LLM integration.

Key Features

Convert LaTeX snippets to Typst using Pandoc
Validate Typst code syntax individually or in batches
Render Typst code to PNG images for visual feedback
List all chapters in the Typst documentation for context navigation
Retrieve one or more specific documentation chapters by route
Batch processing for conversions and validations
Exposes tools following MCP standards for agent model usage
Can be installed in Claude Desktop or VS Code agent mode
Assists LLMs in generating correct Typst code
Facilitates programmatic documentation access and conversion workflows

Use Cases

Assisting language models in converting LaTeX math to Typst format
Validating Typst code generated by AI before presenting it to users
Programmatically accessing and retrieving Typst documentation chapters
Rendering Typst source code into images to verify appearance
Integrating Typst tooling in AI development environments
Automating document creation and conversion workflows for technical writing
Supporting multimodal models in previewing Typst-generated illustrations
Enabling agent-based tools to enhance code completion or document authoring
Streamlining transitions from LaTeX to Typst for collaborative projects
Enhancing educational tools that require dynamic document formatting or visualization

README

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:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.json and the assets in the typst-docs folder
  • Install required dependencies: uv sync (install uv if not already installed)

  • Install Typst

Running the Server

Execute the server script:

bash
python server.py

Or install it in Claude Desktop with MCP:

bash
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.

Star History

Star History Chart

Repository Owner

Repository Details

Language Python
Default Branch main
Size 87 KB
Contributors 1
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

Python
100%

Tags

Topics

llm mcp pandoc typst

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • Notion MCP Server

    Notion MCP Server

    Enable LLMs to interact with Notion using the Model Context Protocol.

    Notion MCP Server allows large language models to interface with Notion workspaces through a Model Context Protocol server, supporting both data retrieval and editing capabilities. It includes experimental Markdown conversion to optimize token usage for more efficient communication with LLMs. The server can be configured with environment variables and controlled for specific tool access. Integration with applications like Claude Desktop is supported for seamless automation.

    • 834
    • MCP
    • suekou/mcp-notion-server
  • Klavis

    Klavis

    One MCP server for AI agents to handle thousands of tools.

    Klavis provides an MCP (Model Context Protocol) server with over 100 prebuilt integrations for AI agents, enabling seamless connectivity with various tools and services. It offers both cloud-hosted and self-hosted deployment options and includes out-of-the-box OAuth support for secure authentication. Klavis is designed to act as an intelligent connector, streamlining workflow automation and enhancing agent capability through standardized context management.

    • 5,447
    • MCP
    • Klavis-AI/klavis
  • Coda MCP Server

    Coda MCP Server

    A Model Context Protocol server enabling seamless interaction with Coda documents and pages.

    Coda MCP Server implements a Model Context Protocol (MCP) server that bridges AI assistants or MCP clients with the Coda API. It provides standardized tools for listing, creating, reading, updating, duplicating, and renaming Coda pages, as well as handling document context. The server communicates over standard input/output, supporting integration with platforms like Cursor and Claude Desktop, and can be deployed via Node.js or Docker.

    • 36
    • MCP
    • orellazri/coda-mcp
  • Confluence Communication Server MCP Server

    Confluence Communication Server MCP Server

    Seamlessly interact with Confluence using standardized MCP tools.

    Confluence Communication Server MCP Server is a TypeScript-based implementation that enables seamless interaction with Confluence through the Model Context Protocol. It provides tools for running CQL queries, retrieving, and updating Confluence page content, thus showcasing and adhering to core MCP concepts. The server is compatible with Claude Desktop and supports installation via Smithery, emphasizing ease of integration and automation for Confluence management tasks.

    • 13
    • MCP
    • KS-GEN-AI/confluence-mcp-server
  • OpenAI MCP Server

    OpenAI MCP Server

    Bridge between Claude and OpenAI models using the MCP protocol.

    OpenAI MCP Server enables direct querying of OpenAI language models from Claude via the Model Context Protocol (MCP). It provides a configurable Python server that exposes OpenAI APIs as MCP endpoints. The server is designed for seamless integration, requiring simple configuration updates and environment variable setup. Automated testing is supported to verify connectivity and response from the OpenAI API.

    • 77
    • MCP
    • pierrebrunelle/mcp-server-openai
  • MCP Manager for Claude Desktop

    MCP Manager for Claude Desktop

    A desktop app to manage Model Context Protocol (MCP) servers for Claude Desktop on MacOS.

    MCP Manager for Claude Desktop provides a user-friendly interface to manage Model Context Protocol (MCP) servers, enabling Claude to access private data, APIs, and local or remote services securely from a MacOS desktop. It facilitates rapid configuration and integration with a wide variety of MCP servers, including productivity tools, databases, and web APIs. The app runs locally to ensure data privacy and streamlines connecting Claude to new sources through simple environment and server settings management.

    • 270
    • MCP
    • zueai/mcp-manager
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results