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
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)
- Clone the repository:
git clone https://github.com/devroopsaha744/TexMCP.git
cd TexMCP
- 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
- Install dependencies:
pip install -r requirements.txt
- 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
-
Optional — run HTTP server instead of stdio (edit run_server.py to switch transport to http) and run with uvicorn if desired.
-
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
Gitingest
mcp server for gitingest
aws-cost-explorer
MCP server for understanding AWS spend
cfbd
An MCP server enabling CFBD API queries within Claude Desktop.
mcp-spotify-player
MCP server to manage Spotify from MCP clients
mcp-privilege-cloud
A production-ready Model Context Protocol (MCP) server for CyberArk Privilege Cloud integration. Enables AI assistants and MCP clients to securely interact with privileged account management, safe operations, and platform configurations through 8 comprehensive tools.
fastmcp-builder
A comprehensive Claude Code skill for building production-ready MCP servers using FastMCP. Includes reference guides, runnable examples, and a complete implementation with OAuth, testing, and best practices.