mcp-latex
Provides tools for checking LaTeX documents (static analysis for undefined references, duplicate/unused labels, unbalanced environments), parsing compiler logs, and compiling .tex files, enabling AI assistants to detect and fix LaTeX issues.
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., "@mcp-latex Check my thesis for undefined references and unbalanced environments."
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.
mcp-latex
A Model Context Protocol (MCP) server for LaTeX. Give an AI assistant (Claude Desktop, Claude Code, Cursor…) the ability to check your LaTeX document, parse compiler logs, and compile — so it can actually fix your thesis or paper instead of guessing. Static analysis works with no TeX install required.
🌍 English · Português · 📚 Documentation
Tools
Tool | Description |
| Static analysis: undefined refs, duplicate/unused labels, unbalanced environments; lists labels/refs/citations. No TeX needed. |
| Turns a |
| Compiles a |
Related MCP server: Overleaf MCP
Use with Claude Desktop / Claude Code
{
"mcpServers": {
"latex": { "command": "npx", "args": ["-y", "mcp-latex"] }
}
}Then ask: "Check my thesis for undefined references and unbalanced environments," or "Compile main.tex and fix the first error."
Why
Writing a thesis in LaTeX means fighting cryptic compiler errors, dangling \refs and
\begin/\end mismatches. An AI assistant is great at fixing these — if it can
see the actual errors. This server gives it structured eyes on your document. Built
from the pain of writing a real master's thesis.
Run locally
npm install
npm start # stdio server
npm test # unit + stdio integration tests
npm run build # tsc -> dist/Try it with the MCP Inspector:
npx @modelcontextprotocol/inspector npx -y mcp-latexLicense
MIT © Marcelo Domingues
Available Tools
3 toolscheck_documentCheck LaTeX documentA
Static analysis of LaTeX source: finds undefined references, duplicate/unused labels, and unbalanced environments. Lists labels, references and citations. Works without a TeX install.
Inputs: path, source.
compileCompile LaTeXA
Compiles a .tex file with latexmk/pdflatex if a TeX engine is installed, and returns parsed errors. Returns available:false with guidance if no engine is found.
Inputs: path (required), engine.
parse_logParse LaTeX logA
Parses a LaTeX .log file into structured errors, warnings, undefined references/citations, and over/underfull box counts.
Inputs: path, logContent.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The three tools are largely distinct: check_document performs static analysis, parse_log consumes a log file, and compile invokes an external engine. There is minor overlap in that both check_document and parse_log can report undefined references/citations, but the input source (source file vs. log file) clarifies the intended use.
Two tools use the verb_noun pattern (check_document, parse_log), while compile uses a bare verb. This is a minor deviation from an otherwise consistent naming style, but the intent is still clear.
With only 3 tools, the server is well-scoped for LaTeX document validation and compilation. Each tool serves a distinct and necessary function without redundancy or bloat.
The toolset covers the core workflow of checking source, compiling, and parsing logs. Minor gaps exist, such as no tool for cleaning auxiliary files or managing bibliographies, but these are not essential for the server's stated purpose.
Maintenance
Related MCP Connectors
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
An MCP server that integrates with Discord to provide AI-powered features.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseAqualityBmaintenanceAn MCP server that enables MCP clients to directly access and process arXiv papers by fetching the LaTeX source, improving mathematical content understanding.5338 PyPI151MIT
- AlicenseNot gradedqualityBmaintenanceA real-time MCP server that enables AI coding agents to read, write, and compile LaTeX projects in self-hosted Overleaf instances via native OT protocol.97 npm13AGPL 3.0
- AlicenseAqualityDmaintenanceAn MCP server that exposes LaTeX compilation, log parsing, dependency inspection, and citation checking as tools for AI agents, using latexmk under the hood.1124 npm1MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables LLMs to compile LaTeX documents and inspect the resulting PDF, supporting an autonomous write-compile-check-revise loop via a self-hosted Overleaf CLSI instance.1MIT