ztd-charts-mcp

v0.13.1
ztd-charts-mcp Checked 11 hours ago Published 13 days ago

ztd-charts MCP server (stdio): list charts, get schemas, validate specs, render SVG/PNG, and get chart suggestions from data

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_charts List chart types

List the 47 chart types with name, level (basic, intermediate, advanced), group, one-line summary, when to use or avoid, and encoding channels. Filter by group or level.

ParameterTypeDescription
groupstringChart group
levelstringDifficulty level

get_chart_schema Get chart schema

Get the JSON Schema for one chart type (encoding channels, options with types/defaults), plus a complete example spec and a React snippet. Omit type for the full schema of all 47 charts (about 365 KB, so prefer asking for one type).

ParameterTypeDescription
typestringChart type, e.g. "pie", "line", "sankey". Aliases like "doughnut", "violin" work.

validate_spec Validate chart spec

Validate a chart spec against the registry and its inline data: unknown type (with did-you-mean), missing/unknown encoding channels, fields missing from data, non-numeric value fields, option types and enums. Returns { valid, errors[], warnings[] } with JSON paths and messages. Set locale for the language of the messages.

ParameterTypeDescription
spec *object{ type, data, encoding, options?, card?, theme? }
localestringLocale for the error and warning messages. Default "en-US", or the spec's options.locale when set. "ko" or "ko-KR" gives Korean messages

render_chart Render chart

Server-render a chart spec to PNG (returned as an image) and/or SVG text, with the card frame (number, title, legend, takeaway, level badge) when spec.card is set. Also returns ready-to-paste React code. data may be inline rows, { csv }, or { url } (fetched; private and local network addresses are refused unless the server runs with ZTD_CHARTS_ALLOW_PRIVATE_URLS=1). Set locale for the language of built-in chart text and number formats.

ParameterTypeDescription
spec *objectChart spec
formatstringDefault png
localestringLocale for built-in chart text and number formats. Default "en-US" (1.2K). "ko" or "ko-KR" gives Korean text and 1.2만 style numbers
scalenumberPNG pixel ratio, default 2
themestringDefault dark
widthintegerPixel width, default 720

suggest_chart Suggest charts for data

Profile tabular data (column kinds, cardinality, hierarchy, source/target pairs, dates) and recommend chart types ranked by fit, each with a reason and a ready spec. Pass csv text, rows (array of objects), or a url to CSV/JSON (Google Sheets CSV export, REST; private and local network addresses are refused unless the server runs with ZTD_CHARTS_ALLOW_PRIVATE_URLS=1). Set locale for the language of the reasons and the suggested specs.

ParameterTypeDescription
csvstringCSV text with header row
limitintegerDefault 5
localestringLocale for chart names, reasons and card text in the suggestions. Default "en-US". "ko" or "ko-KR" gives Korean text and sets options.locale "ko-KR" in each spec
rowsarrayArray of row objects
urlstringhttp(s) URL returning CSV or JSON