mcp

v0.5.0
@chartkitdev/mcp Checked 48 minutes ago Published 12 days ago

MCP server for ChartKit.

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

validate Validate a ChartKit spec

Validate a ChartKit v1 spec. Returns the object from @chartkitdev/core validate(): ok, diagnostics, errors, and warnings. Each diagnostic can include a JSON Patch fix. The spec is not modified. Gantt, timeline, quadrant, venn, and journey add a CK1011 warning; their extra field rules live in validate/phase4.

ParameterTypeDescription
spec *ChartKit v1 spec object, or a JSON string of that spec.

repair Repair a ChartKit spec

Apply the safe JSON Patch fixes from @chartkitdev/core/validate/convert repairAsync() and revalidate. Returns that function's result: spec, ok, diagnostics, errors, warnings, and applied. The input spec is not mutated. Fixes that the validator did not provide are not invented. Chart.js, ECharts, Vega-Lite, Plotly, and Recharts configs are converted, and a string may carry a Markdown fence, comments, or trailing commas.

ParameterTypeDescription
spec *ChartKit v1 spec object, or a JSON string of that spec.

render Render a ChartKit spec to SVG

Render a spec with @chartkitdev/core/extra, which registers every chart type including histogram, boxplot, radar, funnel, treemap, sankey, bullet, waterfall, gantt, timeline, quadrant, venn, and journey. Returns the SVG string plus width and height in pixels (the numeric SVG attribute, or the viewBox size when that attribute is a percentage). format is "svg" only. PNG is not implemented: a rasterizer would add a native or wasm dependency, and this package does not include one.

ParameterTypeDescription
spec *ChartKit v1 spec object, or a JSON string of that spec.
formatstringOutput format. Only "svg". PNG is not implemented.

render_chart Render a spec on ChartKit Cloud

POST the spec to ChartKit Cloud and return the image URL plus the repairs and warnings from validate()+repair(). Omit format, or pass svg. SVG is the default: it skips the resvg pass and stays sharp when attached in chat. Pass png only when the host cannot display SVG, such as email, a GitHub README image, or some Slack clients. When format is png, set scale to 2 or higher for HiDPI. The chart background defaults to #ffffff so Soft labels stay readable on a dark lightbox. Pass background to override that plate. Use theme midnight when the host is dark. Pass background transparent to keep the p…

ParameterTypeDescription
spec *ChartKit v1 spec object, or a JSON string of that spec.
backgroundstringChart background. Hex, rgb(), hsl(), oklch(), or "transparent". Omit for #ffffff. Wins over theme.tokens.background.
formatstringImage format. Omit this or pass "svg". Pass "png" only when the host cannot display SVG (email, a GitHub README image, some Slack clients).
hnumberHeight in pixels.
keystringAPI key that removes the chartkit.dev mark.
scalenumberPNG zoom, from 1 to 4. Prefer 2 or higher when format is png. Ignored for svg.
themestringPreset name, such as "soft" or "midnight". midnight is an opaque dark plate with light text.
wnumberWidth in pixels.

lookup_feature Look up a feature in the matrix

Search the bundled copy of catalog/public/features.json, including its synonym index. Returns ChartKit's published status, the matrix spec snippet (or null), the docs URL https://chartkit.dev/features/<id>, and every other library's status from the same row. Statuses are native, partial, plugin, manual, none, or unknown. partial, plugin, and manual are not native support. Nothing in this tool is a hand-typed claim: if the file has no row, matches is empty.

ParameterTypeDescription
query *stringFeature id, label, or words such as "rotate labels" or "dual axis".

list_chart_types List chart types that have examples

List chart types from the example specs shipped in this package (the repo's packages/core/examples). Each type includes the example filenames. Specs themselves come from get_example.

get_example Get example specs for a chart type

Return the example specs for a chart type, an example filename, or an example id, from the specs shipped in this package. A type with several examples returns each of them.

ParameterTypeDescription
type *stringChart type such as "line", a filename such as "01-minimal-line", or an example id.