LaTeX

Provides creation, editing, reading, and validation of LaTeX documents via MCP, with templates and package management.
  • python

4

GitHub Stars

python

Language

5 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "robertodure-mcp-latex-server": {
      "command": "python",
      "args": [
        "la tex_server.py"
      ],
      "env": {
        "LATEX_BASE_PATH": "C:\\path\\to\\your\\latex\\files",
        "LATEX_LOG_LEVEL": "INFO"
      }
    }
  }
}

You can use the MCP LaTeX Server to create, edit, read, and validate LaTeX documents from your AI assistant or editor. It centralizes LaTeX file management and ensures you can generate professional documents with predefined templates, package handling, and syntax checks.

How to use

You connect your MCP client to the LaTeX server to perform actions such as creating new LaTeX documents, editing existing files, reading content, listing files, and validating syntax. Start by configuring either Claude Desktop or your editor to communicate with the local MCP server. Use the available tools to perform practical tasks like generating an article with a specified document class, inserting sections, or applying edits across your LaTeX projects. You can also enumerate documents in a directory, inspect their content, and verify that the LaTeX code is syntactically sound before compiling.

How to install

# Prerequisites
- Python 3.8+
- LaTeX distribution installed (see steps below)
- VS Code (optional, for editor integration)
- Claude Desktop or Claude in VS Code (optional, for MCP integration)

# Quick setup
# 1) Clone the project
git clone https://github.com/RobertoDure/mcp-latex-server
cd mcp-latex-server

# 2) Install dependencies (quick setup)
python setup.py

# 3) Verify installation
python latex_server.py --help

Additional sections

Configuration and integration details are provided below to help you run the server smoothly with MCP clients. You can set environment variables to customize base paths and logging. A JSON configuration file allows you to lock down base directories, allowed file types, and default document settings. You can start the server using a Python command, or through the UV-based runtime for faster startup.

Configuration

Available configuration options help you tailor the server to your workspace. You can set the LaTeX base path, enable or disable validation, and choose a default document class and common packages. The environment variables and a sample config.json provide concrete, reproducible defaults.

Troubleshooting

If the server won’t start, verify your Python version is 3.8 or newer and that dependencies are installed. Run with debug logging to identify initialization issues. If your client cannot connect, confirm the MCP server configuration paths, ensure Python is on your PATH, and restart the client after changes. For permission or LaTeX issues, check file permissions and ensure your LaTeX distribution is correctly installed and up to date.

Notes

The server supports a built-in template system, automatic package handling, and basic LaTeX syntax validation. It is designed to coordinate with AI assistants to produce structured LaTeX documents such as articles, reports, books, letters, beamer presentations, and minimal documents.

Available tools

create_latex_file

Creates a new LaTeX document with specified parameters such as file path, document type, title, author, date, packages, geometry, and content.

edit_latex_file

Edits an existing LaTeX file using operations like replace, insert_before, insert_after, append, or prepend.

read_latex_file

Reads and returns the contents of a LaTeX file.

list_latex_files

Lists all LaTeX files in a directory, with options to search recursively.

validate_latex

Performs basic LaTeX syntax validation to detect common errors.

get_latex_structure

Extracts the document structure including sections and subsections.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
LaTeX MCP Server - robertodure/mcp-latex-server | VeilStrat