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 "Install 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 installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Appeared in Searches
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/TheTailorRetailored/latex-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server