Typst Mcp

data-ai 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.

FreshInstall Ready
data-aidata-ai
6 views180 stars19 forksMIT

Why This Matters

Discovered via unknown and last synced 4d ago.

FreshInstall Ready
Source
unknown
Stars
180
Last synced
4d ago
Install
Instructions detected

Install

1. Install the package

docker run --rm -i ghcr.io/johannesbrandenburger/typst-mcp:latest

2. Add to claude_desktop_config.json

{
  "mcpServers": {
    "typst-mcp": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "ghcr.io/johannesbrandenburger/typst-mcp:latest"
      ]
    }
  }
}

Config file location: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) / %APPDATA%\Claude\claude_desktop_config.json (Windows)

27
Tools
0
Resources
0
Prompts
Standard I/O
Transport

Available Tools (27)

Before

sending complex Typst illustrations to the user, the LLM should render the code to an image and check if it looks correct.

The

LLM should select the relevant chapter to read based on the task at hand.

Only

relevant for multi modal models.

Also

available as `check_if_snippets_are_valid_typst_syntax(typst_snippets: list)` for validating multiple Typst snippets at once.

Lets

the LLM get an overview of the documentation and select a chapter to read.

LLMs

are better at writing LaTeX than Typst, so this tool helps convert LaTeX code to Typst.

Based

on the chapter selected by the LLM, this tool retrieves the content of the chapter.

Variable

Description

TYPST_MCP_CONTEXT

Label for trace events (e.g. `cryo-lab`, `ai-lab`). Default: `default`

TYPST_MCP_TRACE_DIR

Directory to write JSONL trace logs. Tracing disabled if unset.

TYPST_MCP_ONTOLOGY_DIR

Directory for ontology node YAML files. Ontology disabled if unset.

Tool

Description

doc_compile

Compile a `.typ` or `.tex` file to PDF. Returns structured errors.

doc_get_structure

Parse section tree with IDs, levels, line ranges, and word counts.

doc_get_section

Extract raw source + plain text for a named section.

doc_source_to_pdf

Map a source line number → PDF page + section.

doc_pdf_to_source

Map a PDF page → source sections with line ranges.

doc_rewrite_section

Replace section content. Auto-backs up; rolls back on compile failure.

doc_insert_paragraph

Insert a paragraph at `start`, `end`, or paragraph-N within a section.

doc_bib_audit

Find unused keys, missing keys, and duplicates in a `.bib` file.

doc_review_section

Heuristic review: completeness, citations, clarity, consistency.

doc_diff

Section-level diff between two documents.

doc_figure_inventory

List all figures, captions, source files, and where each is referenced.

doc_register

Write a document as a YAML ontology node. Requires `TYPST_MCP_ONTOLOGY_DIR`.

Feature

Typst

Compile

✓

Bibliography

✓ BibTeX / Hayagriva