MCP LaTeX Server is an MCP server that provides tools for creating, editing, validating, and compiling LaTeX documents directly through Model Context Protocol clients. Built with FastMCP and Pydantic, it interfaces with an external local LaTeX distribution such as TeX Live, MiKTeX, or MacTeX. Technical writers, researchers, students, and software developers use this server to automate the production of structured documents, academic papers, and presentation decks. It enables LLMs to read existing source files, insert or replace text, check syntax for balancing errors and missing references, inspect document outlines, and compile sources into PDF files using engines like pdflatex, xelatex, or lualatex. The server restricts file operations to a configured root directory via an environment variable, preventing unauthorized file system access outside the designated path. By exposing bundled templates through custom URI resources and standardized tools, it bridges the gap between conversational AI assistants and traditional typesetting workflows.
Category: Developer Tools & Code Intelligence
Tags: document-generation, latex, pdf, typesetting
bash git clone https://github.com/RobertoDure/mcp-latex-server cd mcp-latex-server 2. Install dependencies using uv: bash uv pip install -e . 3. Ensure a LaTeX distribution (such as TeX Live, MiKTeX, or MacTeX) is installed and accessible in your system PATH. 4. Add the server to your Claude Desktop configuration file (claude_desktop_config.json) under mcpServers: json { "mcpServers": { "latex-server": { "command": "uv", "args": [ "--directory", "/path/to/mcp-latex-server", "run", "latex_server.py" ], "env": { "LATEX_SERVER_BASE_PATH": "/path/to/your/latex/files" } } } } 5. Restart Claude Desktop to load the tools.Part of MCP Servers
Clone the official repository using git clone, navigate to the directory, and run uv pip install -e . or use standard pip within a virtual environment. You must also have Python 3.11.9 or higher and an external LaTeX distribution like TeX Live, MiKTeX, or MacTeX installed on your system PATH for compilation features to work.
It provides tools to create, read, edit, and list LaTeX files, validate document syntax, extract document structure, and compile documents into PDFs. It also exposes bundled templates for articles, reports, and beamer slides using custom resource URIs, operating entirely within a specified safe directory.
The server works with any MCP-compliant client, including Claude Desktop and VS Code with GitHub Copilot. Configuration is handled by adding the server startup command and base path environment variable to the client configuration JSON file.
Yes, MCP LaTeX Server is open-source software licensed under the MIT license. You can view the complete source code, contribute modifications, or report issues on its GitHub repository.