Image to SVG

io.github.botmonster由 GitHub 账号 botmonster 发布v1.0.1更新于 Oct 24, 2026

MCP server that converts raster images (PNG/JPG/WEBP) to SVG vector format

已验证STDIO仅桌面开发者工具媒体与设计

概览

AI 生成的概览

将 PNG、JPG、WEBP 等位图图像转换为可缩放的 SVG 矢量图形,并可调整描摹参数。

可以做什么
提供 convert_image_to_svg 工具,接收 base64 数据或 URL 形式的图像,返回 SVG 矢量版本。支持 PNG、JPG、JPEG、WEBP、TIFF 等常见位图格式,并允许调用方控制颜色模式、描摹模式、杂点过滤、颜色精度、图层合并、角点与拼接阈值、路径精度以及曲线拟合迭代次数。可自动处理 data URI 前缀,并以 5 MB 为上限流式下载 URL 图像。
适用场景
适合助手需要把生成或提供的位图转成矢量文件的场景,例如标志、图标或海报风格的艺术图。也适合需要针对清晰边缘、简化颜色或去除噪点来调优 SVG 输出,而非使用默认转换的工作流。
运行要求
以本地 stdio 进程运行,通常用 uvx image2svg-mcp 启动,因此需要 Python/uv 运行时。也可通过 Docker 以 HTTP 服务器方式运行在 8000 端口。未声明任何账号、API 密钥或环境变量。访问本地文件需要 --allow-local-files-path 参数。
安装前请注意
默认会拒绝 file:// URL;启用 --allow-local-files-path 后,指定目录及其子目录内的文件都可被访问,因此应尽量缩小该路径范围。图像 URL 会经网络获取,远程下载上限为 5 MB。该服务器本身不写入数据,但生成的 SVG 在使用前应先行检查。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Image to SVG,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

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:

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

for Claude Code add using command line:

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

with access to local files:

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

Docker

Run as an HTTP server:

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

With local file access:

bash
docker run -p 8000:8000 -v /home/user/images:/images ghcr.io/botmonster/image2svg-mcp --allow-local-files-path /imagesclaude 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

bash
git clone https://github.com/botmonster/image2svg-mcp.gitcd image2svg-mcpuv sync

Run tests

bash
uv run pytest tests/ -v

Run the MCP Inspector

bash
uv run fastmcp dev inspector src/image2svg_mcp/server.py:mcp

License

Apache 2.0 - see LICENSE

来源:README.md,提交 2c855cc

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分