LaTeX MCP Server
Provides LaTeX compilation services using various engines (pdflatex, xelatex, lualatex), manages templates, and offers pre-defined snippets for common LaTeX elements
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
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
A hosted LaTeX editor your assistant can actually use. Search 1,019 free templates, create and edit projects, and compile them to PDF on a real TeX Live farm, getting back the PDF or the compile log when a build fails. Thirteen tools behind OAuth 2.1, with nothing to install and nothing to run locally.
Compile LaTeX to PDF without installing TeX Live. No API key needed to start.
Collaborative LaTeX editor: edit, compile and share PDFs, with full version history.
Model Context Protocol server for Studex tools, notifications, and profile integrations
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.11 npm3Apache 2.0