LaTeX MCP Server
A server that enables compilation of LaTeX documents to PDF and management of reusable templates and snippets through the Model Context Protocol.
README
LaTeX MCP Server
A Model Context Protocol (MCP) server for LaTeX compilation and document generation.
Features
- LaTeX Compilation: Compile LaTeX source to PDF using various engines (pdflatex, xelatex, lualatex)
- Template System: Manage reusable LaTeX templates
- Snippets/Macros: Use predefined LaTeX components (equations, figures, multiple choice questions, etc.)
- Automatic Cleanup: Old files are automatically cleaned up during compilation
- Caching: Compiled documents are cached to avoid recompilation
- Security: Dangerous LaTeX commands are blocked
MCP Tools
Core Tools
compile_latex- Compile LaTeX source to PDFlist_templates- List available LaTeX templatesget_template- Get template source code
Snippets System
list_snippets- List available LaTeX snippets/macrosget_snippet_info- Get detailed info about a snippet including parametersrender_snippet- Render a snippet with provided parameters
Available Snippets
- multiple_choice - Creates multiple choice questions with 4 options
- equation - Creates numbered equations with optional labels
- figure - Creates figures with captions and optional labels
Installation
Docker (Recommended)
- Build the image:
docker build -f Dockerfile.simple -t mcp-latex-simple .
- Run the container:
docker run -d --name mcp-latex-server --restart unless-stopped -p 8083:8080 mcp-latex-simple
Manual Installation
- Install system dependencies:
# Install LaTeX
sudo apt-get install texlive-latex-base texlive-fonts-recommended texlive-latex-extra
# Install Python dependencies
pip install fastmcp jinja2 pydantic pyyaml uvicorn
- Run the server:
python server.py
Configuration
Set environment variables:
PORT- Server port (default: 8080)LATEX_BASE_URL- Base URL for compiled filesLATEX_MAX_FILE_AGE_HOURS- File cleanup age in hours (default: 24)
Usage with Claude
Configure Claude Desktop to connect to your MCP server:
- URL:
https://your-domain.com/ - Transport: HTTP
API
The server exposes a Model Context Protocol interface on the configured port and path.
Security
- Dangerous LaTeX commands are blocked
- File system access is restricted
- No shell escapes allowed during compilation
- Automatic cleanup prevents disk space issues
Development
See the included configuration files:
docker-compose-standalone.yml- Docker Compose setupmcp-latex.service- Systemd servicenginx-include.conf- Nginx configuration
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.