UpMath MCP Server
The UpMath MCP Server renders LaTeX equations, TikZ diagrams, and full mathematical documents to SVG/PNG/HTML via the UpMath API — no local TeX installation required.
Single Renders
render_equation— Convert any LaTeX expression to SVG or PNG, optionally saving to a filerender_tikz— Render TikZ, pgfplots, circuitikz, or tikz-3dplot diagrams to SVG or PNGget_render_url— Generate a direct UpMath image URL for embedding without an API callcheck_syntax— Validate a LaTeX snippet by attempting to render it and reporting errors
Documents & Papers
render_paper— Convert a markdown file with$$...$$math into a publication-ready HTML document (KaTeX or UpMath SVG)render_markdown_with_math— Convert a markdown string with equations into HTML with embedded SVGsscan_document_math— Inventory every equation in a markdown file, including symbol frequency and numberingvalidate_equations— Render-test all equations in a document to verify valid LaTeX
Batch & Iteration
render_batch— Render multiple equations at once, saving each to its own filerender_batch_cached— Batch render with session-level caching to skip unchanged equationsrender_equation_sheet— Combine named equations into a single HTML reference/cheat-sheet pagerender_parameter_grid— Render a LaTeX template across a range of parameter values for visual comparisonrender_diff— Display two versions of an equation side by side for easy comparison
Diagrams & Notation
list_diagram_templates— Browse built-in TikZ templates (control-system, neural-network, state-machine, bayesian-network, signal-flow, data-plot, commutative-diagram)render_diagram_template— Render a named built-in TikZ template with custom parametersbuild_notation_table— Extract mathematical symbols from a document and generate a formatted notation table
Other highlights: Supports all major LaTeX packages (TikZ, pgfplots, circuitikz, mhchem, etc.), includes automatic retries with exponential backoff, session-wide render caching, and rate limiting. Configurable via environment variables (UPMATH_URL, timeout, retries, request interval).
Provides tools to render LaTeX equations, TikZ diagrams, and full documents into high-quality images, supporting a wide range of packages including pgfplots, circuitikz, and mhchem.
Enables the processing of Markdown content containing mathematical expressions to produce HTML with embedded SVG renderings of the math.
Supports the direct generation of SVG graphics from LaTeX and TikZ source code for scalable web-based display.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@UpMath MCP Server render the Schrödinger equation as an SVG"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
UpMath MCP Server
MCP server that gives Claude Code direct access to LaTeX rendering via the UpMath API. Renders equations, TikZ diagrams, and full documents to SVG/PNG without a local TeX installation.
Tools (16)
Single render / embed
Tool | Description |
| Render a LaTeX equation to SVG or PNG (optionally save to file) |
| Render a TikZ/pgfplots/circuitikz/tikz-3dplot diagram to SVG or PNG |
| Get the UpMath image URL for a LaTeX expression (embed, no file) |
| Validate a LaTeX snippet by attempting to render it |
Documents / papers
Tool | Description |
| Render a full markdown paper ( |
| Render markdown with |
| Inventory every equation in a markdown file |
| Validate all equations in a document, reporting failures |
Batch / iteration
Tool | Description |
| Render multiple equations at once, saving each to a file |
| Batch render with caching — skips unchanged equations |
| Render named equations into one reference-sheet HTML page |
| Render a LaTeX template across a grid of parameter values |
| Render two versions of an equation side by side for comparison |
Diagrams / notation
Tool | Description |
| List the built-in TikZ diagram templates |
| Render a named TikZ template |
| Build a symbol/notation table from a document |
Related MCP server: ./Typst MCP Server
Supported Packages
Everything TeX Live supports, including:
Category | Packages |
Math | All standard LaTeX math, |
Graphics |
|
Diagrams |
|
Chemistry |
|
Formatting |
|
Setup
As a Claude Code plugin (recommended)
The repo is its own plugin marketplace. In Claude Code:
/plugin marketplace add danielsimonjr/upmath-mcp
/plugin install upmath-mcp@upmathThis loads the bundled server (no npm install needed) plus the companion upmath skill.
As a plain MCP server
git clone https://github.com/danielsimonjr/upmath-mcp.git
cd upmath-mcp
bun install
bun run buildThe server is TypeScript and builds to dist/. Bun is the development
toolchain; Node is the runtime the server ships on.
Add to ~/.claude/.mcp.json:
{
"mcpServers": {
"upmath": {
"command": "node",
"args": ["/path/to/upmath-mcp/dist/index.js"]
}
}
}Restart Claude Code. The rendering tools will be available.
Configuration
All settings are environment variables (set them in the env block of your MCP config):
Variable | Default | Purpose |
|
| Renderer base URL (point at a self-hosted instance) |
|
| Per-request timeout |
|
| Retries on 429/5xx/network errors (exponential backoff) |
|
| First backoff delay (doubles per retry) |
|
| Minimum gap between API requests (politeness throttle for the public API) |
Reliability behavior (built in, no flags needed):
Retry with backoff — 429/5xx responses and network errors are retried automatically.
Session-wide render cache — identical LaTeX+format pairs are fetched once per server session; re-running
render_paperon an edited document only re-renders changed equations.Request throttling — API calls are spaced by
UPMATH_MIN_INTERVAL_MSto respect the public service's rate limits.Size guard — expressions too large for the GET API fail fast with a clear message instead of a cryptic server error.
Tool Parameters
Common conventions: format is "svg" (default) or "png"; saveTo writes the output to a file instead of returning it inline; file paths are resolved relative to the server's working directory (absolute paths are safest).
Single render / embed
render_equation({ latex, format?, saveTo? })—latexis the raw (un-encoded) expression.render_tikz({ tikz, packages?, format?, saveTo? })—tikzincludes\begin{tikzpicture}...\end{tikzpicture};packagesis an array like["circuitikz", "pgfplots"]prepended as\usepackage{...}.get_render_url({ latex, format? })— returns thei.upmath.meURL only; no API call, no file.check_syntax({ latex })— renders to SVG and reports valid / empty / error.
Documents / papers
render_paper({ inputFile, outputFile, title?, author?, useUpmath? })— full markdown paper → HTML.useUpmath: false(default) embeds KaTeX (fast, client-side);useUpmath: truerenders every equation to server-side SVG (supports TikZ).titledefaults to the first#heading.render_markdown_with_math({ markdown, saveTo? })— markdown string (not a file) with$$...$$→ HTML with embedded SVGs.scan_document_math({ inputFile, outputReport? })— equation inventory, symbol frequency, numbering checks;outputReportsaves the full JSON.validate_equations({ inputFile, maxEquations? })— renders each equation to verify it;maxEquationscaps API calls (default 50,-1= all).
Batch / iteration
render_batch({ equations, format?, outputDir })—equationsis[{ name, latex }, ...]; each saved as<name>.<format>inoutputDir.render_batch_cached({ equations, format?, outputDir })— same, reporting which files came from the session cache.render_equation_sheet({ title?, equations, saveTo? })—equationsis[{ name, latex, description? }, ...]→ one reference-sheet HTML page.render_parameter_grid({ latexTemplate, paramName?, values, saveTo? })— substitutes each ofvaluesfor{PARAM}(or{<paramName>}) in the template and renders a comparison grid.render_diff({ before, after, label?, saveTo? })— two LaTeX versions side by side as HTML.
Diagrams / notation
list_diagram_templates()— no parameters.render_diagram_template({ template, params?, format?, saveTo? })—templateis one ofcontrol-system,neural-network,state-machine,bayesian-network,signal-flow,data-plot,commutative-diagram;paramsis an object (or JSON string) of template-specific overrides.build_notation_table({ inputFile, format?, saveTo? })—formatismarkdown(default),latex, orhtml.
Examples
Render the quadratic formula:
render_equation({ latex: "\\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}", format: "svg" })Render a circuit:
render_tikz({
tikz: "\\begin{circuitikz}\\draw (0,0) to[R, l=$R_1$] (2,0) to[C, l=$C_1$] (4,0);\\end{circuitikz}",
packages: ["circuitikz"],
format: "svg",
saveTo: "circuit.svg"
})Self-Hosting
You can run your own UpMath renderer:
docker run -t -p 8080:80 ghcr.io/parpalak/i.upmath.me:masterThen set UPMATH_URL=http://localhost:8080 in your environment.
License
MIT
Credits
i.upmath.me — the LaTeX-to-SVG API
Available Tools
16 toolsbuild_notation_tableA
Extract all mathematical notation from a markdown file and generate a formatted notation table (symbol, meaning, first appearance). Useful for creating a 'Notation' section in a paper.
Inputs: inputFile (required), format, saveTo.
check_syntaxB
Check if LaTeX syntax is valid by attempting to render it.
Inputs: latex (required).
get_render_urlA
Get the UpMath URL for a LaTeX expression (for embedding in HTML/markdown).
Inputs: latex (required), format.
list_diagram_templatesA
List all available TikZ diagram templates with descriptions.
Inputs: no named parameters.
render_batchC
Render multiple LaTeX equations at once, saving each to a file.
Inputs: equations (required), outputDir (required), format.
render_batch_cachedA
Render multiple equations with caching — skips re-rendering unchanged equations. Much faster for iterative editing. Cache persists within the MCP session.
Inputs: equations (required), outputDir (required), format.
render_diagram_templateB
Render a pre-built TikZ diagram template with custom parameters. Templates: control-system, neural-network, state-machine, bayesian-network, signal-flow, data-plot, commutative-diagram.
Inputs: template (required), params, format, saveTo.
render_diffA
Render two versions of a LaTeX equation side by side for visual comparison. Returns an HTML page with both versions.
Inputs: before (required), after (required), label, saveTo.
render_equationA
Render a LaTeX equation to SVG or PNG via UpMath. Returns SVG markup or saves to file.
Inputs: latex (required), format, saveTo.
render_equation_sheetB
Render a collection of named equations into a single reference sheet HTML page. Useful for creating equation cheat sheets or appendix summaries.
Inputs: equations (required), title, saveTo.
render_markdown_with_mathC
Render markdown containing $$...$$ LaTeX to HTML with embedded SVG equations.
Inputs: markdown (required), saveTo.
render_paperA
Render a full markdown paper with $$...$$ LaTeX to a publication-ready HTML file. Uses KaTeX for standard math (fast, client-side) and falls back to UpMath API for TikZ/special packages. Handles headings, bold, italic, lists, tables, and code blocks.
Inputs: inputFile (required), outputFile (required), title, author, +1 more.
render_parameter_gridA
Render a parameterized equation across a grid of values, producing an HTML comparison page. Useful for exploring how changing coefficients affects formulas. Use {PARAM} as placeholder in the LaTeX template.
Inputs: latexTemplate (required), values (required), paramName, saveTo.
render_tikzB
Render a TikZ diagram to SVG or PNG. Supports tikz, pgfplots, circuitikz, tikz-3dplot.
Inputs: tikz (required), packages, format, saveTo.
scan_document_mathA
Scan a markdown file for all LaTeX math. Returns: equation inventory with numbering, symbol frequency table, notation index, and cross-reference validation. Essential for maintaining consistency in scientific papers.
Inputs: inputFile (required), outputReport.
validate_equationsA
Validate all equations in a markdown file: check LaTeX syntax via UpMath, report render errors, and flag potential issues (unmatched braces, undefined commands). Slower than scan_document_math but verifies renderability.
Inputs: inputFile (required), maxEquations.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Most tools are distinct (render, scan, validate, templates), but render_tikz, render_equation, and render_batch may overlap in purpose (all render LaTeX/TikZ). However, descriptions clarify different use cases (single vs batch vs diagrams), so only minor confusion possible.
Consistent verb_noun pattern (render_, check_, get_, list_, scan_, build_, validate_). Minor deviations like render_batch_cached and render_diff break the pattern slightly but remain readable.
16 tools is on the higher end but appropriate for a comprehensive math/typesetting server covering rendering, validation, scanning, templates, and document integration. Each tool serves a distinct purpose without bloat.
The surface covers rendering (single, batch, templates, parameter grids), validation (syntax, full document), document analysis (scan, notation, equation sheets), and integration (URLs, markdown rendering). No obvious dead ends or missing critical operations.
Maintenance
Related MCP Connectors
Compile LaTeX to PDF without installing TeX Live. No API key needed to start.
Write, compile and share Typst documents (papers, slides, drawings) from any AI agent.
Render LaTeX math as pure Unicode text art for terminals, code comments, and emails.
Persistent AI LaTeX workspace: edit and compile multi-file projects, export publication-ready PDFs.
Related MCP Servers
- FlicenseNot gradedqualityAmaintenanceEnables AI models to work with a markup-based typesetting system by converting LaTeX snippets, validating syntax, browsing the documentation, and rendering code as PNG images. This lets assistants produce and verify typeset documents and illustrations before sharing them with users.-
- FlicenseNot gradedqualityAmaintenanceEnables AI models to convert LaTeX snippets to Typst, browse Typst documentation, validate Typst syntax, and render Typst code as images.-
- FlicenseNot gradedqualityAmaintenanceEnables AI models to work with the Typst typesetting system by converting LaTeX snippets to Typst, validating Typst syntax, and rendering Typst code as PNG images. It also lets models browse and retrieve chapters of the Typst documentation to ground their output.-
- FlicenseNot gradedqualityAmaintenanceEnables AI models to convert LaTeX to Typst, validate Typst syntax, access Typst documentation, and render Typst code as images.-