mcpField
I
Image to SVG

Image to SVG

Local
botmonster.comMedia & Design11Updated 16w ago

About Image to SVG

An MCP server that turns raster images into scalable SVG graphics. It supports image data or URLs and exposes parameters for controlling tracing, color handling, and output detail.

Key features

  1. 01Convert raster images to SVG
  2. 02Accept base64 data or image URLs
  3. 03Support common raster formats
  4. 04Adjust color and tracing settings
  5. 05Optionally access local files

Use cases

  1. 01Vectorize a logo for scalable use
  2. 02Convert a URL-hosted image into SVG
  3. 03Create simplified artwork by reducing color precision

MCP support

Exposes an image-to-SVG conversion tool to MCP clients, with inputs from base64 image data or URLs and configurable vectorization parameters.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"botmonster-image2svg": {
"command": "uvx",
"args": [
"image2svg-mcp"
]
}
}
}
Run commanduvx image2svg-mcp

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
pypiimage2svg-mcp1.0.1

Tools

1

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
modestringNoTracing mode: 'spline' (smooth curves), 'polygon' (straight edges), or 'none' (pixel-perfect)
colormodestringNoColor mode: 'color' for full color, 'binary' for black/white line art
image_urlanyNoURL to fetch the image from (PNG, JPG, or WEBP). Provide this OR image_base64, not both.
hierarchicalstringNoLayer arrangement: 'stacked' (overlapping) or 'cutout' (non-overlapping)
image_base64anyNoBase64-encoded image data (PNG, JPG, or WEBP). Provide this OR image_url, not both.
filter_speckleintegerNoRemove speckles of this many pixels or fewer. Higher = cleaner but loses small details. Default 4.
max_iterationsintegerNoMaximum curve fitting iterations. Higher = more accurate but slower. Default 10.
path_precisionintegerNoDecimal precision for SVG path coordinates. Lower = smaller file size. Default 8.
color_precisionintegerNoNumber of significant bits for color quantization. Lower = fewer colors, simpler SVG. Default 6.
corner_thresholdintegerNoAngle threshold in degrees for detecting corners. Default 60.
layer_differenceintegerNoColor difference threshold for merging layers. Higher = fewer layers, simpler SVG. Default 16.
length_thresholdnumberNoMinimum path segment length. Default 4.0.
splice_thresholdintegerNoAngle threshold for splicing splines. Default 45.

Details

From the project README

image2svg-mcp

PyPI Docker License Tests

An MCP server that converts raster images (PNG, JPG, WEBP) to scalable SVG vector graphics.

Features

  • Accepts images as base64-encoded data or URL
  • Supports PNG, JPG, JPEG, WEBP, TIFF, and other common raster formats
  • Full control over vectorization parameters (color precision, speckle filtering, tracing mode, etc.)
  • Handles data:image/...;base64, URI prefixes automatically
  • Streams URL downloads with a 5 MB size limit
  • Optional file:// URL support for local images (opt-in via --allow-local-files-path)

Usage

To see it in action check converting image to svg online.

Claude Code & Claude Desktop

Add to your settings.json:

{
  "mcpServers": {
    "image2svg": {
      "command": "uvx",
      "args": ["image2svg-mcp"]
    }
  }
}

for Claude Code add using command line:

claude mcp add image2svg --scope user -- uvx image2svg-mcp

with access to local files:

claude mcp add image2svg --scope user -- uvx image2svg-mcp --allow-local-files-path /home/user/images
Docker

Run as an HTTP server:

docker run -p 8000:8000 ghcr.io/botmonster/image2svg-mcp

With local file access:

docker run -p 8000:8000 -v /home/user/images:/images ghcr.io/botmonster/image2svg-mcp --allow-local-files-path /images
claude mcp add image2svg --transport http --scope user http://localhost:8000/mcp

This enables prompts like:

Convert this local file to SVG: file://logo.png

Only files inside the specified directory (and its subdirectories) are accessible. Paths are normalized to prevent directory traversal. Without this flag, file:// URLs are rejected.

Example Prompts

Here are some examples of what you can tell an LLM to do with this tool:

1. Simple image-to-SVG conversion

Generate an image of a sunset over mountains, then convert it to SVG.

The LLM will generate a raster image and then use the convert_image_to_svg tool with default settings to produce a clean vector version.

2. Fine-tuned conversion with specific parameters

Create a logo with a blue circle and a white star inside it. Now convert it to SVG using binary colormode for crisp edges and set filter_speckle to 10 to remove noise.

This uses colormode: "binary" for black/white line art style output, which works great for logos and icons. The higher filter_speckle value removes small artifacts.

3. Convert from URL with minimalist style

Convert this image to a simplified SVG with low color precision for a minimalist poster look: https://example.com/photo.png

Using color_precision: 3 reduces the number of colors dramatically, producing an artistic posterized vector effect. Great for stylized illustrations.

4. Convert a base64 image directly

Convert this base64 image to SVG: iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAO0lEQVR4nGP8z8Dwn4EIwESMIqwKGRn+MzBisYQJXRE2NopCbKYgi5Huxv8MjBiSyGJMuCTQNTJSPRwBCjYOD5JU5rIAAAAASUVORK5CYII=

This is a 10x10 red square with a blue circle in the middle. Useful for testing the tool with inline image data — no URL needed.

Tool Parameters

ParameterTypeDefaultRangeDescription
image_base64string--Base64-encoded image data. Provide this OR image_url.
image_urlstring--URL to fetch the image from (http://, https://, or file:// when enabled). Provide this OR image_base64.
colormodestring"color"color, binaryFull color or black/white line art
modestring"spline"spline, polygon, noneTracing mode: smooth curves, straight edges, or pixel-perfect
filter_speckleint40-128Remove speckles of N pixels or fewer
color_precisionint61-12Color quantization bits. Lower = fewer colors, simpler SVG
layer_differenceint160-128Color difference for merging layers
corner_thresholdint600-180Angle threshold for corner detection (degrees)
length_thresholdfloat4.03.5-10.0Minimum path segment length
splice_thresholdint450-180Angle threshold for splicing splines
path_precisionint81-12Decimal precision for SVG coordinates
hierarchicalstring"stacked"stacked, cutoutLayer arrangement mode
max_iterationsint101-100Max curve fitting iterations

Development

Installation
git clone https://github.com/botmonster/image2svg-mcp.git
cd image2svg-mcp
uv sync
Run tests
uv run pytest tests/ -v
Run the MCP Inspector
uv run fastmcp dev inspector src/image2svg_mcp/server.py:mcp

License

Apache 2.0 - see LICENSE

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.