### Install Typst MCP Server with MCP Source: https://github.com/johannesbrandenburger/typst-mcp/blob/main/README.md Install the server using the MCP command-line tool for integration with MCP-compatible environments. ```bash mcp install server.py ``` -------------------------------- ### Run Typst MCP Server Source: https://context7.com/johannesbrandenburger/typst-mcp/llms.txt Commands for starting the server locally using Python or via Docker. ```bash # Local installation - install dependencies with uv uv sync # Run the server directly python server.py # Or install in Claude Desktop with MCP mcp install server.py # Docker - pull and run the pre-built image docker run --rm -i ghcr.io/johannesbrandenburger/typst-mcp:latest ``` -------------------------------- ### Get Multiple Documentation Chapters Source: https://context7.com/johannesbrandenburger/typst-mcp/llms.txt Tool call to retrieve content for multiple chapters in a single request. ```python # MCP tool call - get multiple chapters at once result = get_docs_chapters([ "____reference____layout____colbreak", "____reference____text____text" ]) # Returns JSON array containing both chapters [ { "route": "/reference/layout/colbreak", "title": "Column Break", "body": "Forces a column break..." }, { "route": "/reference/text/text", "title": "Text", "body": "Displays text in the document..." } ] ``` -------------------------------- ### Get Documentation Chapter Source: https://context7.com/johannesbrandenburger/typst-mcp/llms.txt Tool call to retrieve content for a specific chapter, using underscores for route pathing. ```python # MCP tool call - get a specific documentation chapter result = get_docs_chapter("____reference____layout____colbreak") # Returns the full chapter content as JSON # Example output for a leaf chapter: { "route": "/reference/layout/colbreak", "title": "Column Break", "body": "Forces a column break at the current position...", "examples": [...] } # For large chapters with children, returns simplified structure: { "route": "/reference/layout", "title": "Layout", "content_length": 12456, "note": "This chapter is large. Only child routes are shown. Request specific child routes for detailed content.", "child_routes": [ {"route": "/reference/layout/colbreak", "content_length": 2341}, {"route": "/reference/layout/page", "content_length": 5678} ] } ``` -------------------------------- ### Configure Claude Desktop for Typst MCP Server (Docker) Source: https://github.com/johannesbrandenburger/typst-mcp/blob/main/README.md Configure Claude Desktop to use the Typst MCP Server via Docker. This setup is for macOS and Windows. ```json { "mcpServers": { "typst": { "command": "docker", "args": [ "run", "--rm", "-i", "ghcr.io/johannesbrandenburger/typst-mcp:latest" ] } } } ``` -------------------------------- ### OpenCode Configuration for Typst MCP (Local) Source: https://github.com/johannesbrandenburger/typst-mcp/blob/main/README.md Configure OpenCode to use a locally installed Typst MCP server. Specify the correct path to the server script. ```json { "$schema": "https://opencode.ai/config.json", "mcp": { "typst": { "type": "local", "command": ["python", "/path/to/typst-mcp/server.py"], "enabled": true } } } ``` -------------------------------- ### Configure Cursor for Typst MCP Server (Local) Source: https://github.com/johannesbrandenburger/typst-mcp/blob/main/README.md Configure Cursor for project-specific or global use of a locally installed Typst MCP Server. ```json { "mcpServers": { "typst": { "command": "python", "args": ["/path/to/typst-mcp/server.py"] } } } ``` -------------------------------- ### Build and run using the build script Source: https://github.com/johannesbrandenburger/typst-mcp/blob/main/DOCKER.md Use the provided build script to manage base and runtime image creation or container execution. ```bash # Build both base and runtime images ./build.sh # Build only runtime image (for code changes) ./build.sh runtime # Build only base image (when docs change) ./build.sh base # Run the container ./build.sh run ``` -------------------------------- ### Run the pre-built Typst-MCP image Source: https://github.com/johannesbrandenburger/typst-mcp/blob/main/DOCKER.md Execute the latest pre-built container image directly. ```bash # Pull and run the pre-built image docker run --rm -i ghcr.io/johannesbrandenburger/typst-mcp:latest ``` -------------------------------- ### Build Docker Images Source: https://context7.com/johannesbrandenburger/typst-mcp/llms.txt Commands for building Docker images for the MCP project. Supports building base, runtime, or both images, and running the container. ```bash ./build.sh ``` ```bash ./build.sh runtime ``` ```bash ./build.sh base ``` ```bash ./build.sh run ``` ```bash docker build -f Dockerfile.base -t ghcr.io/johannesbrandenburger/typst-mcp-base:latest . ``` ```bash docker build -f Dockerfile.runtime -t ghcr.io/johannesbrandenburger/typst-mcp:latest . ``` -------------------------------- ### Run Typst MCP Server Locally Source: https://github.com/johannesbrandenburger/typst-mcp/blob/main/README.md Execute the server script directly from the command line for local development or testing. ```bash python server.py ``` -------------------------------- ### List Documentation Chapters Source: https://context7.com/johannesbrandenburger/typst-mcp/llms.txt Tool call to retrieve available documentation chapters and their content lengths. ```python # MCP tool call result = list_docs_chapters() # Returns JSON array of chapter routes with content lengths # Example output: [ {"route": "/docs", "content_length": 15234}, {"route": "/reference", "content_length": 89123}, {"route": "/reference/layout", "content_length": 12456}, {"route": "/reference/layout/colbreak", "content_length": 2341}, {"route": "/reference/text", "content_length": 18923}, {"route": "/tutorial", "content_length": 45678} ] ``` -------------------------------- ### Configure MCP Server Source: https://context7.com/johannesbrandenburger/typst-mcp/llms.txt Configuration files for integrating the Typst MCP server into various AI coding environments. ```json { "mcpServers": { "typst": { "command": "docker", "args": [ "run", "--rm", "-i", "ghcr.io/johannesbrandenburger/typst-mcp:latest" ] } } } ``` ```json { "mcpServers": { "typst": { "command": "docker", "args": [ "run", "--rm", "-i", "ghcr.io/johannesbrandenburger/typst-mcp:latest" ] } } } ``` ```json { "servers": { "typst": { "command": "docker", "args": [ "run", "--rm", "-i", "ghcr.io/johannesbrandenburger/typst-mcp:latest" ] } } } ``` ```json { "mcpServers": { "typst": { "command": "python", "args": ["/path/to/typst-mcp/server.py"] } } } ``` -------------------------------- ### OpenCode Configuration for Typst MCP (Docker) Source: https://github.com/johannesbrandenburger/typst-mcp/blob/main/README.md Configure OpenCode to use the Typst MCP via Docker. Ensure the Docker daemon is running and the image is accessible. ```json { "$schema": "https://opencode.ai/config.json", "mcp": { "typst": { "type": "local", "command": ["docker", "run", "--rm", "-i", "ghcr.io/johannesbrandenburger/typst-mcp:latest" ], "enabled": true } } } ``` -------------------------------- ### Build images manually Source: https://github.com/johannesbrandenburger/typst-mcp/blob/main/DOCKER.md Execute Docker build commands directly for the base and runtime images. ```bash # Build base image with Typst documentation docker build -f Dockerfile.base -t ghcr.io/johannesbrandenburger/typst-mcp-base:latest . # Build runtime image docker build -f Dockerfile.runtime -t ghcr.io/johannesbrandenburger/typst-mcp:latest . ``` -------------------------------- ### Configure Docker Compose Source: https://github.com/johannesbrandenburger/typst-mcp/blob/main/DOCKER.md Define the service configuration for running the Typst-MCP container via Docker Compose. ```yaml version: '3.8' services: typst-mcp: image: ghcr.io/johannesbrandenburger/typst-mcp:latest stdin_open: true tty: false restart: unless-stopped ``` -------------------------------- ### list_docs_chapters Source: https://context7.com/johannesbrandenburger/typst-mcp/llms.txt Retrieves a list of all available chapters in the Typst documentation to help the LLM understand the documentation structure. ```APIDOC ## list_docs_chapters ### Description Lists all chapters available in the Typst documentation. This tool should be called first to get an overview of the documentation structure. ### Response #### Success Response (200) - **Array** (JSON) - A list of chapter objects containing the route and content length. #### Response Example [ {"route": "/docs", "content_length": 15234}, {"route": "/reference", "content_length": 89123} ] ``` -------------------------------- ### Typst Documentation Tools Source: https://github.com/johannesbrandenburger/typst-mcp/blob/main/README.md Tools for listing and retrieving Typst documentation chapters. ```APIDOC ## list_docs_chapters() ### Description Lists all available chapters in the Typst documentation to allow the LLM to select relevant content. ## get_docs_chapter(route) ### Description Retrieves the content of a specific Typst documentation chapter based on the provided route. ### Parameters #### Request Body - **route** (string) - Required - The route/path of the documentation chapter to retrieve. ## get_docs_chapters(routes) ### Description Retrieves multiple Typst documentation chapters at once. ### Parameters #### Request Body - **routes** (list) - Required - A list of routes/paths for the documentation chapters to retrieve. ``` -------------------------------- ### Typst Rendering Tool Source: https://github.com/johannesbrandenburger/typst-mcp/blob/main/README.md Tool for rendering Typst code into visual output. ```APIDOC ## typst_to_image(typst_snippet) ### Description Renders Typst code into a PNG image, useful for verifying complex illustrations. ### Parameters #### Request Body - **typst_snippet** (string) - Required - The Typst code to render into an image. ``` -------------------------------- ### Render Typst Snippet to Image Source: https://context7.com/johannesbrandenburger/typst-mcp/llms.txt Renders a Typst snippet to a PNG image. Supports multi-page documents and automatically crops to content with padding. Useful for visual verification by multimodal LLMs. ```python result = typst_snippet_to_image("$f in K ( t^H , beta )_delta$") ``` ```python result = typst_snippet_to_image("#figure( table( columns: 3, [*Name*], [*Age*], [*City*], [Alice], [30], [New York], [Bob], [25], [London], ), caption: [Sample data table] )") ``` ```python result = typst_snippet_to_image("#set page(height: 5cm) = Page 1 Some content here. #pagebreak() = Page 2 More content here.") ``` ```python result = typst_snippet_to_image("$\invalid$") ``` -------------------------------- ### VS Code Agent Mode Configuration for Typst MCP (Docker) Source: https://github.com/johannesbrandenburger/typst-mcp/blob/main/README.md Configure VS Code Agent Mode to use the Typst MCP via Docker. This requires Agent Mode to be enabled in VS Code settings. ```json { "servers": { "typst": { "command": "docker", "args": [ "run", "--rm", "-i", "ghcr.io/johannesbrandenburger/typst-mcp:latest" ] } } } ``` -------------------------------- ### Typst Conversion and Validation Tools Source: https://github.com/johannesbrandenburger/typst-mcp/blob/main/README.md Tools for converting LaTeX to Typst and validating Typst syntax. ```APIDOC ## latex_snippet_to_typst(latex_snippet) ### Description Converts a single LaTeX code snippet to Typst using Pandoc. ### Parameters #### Request Body - **latex_snippet** (string) - Required - The LaTeX code to convert. ## latex_snippets_to_typst(latex_snippets) ### Description Converts multiple LaTeX code snippets to Typst. ### Parameters #### Request Body - **latex_snippets** (list) - Required - A list of LaTeX snippets to convert. ## check_if_snippet_is_valid_typst_syntax(typst_snippet) ### Description Validates a single Typst code snippet for syntax correctness. ### Parameters #### Request Body - **typst_snippet** (string) - Required - The Typst code to validate. ## check_if_snippets_are_valid_typst_syntax(typst_snippets) ### Description Validates multiple Typst code snippets for syntax correctness. ### Parameters #### Request Body - **typst_snippets** (list) - Required - A list of Typst snippets to validate. ``` -------------------------------- ### typst_snippet_to_image Source: https://context7.com/johannesbrandenburger/typst-mcp/llms.txt Renders a Typst snippet to a PNG image. ```APIDOC ## typst_snippet_to_image ### Description Renders a Typst snippet to a PNG image. Supports multi-page documents by stacking pages vertically. ### Parameters #### Request Body - **snippet** (string) - Required - The Typst code to render. ### Response #### Success Response (200) - **result** (image/png) - The rendered image object. ``` -------------------------------- ### get_docs_chapter Source: https://context7.com/johannesbrandenburger/typst-mcp/llms.txt Retrieves the content of a specific documentation chapter by its route. ```APIDOC ## get_docs_chapter ### Description Retrieves a specific chapter from the Typst documentation by its route. Routes use underscores instead of slashes for MCP compatibility. ### Parameters #### Request Body - **route** (string) - Required - The chapter route using underscores (e.g., "____reference____layout____colbreak"). ### Response #### Success Response (200) - **Object** (JSON) - Returns the chapter content or a list of child routes if the chapter is large. #### Response Example { "route": "/reference/layout/colbreak", "title": "Column Break", "body": "Forces a column break at the current position..." } ``` -------------------------------- ### latex_snippets_to_typst Source: https://context7.com/johannesbrandenburger/typst-mcp/llms.txt Converts multiple LaTeX snippets to Typst in a single call. ```APIDOC ## latex_snippets_to_typst ### Description Converts a list of LaTeX snippets to Typst code in a single batch operation. ### Parameters #### Request Body - **snippets** (array of strings) - Required - A list of LaTeX snippets to convert. ### Response #### Success Response (200) - **result** (array of strings) - A JSON array containing the converted Typst snippets. ``` -------------------------------- ### get_docs_chapters Source: https://context7.com/johannesbrandenburger/typst-mcp/llms.txt Retrieves multiple documentation chapters in a single call. ```APIDOC ## get_docs_chapters ### Description Retrieves multiple documentation chapters in a single call by providing a list of routes. ### Parameters #### Request Body - **routes** (array) - Required - A list of chapter routes to retrieve. ### Response #### Success Response (200) - **Array** (JSON) - An array containing the content of all requested chapters. #### Response Example [ { "route": "/reference/layout/colbreak", "title": "Column Break", "body": "Forces a column break..." } ] ``` -------------------------------- ### Batch Convert LaTeX Snippets to Typst Source: https://context7.com/johannesbrandenburger/typst-mcp/llms.txt Converts multiple LaTeX snippets to Typst in a single call. Useful for processing lists of LaTeX expressions or environments. ```python result = latex_snippets_to_typst([ "$f\in K ( t^ { H } , \beta ) _ { \delta }$", "\begin{align} a &= b \\ c &= d \end{align}", "\textbf{bold text}" ]) ``` -------------------------------- ### latex_snippet_to_typst Source: https://context7.com/johannesbrandenburger/typst-mcp/llms.txt Converts a single LaTeX snippet to Typst code. ```APIDOC ## latex_snippet_to_typst ### Description Converts a single LaTeX snippet to Typst code. Returns the converted string or an error message if conversion fails. ### Parameters #### Request Body - **snippet** (string) - Required - The LaTeX code snippet to convert. ### Response #### Success Response (200) - **result** (string) - The converted Typst code. ``` -------------------------------- ### Convert LaTeX Snippet to Typst Source: https://context7.com/johannesbrandenburger/typst-mcp/llms.txt Converts a single LaTeX snippet to Typst. Handles mathematical expressions and basic LaTeX structures like figures. ```python result = latex_snippet_to_typst("$ f\in K ( t^ { H } , \beta ) _ { \delta } $") ``` ```python result = latex_snippet_to_typst("\begin{figure}[t] \includegraphics[width=8cm]{\"placeholder.png\"} \caption{Placeholder image} \label{fig:placeholder} \centering \end{figure}") ``` ```python result = latex_snippet_to_typst("\invalid{command}") ``` -------------------------------- ### check_if_snippets_are_valid_typst_syntax Source: https://context7.com/johannesbrandenburger/typst-mcp/llms.txt Validates multiple Typst snippets in a single call. ```APIDOC ## check_if_snippets_are_valid_typst_syntax ### Description Validates a list of Typst snippets and returns the validation status for each. ### Parameters #### Request Body - **snippets** (array of strings) - Required - A list of Typst snippets to validate. ### Response #### Success Response (200) - **result** (array of strings) - A JSON array of validation results. ``` -------------------------------- ### check_if_snippet_is_valid_typst_syntax Source: https://context7.com/johannesbrandenburger/typst-mcp/llms.txt Validates a single Typst snippet for correct syntax. ```APIDOC ## check_if_snippet_is_valid_typst_syntax ### Description Validates whether a Typst snippet has correct syntax by compiling it. Returns 'VALID' or an error message. ### Parameters #### Request Body - **snippet** (string) - Required - The Typst code to validate. ### Response #### Success Response (200) - **result** (string) - 'VALID' if correct, otherwise an error message. ``` -------------------------------- ### Batch Validate Typst Syntax Source: https://context7.com/johannesbrandenburger/typst-mcp/llms.txt Validates multiple Typst snippets in a single call, returning an array of validation results. Useful for checking a list of generated snippets. ```python result = check_if_snippets_are_valid_typst_syntax([ "$f in K ( t^H , beta )_delta$", "#let x = 1 #x", "$a = \frac{1}{2}$" ]) ``` -------------------------------- ### Validate Typst Syntax Source: https://context7.com/johannesbrandenburger/typst-mcp/llms.txt Validates if a Typst snippet has correct syntax by attempting to compile it. Returns 'VALID' or an error message with diagnostics for invalid code. ```python result = check_if_snippet_is_valid_typst_syntax("$f in K ( t^H , beta )_delta$") ``` ```python result = check_if_snippet_is_valid_typst_syntax("#let x = 1 #x") ``` ```python result = check_if_snippet_is_valid_typst_syntax("$a = \frac{1}{2}$") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.