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 分