svg-vectordrawable-mcp
v1.0.0MCP server (stdio) that converts SVG to Android VectorDrawable XML and previews VectorDrawable as SVG, powered by svg-vectordrawable.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
convert SVG to Android VectorDrawable
Convert an SVG document to Android VectorDrawable XML. Returns the XML, the warnings (each with a code and a category: lossy, approximation or info) and the minimum Android API level the output needs. Unconvertible input (not an SVG, or a strict-mode violation) returns an error.
| Parameter | Type | Description |
|---|---|---|
svg * | string | SVG document (markup, not a path or URL) |
autoMirrored | boolean | Adds android:autoMirrored="true": flipped in right-to-left layouts (arrows). Default false. |
colorMap | object | SVG colors to Android color references, e.g. {"#1A73E8": "@color/brand"}. Keys are CSS colors (#f00, red and rgb(255,0,0) are one key); an opaque key also matches its translucent shades. |
currentColor | string | What currentColor stands for: a CSS color (e.g. "#FF5722", "red"), or an Android color reference emitted as is so the icon follows the theme (?attr/colorControlNormal, @color/brand). Default #000000. |
floatPrecision | integer | Decimal places kept for generated numbers. Default 3. |
height | number | android:height in dp, replacing the SVG size. Alone, the width keeps the aspect ratio. |
minSdk | integer | The app minSdk: warns (min-sdk-exceeded) when the output needs a higher API level. |
rules | object | Severity per warning code, overriding strict: "off" drops the warning, "warn" reports it, "error" fails. E.g. {"strict": true, "rules": {"opacity-approximated": "warn"}}. The hints "long-path-data" an… |
strict | Fail instead of warning: true rejects lossy and approximated output, "lossy" only lossy output. Default false. | |
tint | string | Adds android:tint to the <vector>, e.g. #FFFFFFFF or ?attr/colorControlNormal. |
width | number | android:width in dp, replacing the SVG size. Alone, the height keeps the aspect ratio. |
preview VectorDrawable to SVG preview
Render an Android VectorDrawable XML as a standalone SVG string, to preview a drawable (e.g. the output of convert) in a browser or an image viewer.
| Parameter | Type | Description |
|---|---|---|
xml * | string | Android VectorDrawable XML |
applyTint | boolean | Apply the vector's android:tint. Default false (tint ignored). |
density | number | Pixels per dp for the SVG width/height (1 = mdpi, 4 = xxxhdpi). Default 1. |