create_latex_fileLABSCO SUMMARY
Write, check and build a paper in one place.
The base-directory rule and the validation step are what make it usable unattended: the server can only touch the folder you name, and it catches an unclosed environment before pdflatex turns it into a page of cascading errors.
What it is
An MCP server for LaTeX built on FastMCP. It creates .tex files from parameters or from bundled templates, edits them by replace, insert, append and prepend, validates the syntax, and compiles to PDF with pdflatex, xelatex or lualatex. Every file path is resolved inside one base directory and anything outside it is refused.
What you get
- A new LaTeX file created from parameters
- A document started from a bundled template - article, beamer or report
- Targeted edits to an existing file: replace, insert, append, prepend
- Syntax checked before compiling - braces, environments, references and required declarations
- Compilation to PDF with pdflatex, xelatex or lualatex
- The bundled templates browsable as resources under latex:// URIs
Requirements
Python 3.11.9 or newer, and a LaTeX distribution installed separately - MiKTeX or TeX Live on Windows, MacTeX on macOS, texlive-full on Linux. Without one the create and edit tools still work and compilation does not. Point the server at the folder your documents live in; that folder is the boundary.
Setup effort
Build from source — git clone https://github.com/RobertoDure/mcp-latex-server
USE CASES
Starting a paper without hunting for a preamble
Create it from the article template and start writing at the content.
Building slides from an outline you already wrote
Start from the beamer template, then create the document with your own parameters.
Fixing a section without pasting the whole document back
Replace, insert, append or prepend at the point you mean, leaving the rest untouched.
Finding why the build fails deep in the document
Run the syntax check first - it names unbalanced braces, unclosed environments and missing declarations, rather than reporting the first error the compiler tripped over.
Producing the PDF to send
Compile with pdflatex, xelatex or lualatex depending on the fonts the document needs.
8 tools
Listed in project docs. Your client may show a different list.
create_from_templateedit_latex_fileread_latex_filelist_latex_filesvalidate_latexget_latex_structurecompile_latexBEFORE YOU INSTALL
What to know first
Tools you get
8 tools named in the project's documentation.
Requires
Python 3.11.9+
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
You clone this one yourself.
Server setup
git clone https://github.com/RobertoDure/mcp-latex-server
cd mcp-latex-server
uv pip install -e .Install a LaTeX distribution (MiKTeX / TeX Live / MacTeX) if you want the compile tool to work
MCP Clients
Any MCP client
{
"mcpServers": {
"latex-server": {
"command": "uv",
"args": [
"--directory",
"<YOUR_PATH_TO_MCP_LATEX_SERVER>",
"run",
"latex_server.py"
],
"env": {
"LATEX_SERVER_BASE_PATH": "<YOUR_LATEX_SERVER_BASE_PATH>"
}
}
}
}