A small FastMCP-based Microservice that renders LaTeX to PDF. The server exposes MCP tools to render raw LaTeX or templates and produces artifacts (a .tex file and .pdf) under src/artifacts/. This repository is prepared to run locally and to be loaded by Claude Desktop (via the Model Context Protocol). The default entrypoint is runserver.py. - Render raw LaTeX to .tex and (optionally) .pdf using p
Add this skill
npx mdskills install devroopsaha744/texmcpWell-documented MCP server with 5 useful LaTeX tools, comprehensive setup, and 15 templates
A small FastMCP-based Microservice that renders LaTeX to PDF. The server exposes MCP tools
to render raw LaTeX or templates and produces artifacts (a .tex file and .pdf)
under src/artifacts/.
This repository is prepared to run locally and to be loaded by Claude Desktop (via the
Model Context Protocol). The default entrypoint is run_server.py.

.tex and (optionally) .pdf using pdflatexTools exposed by this MCP server
src/artifacts/Prerequisites
Clone from GitHub
If you want to work from the canonical repository on GitHub, clone it first:
git clone https://github.com/devroopsaha744/TexMCP.git
cd TexMCP
After cloning you can follow the venv creation and install steps below.
python -m venv .venv
. .\\.venv\\Scripts\\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements.txt
. .\\.venv\\Scripts\\Activate.ps1
python .\\run_server.py
# or run the venv python explicitly if you don't activate
.# .venv\\Scripts\\python.exe run_server.py
If run in stdio mode the server will speak MCP over stdin/stdout (this is what Claude Desktop
expects when it spawns the process). If you prefer HTTP, edit run_server.py and switch the
transport to http (see commented code) and run via uv run or uvicorn.
Rendered outputs are placed in src/artifacts/. For each job you should see a .tex file and
— if pdflatex is available — a matching .pdf.
Templates
src/mcp_server/templates/. There are 15 templates included (for example sample_invoice.tex.j2, sample_letter.tex.j2, sample_resume.tex.j2). Use list_templates to get the full list programmatically. The templates are deliberately simple and ready to customize — add your own .tex.j2 files to that folder to expand the catalog.Included templates (in src/mcp_server/templates/)
default.tex.j2 (base example template)sample_invoice.tex.j2sample_invoice2.tex.j2sample_letter.tex.j2sample_report.tex.j2sample_resume.tex.j2sample_presentation.tex.j2sample_certificate.tex.j2sample_coverletter.tex.j2sample_poster.tex.j2sample_thesis.tex.j2sample_receipt.tex.j2sample_recipe.tex.j2sample_poem.tex.j2sample_cv.tex.j2Recommended: use the fastmcp CLI installer which will set things up to run from the project directory and use the project venv.
From your project root (with the venv already created and deps installed):
fastmcp install claude-desktop run_server.py --project C:\\Users\\DEVROOP\\Desktop\\tex-mcp
This ensures uv runs inside the project directory and uses the project's environment. After the installer runs, fully quit and restart Claude Desktop.
Manual Claude Desktop config
If you edit Claude's config yourself (Windows: %APPDATA%\\Claude\\claude_desktop_config.json), add a single server entry that points to the project Python executable. Example (replace paths if needed):
{
"mcpServers": {
"FastMCP-LaTeX-Server": {
"command": "C:\\\\Users\\\\DEVROOP\\\\Desktop\\\\tex-mcp\\\\venv\\\\Scripts\\\\python.exe",
"args": [
"C:\\\\Users\\\\DEVROOP\\\\Desktop\\\\tex-mcp\\\\run_server.py"
],
"cwd": "C:\\\\Users\\\\DEVROOP\\\\Desktop\\\\tex-mcp",
"transport": "stdio"
}
}
}
Notes
activate script — it is a shell helper and not an executable. Point Claude to the python.exe inside the venv (or to uv.exe inside the venv if you installed uv).This project includes a Dockerfile so you can run the MCP server in a container.
Build (no LaTeX):
docker build -t fastmcp-latex:latest .
Build with LaTeX (larger image):
docker build --build-arg INSTALL_TEX=1 -t fastmcp-latex:with-tex .
Run (HTTP mode exposed on port 8000):
docker run -p 8000:8000 --rm --name fastmcp-latex fastmcp-latex:latest
Notes
MCP_TRANSPORT=http by default. Inside the container the server binds to 0.0.0.0:8000.stdio mode in a container you can override the env var:docker run -e MCP_TRANSPORT=stdio ...
Artifact persistence
src/artifacts directory:docker run -p 8000:8000 -v $(pwd)/src/artifacts:/app/src/artifacts fastmcp-latex:latest
You can Use a Model Context Protocol / FastMCP client library (Like OpenAI Responses API) in your agent code to call tools programmatically. For example, in Python you can use the mcp or fastmcp client (see library docs) to connect to http://localhost:8000/mcp and call render_latex_document with arguments.
Security notes
Thanks for wanting to contribute! See CONTRIBUTING.md for the development workflow, commit style, and how to open issues and pull requests.
This project is released under the MIT License — see LICENSE.
Install via CLI
npx mdskills install devroopsaha744/texmcpFastMCP LaTeX Server (tex-mcp) is a free, open-source AI agent skill. A small FastMCP-based Microservice that renders LaTeX to PDF. The server exposes MCP tools to render raw LaTeX or templates and produces artifacts (a .tex file and .pdf) under src/artifacts/. This repository is prepared to run locally and to be loaded by Claude Desktop (via the Model Context Protocol). The default entrypoint is runserver.py. - Render raw LaTeX to .tex and (optionally) .pdf using p
Install FastMCP LaTeX Server (tex-mcp) with a single command:
npx mdskills install devroopsaha744/texmcpThis downloads the skill files into your project and your AI agent picks them up automatically.
FastMCP LaTeX Server (tex-mcp) works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Codex, Gemini Cli, Amp, Roo Code, Goose, Opencode, Trae, Qodo, Command Code. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.