LaTeX PDF

Converts LaTeX source to PDFs, stores outputs locally, and serves downloadable links via MCP.
  • typescript

1

GitHub Stars

typescript

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": {
    "tobioffice-latexpdf-mcp": {
      "command": "latexpdf-mcp",
      "args": [],
      "env": {
        "LATEXPDF_OUTPUT_DIR": "/path/to/your/pdf/directory"
      }
    }
  }
}

This MCP server converts LaTeX source into professionally formatted PDFs and serves them for easy download within AI-assisted workflows. It supports custom output locations, robust error reporting, and seamless integration with your MCP-enabled clients.

How to use

You will use the server through an MCP-compatible client to convert LaTeX source into a PDF file. The main action is to create a PDF by providing a file name (ending with .pdf) and the LaTeX source. The server returns a downloadable link to the generated PDF and stores the file in your configured output directory.

Core operation: create_pdf with the following inputs. Use your MCP client to call this function and pass the required parameters.

  • file_name: Name of the output PDF file (must end with .pdf)
  • latex_source: LaTeX source code to convert into PDF Here is a complete minimal LaTeX document you can use to test the conversion.
\documentclass{article}
\usepackage[utf8]{inputenc}
\title{Sample Document}
\author{Your Name}
\date{\today}
\begin{document}
\maketitle
\section{Introduction}
This is a sample LaTeX document generated via MCP.
\end{document}

How to install

Follow these steps to set up the MCP server locally and ensure you can generate PDFs from LaTeX.

Prerequisites to install on your machine.

  • Node.js 18 or newer
  • A complete LaTeX distribution (MiKTeX or TeX Live on Windows, MacTeX on macOS, TeX Live on Linux)
  • latexmk (usually included with LaTeX distributions)

Install the MCP server globally using the recommended method.

npm install -g latexpdf-mcp

If you prefer building from source, clone the project, install dependencies, and build.

# Clone the repository
git clone https://github.com/ihor-sokoliuk/latexpdf-mcp.git
cd latexpdf-mcp

# Install dependencies
pnpm install

# Build the project
pnpm run build

Additional configuration and notes

Configure your MCP client to run the server locally. The following setup uses a local command to run the server and directs output PDFs to a specified directory.

{
  "mcpServers": {
    "latexpdf-mcp": {
      "command": "latexpdf-mcp",
      "env": {
        "LATEXPDF_OUTPUT_DIR": "/path/to/your/pdf/directory"
      }
    }
  }
}

Security and troubleshooting

Ensure the LaTeX distribution and latexmk are accessible in your system PATH. If you encounter permission issues, verify write access to your output directory. For compilation errors, review your LaTeX source and required packages.

If you run into problems starting the local server, check that the LATEXPDF_OUTPUT_DIR environment variable is set correctly and that the command latexpdf-mcp is available in your shell.

Examples and tips

You can generate PDFs for multiple documents by reusing the create_pdf tool with different file_name values and corresponding LaTeX sources. Each call creates a separate PDF in your configured output directory, and the server provides a downloadable link for each result.

Notes on local hosting and access

PDFs are stored in the directory you configure via LATEXPDF_OUTPUT_DIR. Access them through a local HTTP server if you need browseable links, or integrate the provided download links directly in your workflow.

Available tools

create_pdf

Converts LaTeX source code into a PDF document by providing a target file name and the LaTeX source.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
LaTeX PDF MCP Server - tobioffice/latexpdf-mcp | VeilStrat