SVG diagrams now render inline in Claude Desktop. generate_diagram returns SVG as normalized, theme-friendly markup text that scales cleanly in chat, instead of an image/svg+xml image block that the Anthropic API always rejected.
Breaking changes
generate_diagramwithformat=svgreturns the SVG markup as a text content block instead of animage/svg+xmlimage block. Claude Desktop (the Anthropic API) accepts only raster formats in image blocks, so the previous shape always failed with "unsupported format"; clients that render SVG image blocks now receive markup text instead.- The advertised default for
generate_diagram'sformatargument changed frompngtosvg, so callers that omit it now get the text/SVG path. Passformat: pngexplicitly for an image block.
Changed
- SVG output is normalized for inline chat rendering before being returned: the root element's background and fixed-size style declarations (including Mermaid's
max-width) are stripped, the fixedwidthbecomeswidth="100%"with aviewBox(synthesized from the pixel dimensions when missing or invalid) andstyle="height:auto"(the pixelheightattribute is kept as an intrinsic-size fallback), andpreserveAspectRatiois dropped in favor of the proportional default. Only the root tag is rewritten: this covers PlantUML-style root backgrounds; backgrounds painted inside the body (Graphviz's canvas polygon, Mermaid's embedded<style>rules) are left as-is. generate_diagramreturns an error instead of inline SVG when the normalized markup exceeds 100 KB, pointing the caller atget_diagram_urlorgenerate_png_diagram_with_custom_dpi, since text output is billed as model context tokens.- Upgraded
github.com/mark3labs/mcp-gofrom v0.25.0 to v0.58.0 (52 releases), migrating to the typed argument accessors API in place of rawArgumentsmap access. - Raised the required Go toolchain to 1.25.5, updating
go.mod, CI (actions/setup-go), and the Docker builder image accordingly.
Fixed
- Tool descriptions for the
formatargument no longer advertisetext, which the schema enum and validation reject; they now list exactlysvgandpng. generate_png_diagram_with_custom_dpinow honors its declared default DPI of 150 whendpiis omitted, rejects a wrong-typeddpiinstead of silently falling back to the default, and enforces a valid range of 72–300 consistently across the guard, the error message, and the parameter schema.- Stdio server startup/runtime errors are now logged and cause a non-zero exit, except for a graceful SIGTERM/SIGINT shutdown (which surfaces as
context.Canceledand now exits cleanly). - Tool annotations are now declared on all three tools (
generate_diagram,get_diagram_url,generate_png_diagram_with_custom_dpi) as read-only, non-destructive, idempotent, open-world;get_diagram_urlpreviously advertised a self-contradictoryidempotentHint: false, anddestructiveHint: falsewas dropped from the wire due toomitemptyon a plain bool. - Mixed-case
diagramTypeandformatarguments are now normalized to lowercase before being forwarded to Kroki, instead of being validated case-insensitively but forwarded raw. - Corrected the invalid-format error message to list the actually supported formats:
format is required and must be one of: png, svg. svgconv.Convertnow propagates PNG/JPEG encoding errors instead of discarding them and returning a truncated or corrupt image as success.
Full Changelog: v2.0.0...v3.0.0