MCP LaTeX Server

by robertodure

Not rated
GitHub

About

Create, edit, and manage LaTeX files. Requires an external LaTeX distribution like MiKTeX, TeX Live, or MacTeX.

Details

Author
robertodure
Categories
Developer Tools

Setup

Install MCP LaTeX Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/robertodure/mcp-latex-server

Follow the installation instructions in the repository README, then restart your MCP client.

A Model Context Protocol (MCP) server for LaTeX file creation, editing, validation, and compilation. Built withFastMCPand Pydantic for type-safe, structured output.

- CreateLaTeX documents from parameters or bundled templates (article, beamer, report)
- Editfiles with replace, insert, append, and prepend operations
- Readandlist.texfiles within a secure base directory
- Validatesyntax — braces, environments, references, required declarations
- Compileto PDF withpdflatex,xelatex, orlualatex
- Resources— browse and retrieve bundled templates vialatex://URIs

- Python 3.11.9+
- LaTeX distribution(for compilation):

- Windows:MiKTeXorTeX Live
- macOS:
MacTeX(brew install --cask mactex)
- Linux:sudo apt install texlive-full(Debian/Ubuntu) orsudo dnf install texlive-scheme-full(Fedora)

git clone https://github.com/RobertoDure/mcp-latex-server cd mcp-latex-server uv pip install -e .
git clone <repository-url> cd mcp-latex-server python -m venv .venv # Windows .venv\Scripts\activate # macOS/Linux source .venv/bin/activate pip install -e .

This checks Python version, installs dependencies, verifies the server imports correctly, and optionally configures Claude Desktop.

The server uses a single environment variable:

All file paths passed to tools are resolved relative to this base directory. Access outside it is denied.

Add to yourclaude_desktop_config.json:

- Windows:%APPDATA%\Claude\claude_desktop_config.json
- macOS:~/Library/Application Support/Claude/claude_desktop_config.json
- Linux:~/.config/Claude/claude_desktop_config.json

{ "mcpServers": { "latex-server": { "command": "uv", "args": [ "--directory", "/path/to/mcp-latex-server", "run", "latex_server.py" ], "env": { "LATEX_SERVER_BASE_PATH": "/path/to/your/latex/files" } } } }

Add to.vscode/mcp.jsonin your workspace:

{ "servers": { "latex-server": { "command": "uv", "args": [ "--directory", "/path/to/mcp-latex-server", "run", "latex_server.py" ], "env": { "LATEX_SERVER_BASE_PATH": "${workspaceFolder}" } } } }

Create a new LaTeX document from parameters.

Create a document from a bundled template.

Read and return the contents of a.texfile.

Check LaTeX syntax: required declarations, balanced braces, environment matching, undefined references.

Extract document structure: class, title, author, packages, and section hierarchy.

Compile a.texfile to PDF (runs the engine twice for references/TOC).

Server won't start— Verify Python 3.10+ (python --version) and thatmcpis installed (pip list | grep mcp).

Compilation fails— Ensure a LaTeX distribution is on your PATH (pdflatex --version). Install MiKTeX or TeX Live if missing.

"Access denied" errors— The requested file path resolves outsideLATEX_SERVER_BASE_PATH. Use relative paths or adjust the env variable.

Claude can't connect— Double-check file paths in your MCP config, restart Claude Desktop, and verify withuv run mcp dev latex_server.py.

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Create crafted UI components inspired by the best 21st.dev design engineers.

Bring agent evaluations, observability, and synthetic test set generation directly into your IDE for free with Galileo's new MCP server

An MCP server to help AI assistants to answer questions and generate AccelByte Extend SDK code more effectively .

MCP server for AI Diagram Maker — generate beautiful software engineering diagrams directly inside Cursor, Claude Desktop, Claude Code, or any MCP-compatible AI agent

ALAPI MCP Tools,Call hundreds of API interfaces via MCP

AI-powered SVG animation generator that transforms static files into animated SVG components using the Allyson platform

MCP server that gives AI assistants on-demand access to 1,500+ amCharts docs, ~300 code examples, and 1000+ class API references.

APIMatic MCP Server is used to validate OpenAPI specifications using APIMatic. The server processes OpenAPI files and returns validation summaries by leveraging APIMatic’s API.

One shared context layer for AI agents and humans — live API specs, DB schemas, and versioned contracts across repos so every agent and teammate works from the same source of truth.

Build and deploy full-stack Next.js apps with 98 tools for React, AWS, and MongoDB

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.