image2svg-mcp
The image2svg-mcp server converts raster images (PNG, JPG, WEBP, TIFF, etc.) into scalable SVG vector graphics with extensive control over the vectorization process.
Input formats: Accepts images as base64-encoded data (with or without
data:image/...;base64,prefix) or viahttp:///https://URLs (5 MB limit). Localfile://URLs supported with--allow-local-files-path.Vectorization parameters:
colormode: Full color or binary (black & white) outputmode: Tracing mode — smooth curves (spline), straight edges (polygon), or pixel-perfect (none)filter_speckle: Remove small noise artifactscolor_precision: Control number of colors for simpler SVGslayer_difference: Threshold for merging similar color layerscorner_threshold/splice_threshold: Angle thresholds for corner and spline detectionlength_threshold: Minimum path segment lengthpath_precision: Decimal precision for SVG coordinateshierarchical: Layer arrangement —stackedorcutoutmax_iterations: Balance curve-fitting accuracy vs. speed
Deployable via MCP (uvx, Docker) or as an HTTP server.
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., "@image2svg-mcpConvert this image to SVG: https://example.com/logo.png"
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.
image2svg-mcp
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 automaticallyStreams URL downloads with a 5 MB size limit
Optional
file://URL support for local images (opt-in via--allow-local-files-path)
Related MCP server: WebP Batch Converter
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-mcpwith access to local files:
claude mcp add image2svg --scope user -- uvx image2svg-mcp --allow-local-files-path /home/user/imagesDocker
Run as an HTTP server:
docker run -p 8000:8000 ghcr.io/botmonster/image2svg-mcpWith 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/mcpThis 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
Parameter | Type | Default | Range | Description |
| string | - | - | Base64-encoded image data. Provide this OR |
| string | - | - | URL to fetch the image from ( |
| string |
|
| Full color or black/white line art |
| string |
|
| Tracing mode: smooth curves, straight edges, or pixel-perfect |
| int |
| 0-128 | Remove speckles of N pixels or fewer |
| int |
| 1-12 | Color quantization bits. Lower = fewer colors, simpler SVG |
| int |
| 0-128 | Color difference for merging layers |
| int |
| 0-180 | Angle threshold for corner detection (degrees) |
| float |
| 3.5-10.0 | Minimum path segment length |
| int |
| 0-180 | Angle threshold for splicing splines |
| int |
| 1-12 | Decimal precision for SVG coordinates |
| string |
|
| Layer arrangement mode |
| int |
| 1-100 | Max curve fitting iterations |
Development
Installation
git clone https://github.com/botmonster/image2svg-mcp.git
cd image2svg-mcp
uv syncRun tests
uv run pytest tests/ -vRun the MCP Inspector
uv run fastmcp dev inspector src/image2svg_mcp/server.py:mcpLicense
Apache 2.0 - see LICENSE
Available Tools
1 toolconvert_image_to_svgARead-onlyIdempotent
Convert a raster image (PNG, JPG, or WEBP) to SVG vector format.
Accepts either base64-encoded image data or a URL. Returns the SVG content as a string. Adjust tracing parameters to control the fidelity and complexity of the output.
| Name | Required | Description | Default |
|---|---|---|---|
| image_base64 | No | Base64-encoded image data (PNG, JPG, or WEBP). Provide this OR image_url, not both. | |
| image_url | No | URL to fetch the image from (PNG, JPG, or WEBP). Provide this OR image_base64, not both. | |
| colormode | No | Color mode: 'color' for full color, 'binary' for black/white line art | color |
| mode | No | Tracing mode: 'spline' (smooth curves), 'polygon' (straight edges), or 'none' (pixel-perfect) | spline |
| filter_speckle | No | Remove speckles of this many pixels or fewer. Higher = cleaner but loses small details. Default 4. | |
| color_precision | No | Number of significant bits for color quantization. Lower = fewer colors, simpler SVG. Default 6. | |
| layer_difference | No | Color difference threshold for merging layers. Higher = fewer layers, simpler SVG. Default 16. | |
| corner_threshold | No | Angle threshold in degrees for detecting corners. Default 60. | |
| length_threshold | No | Minimum path segment length. Default 4.0. | |
| splice_threshold | No | Angle threshold for splicing splines. Default 45. | |
| path_precision | No | Decimal precision for SVG path coordinates. Lower = smaller file size. Default 8. | |
| hierarchical | No | Layer arrangement: 'stacked' (overlapping) or 'cutout' (non-overlapping) | stacked |
| max_iterations | No | Maximum curve fitting iterations. Higher = more accurate but slower. Default 10. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description adds context on what the tool does (converts images, returns SVG string) and mentions adjustable parameters. Annotations already indicate readOnlyHint=true, destructiveHint=false, idempotentHint=true. The description does not contradict annotations and provides additional but not extensive behavioral details.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise (two paragraphs) and front-loaded with the essential purpose. Each sentence is purposeful, with no wasted words. The structure effectively communicates key information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Considering the tool's complexity (13 parameters, all well-documented in schema, and an output schema exists), the description covers the core conversion process and parameter adjustability. It doesn't detail output format specifics, but the output schema addresses that. The description is sufficiently complete for agent usage.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, with each parameter described in the schema. The description mentions 'adjust tracing parameters to control fidelity and complexity' but does not elaborate on individual parameters. Given high coverage, the description adds minimal extra meaning, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool converts raster images (PNG, JPG, WEBP) to SVG vector format, specifies input methods (base64 or URL), and notes adjustable tracing parameters. It is specific and distinguishes the tool's purpose from any siblings (none listed).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context on when to use: for converting raster images to SVG, with inputs via base64 or URL. While it doesn't explicitly exclude alternatives, no sibling tools exist, so the guidance is sufficient.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v1.0.0- First observed
convert_image_to_svg
TDQS
Scored across 1 tool
With only one tool, there is no risk of confusion or overlap. The tool's purpose is clearly defined and distinct.
The single tool name follows a consistent verb_noun pattern (convert_image_to_svg). No inconsistency is possible with only one tool.
The server is scoped to a single conversion task, so one tool is reasonable. However, it feels slightly minimal; additional tools for parameter adjustment or batch processing could be beneficial.
The tool covers the core conversion operation but lacks auxiliary tools for e.g., managing tracing parameters or validating outputs. This is a minor gap given the focused domain.
Maintenance
Related MCP Connectors
MCP server for Midjourney AI image generation and editing
Convert images to PNG, JPEG, WebP, or AVIF through one public remote MCP tool.
MCP server for Qwen Image 3 AI image generation
MCP server for Wan AI video generation
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides tools for converting SVG code to high-quality PNG and JPG images with detailed customization options.8 npm3MIT
- AlicenseAqualityDmaintenanceAn MCP server that enables batch conversion of images to WebP format with configurable options like quality settings, lossless mode, and multi-threading support.16MIT
- AlicenseAqualityCmaintenanceMCP server for converting SVG files to Android Vector Drawable XML, enabling seamless integration with Figma MCP for Android development.112 npm11MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for converting images to WebP and AVIF formats with batch processing and parallel execution.MIT