Math Svg Mcp

io.github.wspringerPublished by GitHub account wspringerv1.1.2Updated Oct 24, 2026

Convert LaTeX math expressions to crisp, scalable SVG images

VerifiedSTDIODesktop onlyDeveloper ToolsMedia & Design

Overview

AI-generated overview

Converts LaTeX math expressions into scalable SVG images, either returned inline or saved to a file.

What you can do
This local MCP server exposes two tools for turning LaTeX math into SVG. The latex_to_svg tool renders an expression and returns the SVG content directly, while latex_to_svg_file renders it and writes the result to a path you specify. Both accept options for output unit, display versus inline mode, font size, x-height ratio, and a choice of ten math fonts, with the default Latin Modern font bundled.
When to use it
Useful when an assistant needs to produce equation images for documents, slides, or web pages, or when you want math rendered as vector graphics rather than plain text. It fits workflows where LaTeX is already the source format and the output must stay crisp at any size.
Requirements
Runs locally over stdio as an npm package (math-svg-mcp) and needs Node.js 18 or later. No accounts, API keys, or environment variables are declared. Non-default math fonts are downloaded on first use and cached in the user's cache directory, so network access is needed for those.
Before you install
The file-writing tool saves SVG output to a path you provide, so point it only at locations you intend to write to. Non-default fonts are fetched from the network on first use and cached locally. No credentials or payments are involved.

Installation

In SourceWeft

  1. Open Math Svg Mcp in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

math-svg-mcp

An MCP server that converts LaTeX math expressions to SVG.

Once configured, Claude (or your favorite AI assistant) is able to convert LaTeX math expressions to SVG. So you could, for instance, ask:

Give me the Laplace transform formula as SVG

The assistant will generate the LaTeX:

latex
\mathcal{L}\{f(t)\} = \int_0^\infty f(t) e^{-st} \, dt = F(s)

and use the tool to render it:

[Laplace transform]

[Works great with Sidekick for InDesign]

Quick Install (Claude Desktop)

Download and open the .mcpb file from the latest release to automatically configure Claude Desktop.

Or use this direct link: math-svg-mcp.mcpb

Manual Configuration

Claude Desktop

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

json
{  "mcpServers": {    "math-svg": {      "command": "npx",      "args": ["-y", "math-svg-mcp"]    }  }}

Claude Code

Add to your Claude Code settings (.claude/settings.json or global settings):

json
{  "mcpServers": {    "math-svg": {      "command": "npx",      "args": ["-y", "math-svg-mcp"]    }  }}

Or run directly:

bash
claude mcp add math-svg -- npx -y math-svg-mcp

Other MCP Clients

Any MCP-compatible client can use this server with the same configuration pattern:

json
{  "command": "npx",  "args": ["-y", "math-svg-mcp"]}

Global Installation (Optional)

For faster startup, install globally:

bash
npm install -g math-svg-mcp

Then configure your client to use:

json
{  "command": "math-svg-mcp"}

Tools

latex_to_svg

Converts a LaTeX expression to SVG and returns the content directly.

ParameterRequiredDefaultDescription
latexYes—LaTeX math expression
unitYes—Output unit: pt, px, mm, or ex
displayNotrueDisplay mode (block) vs inline
fontSizeNo16Font size in the specified unit
xHeightRatioNo0.5Ratio of x-height to font size
fontNomodernMath font (see Available Fonts)

Example: E = mc^2

latex_to_svg_file

Converts a LaTeX expression to SVG and saves to a file.

ParameterRequiredDefaultDescription
latexYes—LaTeX math expression
outputPathYes—File path for the SVG
unitYes—Output unit: pt, px, mm, or ex
displayNotrueDisplay mode (block) vs inline
fontSizeNo16Font size in the specified unit
xHeightRatioNo0.5Ratio of x-height to font size
fontNomodernMath font (see Available Fonts)

Example: \int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2} → /tmp/gaussian.svg

Available Fonts

The font parameter lets you choose from 10 math fonts. The default modern font (Latin Modern) is bundled; others are automatically downloaded on first use and cached in ~/.cache/math-svg-mcp/fonts/.

FontDescription
modernLatin Modern (default, bundled)
stix2STIX Two Math
newcmNew Computer Modern
firaFira Math
bonumTeX Gyre Bonum
pagellaTeX Gyre Pagella
scholaTeX Gyre Schola
termesTeX Gyre Termes
dejavuDejaVu
asanaAsana Math

Requirements

  • Node.js 18 or later

Development

bash
npm installnpm run buildnpm test

License

MIT

Source: README.md at commit 027f83a

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v1.1.2LatestSep 16, 2026

Score

40% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

    Declare a license in the repository or the registry entry.