Get the FREE Ultimate OpenClaw Setup Guide →

TexMCP

A small FastMCP-based Microservice that renders LaTeX to PDF. The server exposes MCP tools to render raw LaTeX or templates and produces artifacts

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio devroopsaha744-texmcp python run_server.py \
  --env MCP_TRANSPORT="stdio (default). Set to http to run in HTTP mode."

How to use

TexMCP is a FastMCP-based LaTeX rendering server. It exposes five MCP tools to clients: render_latex_document writes LaTeX code to a .tex file and can optionally compile it to PDF; render_template_document renders a Jinja2 template into a .tex file and can optionally compile to PDF; list_templates lists available templates from src/mcp_server/templates; list_artifacts lists the generated files in src/artifacts; and get_template returns the raw contents of a template file for inspection. By default the server communicates over stdio suitable for Claude Desktop, but you can switch to HTTP transport by adjusting the run_server.py configuration and using uvicorn or similar. Clients connect to the MCP endpoint and invoke these tools with structured arguments to produce and retrieve LaTeX artifacts.

How to install

Prerequisites:

  • Python 3.10+
  • LaTeX toolchain (pdflatex) if you want PDF output
  • Git (optional, for cloning)
  1. Clone the repository:
git clone https://github.com/devroopsaha744/TexMCP.git
cd TexMCP
  1. Create and activate a virtual environment:
# Windows
python -m venv .venv
.\.venv\Scripts\Activate.ps1

# macOS/Linux
python3 -m venv .venv
source .venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the server (stdio mode by default):
# Windows
.\.venv\Scripts\Activate.ps1
python .\run_server.py

# If you prefer to run explicitly with the venv Python
.\.venv\Scripts\python.exe run_server.py
  1. Optional — run HTTP server instead of stdio (edit run_server.py to switch transport to http) and run with uvicorn if desired.

  2. Verify artifacts directory:

ls -la src/artifacts

Additional notes

Notes and tips:

  • Rendered outputs appear in src/artifacts/. Each job yields a .tex file and, if pdflatex is available, a corresponding .pdf.
  • Templates reside in src/mcp_server/templates/. Use list_templates to enumerate them programmatically or inspect the files directly.
  • If you plan to expose the HTTP endpoint, ensure proper security (TLS, firewall, or authentication) since LaTeX rendering can be resource-intensive and may pose risks when running arbitrary templates.
  • For Claude Desktop integration, you can use the recommended fastmcp installer to automate environment alignment, or configure Claude Desktop to point at the local Python executable and run_server.py as described.
  • When running via Docker, MCP_TRANSPORT can be set to stdio or http, and you can persist artifacts by mounting src/artifacts as a volume.

Related MCP Servers

Sponsor this space

Reach thousands of developers