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 "Install 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 Serverrender 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: LaTeX PDF 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
npm installAdd to ~/.claude/.mcp.json:
{
"mcpServers": {
"upmath": {
"command": "node",
"args": ["/path/to/upmath-mcp/server.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
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/danielsimonjr/upmath-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server