LaTeX MCP Server
Provides LaTeX compilation services using various engines (pdflatex, xelatex, lualatex), manages templates, and offers pre-defined snippets for common LaTeX elements
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@LaTeX MCP Servercompile my math homework to PDF"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
LaTeX MCP Server
A small Model Context Protocol server that compiles LaTeX documents and serves the resulting PDFs. It also exposes a handful of document templates and reusable snippets.
The project is usable but lightly maintained: I am not currently developing new features for it.
Tools
compile_latexcompiles a complete document with pdfLaTeX, XeLaTeX or LuaLaTeX.list_templatesandget_templateexpose the bundled document templates.list_snippets,get_snippet_infoandrender_snippetwork with the bundled equation, figure and multiple-choice snippets.
Compiled files are cached by source and engine, then removed after a configurable period.
Related MCP server: PDF Processor MCP Server
Run with Docker
Build from the repository root:
docker build -f deployment/docker/Dockerfile -t latex-mcp .
docker run --rm -p 8083:8080 latex-mcpThe MCP HTTP endpoint is then available at http://localhost:8083/mcp.
Docker Compose configuration is under deployment/docker/:
docker compose -f deployment/docker/docker-compose.yml up --buildRun directly
This requires Python 3.11+ and a TeX distribution providing pdflatex, xelatex or lualatex.
python -m pip install .
python server.pyConfiguration is available through three environment variables:
PORT— HTTP port, defaulting to8080.LATEX_BASE_URL— public base URL used in PDF and log links.LATEX_MAX_FILE_AGE_HOURS— compiled-file retention, defaulting to 24 hours.
Security boundary
LaTeX is a programmable language, and rejecting a short list of commands does not make arbitrary documents safe. Shell escape is disabled and the server performs some basic source validation, but this is not a hardened multi-tenant sandbox.
Use it with trusted inputs, preferably inside a disposable container with no secrets, restricted resources and no unnecessary network or filesystem access. Do not expose the HTTP service publicly without adding authentication and further isolation.
Maintained alternatives
If this server no longer fits your workflow, these more active projects cover adjacent use cases:
mcp-latex-server — LaTeX file creation, editing and project management.
latex-mcp — LaTeX compilation inside Docker.
texflow-mcp — structured document authoring with an MCP compiler.
Development
python -m pip install -e ".[dev]"
pytestDeployment examples for Docker, systemd and Nginx live under deployment/.
Licence
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Model Context Protocol server for Studex tools, notifications, and profile integrations
A Model Context Protocol server for Wix AI tools
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
HTML-to-PDF MCP server — render pixel-faithful PDFs from HTML.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that converts LaTeX mathematical expressions to MathML format.7MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables Claude to fetch, process, and extract information from PDF documents, including LaTeX mathematical equations.4MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that renders LaTeX to PDF via pdflatex, supporting raw LaTeX and Jinja2 templates with artifact generation.11MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server for programmatic creation, modification, and compilation of structured LaTeX documents.5 npm3Apache 2.0