DT

devroopsaha744/texmcp

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

11 stars 4 forks Качество 68 Тренд 8MIT

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 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. - Render raw LaTeX to .tex and (optionally) .pdf using pdflatex - Render Jinja2 templates and compile to PDF - Designed to run as an MCP server for Claude Desktop and other MCP-capable clients Tools exposed by this MCP server - Total tools: 5 - render_latex_document — write LaTeX and optionally compile to PDF - render_template_document — render a Jinja2 template and optionally compile - list_templates — list available templates - list_artifacts — list files produced in src/artifacts/ - get_template — return the raw contents of a template file so clients can inspect it before rendering Prerequisites - Python 3.

README

Показан фрагмент оригинального README. Открыть оригинал.

FastMCP LaTeX Server (tex-mcp)

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.

Demo

Quick features

  • Render raw LaTeX to .tex and (optionally) .pdf using pdflatex
  • Render Jinja2 templates and compile to PDF
  • Designed to run as an MCP server for Claude Desktop and other MCP-capable clients

Tools exposed by this MCP server

  • Total tools: 5
    • render_latex_document — write LaTeX and optionally compile to PDF
    • render_template_document — render a Jinja2 template and optionally compile
    • list_templates — list available templates
    • list_artifacts — list files produced in src/artifacts/
    • get_template — return the raw contents of a template file so clients can inspect it before rendering

Getting started (local development)

Prerequisites

  • Python 3.10+ (the project uses modern pydantic/fastapi stack)
  • LaTeX toolchain (pdflatex) for PDF compilation (optional; if missing, server returns .tex only)
  1. Create a project virtualenv and install deps

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
  1. Run the server directly (stdio mode - used by Claude Desktop)
. .\\.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.

  1. Artifacts

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

Открыть полный README на GitHub

Установка

docker run -p 8000:8000 --rm --name fastmcp-latex fastmcp-latex:latest
Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "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" } } }