@chartlite/mcp
v0.3.5
Published
Model Context Protocol server for Chartlite — render charts to SVG from a JSON spec. Zero-dependency, ~15KB core, agent-native.
Maintainers
Readme
@chartlite/mcp
A Model Context Protocol server that renders Chartlite charts to accessible SVG from a single JSON spec. Zero-dependency core (~15 KB), runs headless — ideal inside an agent sandbox.
Run
npx -y @chartlite/mcpThe server speaks MCP over stdio.
MCP client configuration
{
"mcpServers": {
"chartlite": {
"command": "npx",
"args": ["-y", "@chartlite/mcp"]
}
}
}Tools
render_chart({ spec })
Render a chart to an SVG string. spec is a ChartSpec: { type, data, ...options }.
{
"spec": {
"type": "line",
"data": [{ "x": "Jan", "y": 4200 }, { "x": "Feb", "y": 4800 }],
"theme": "tailwind",
"title": "Revenue"
}
}Returns the SVG as text — drop it straight into HTML or Markdown; it needs no client JS.
type:line|bar|area|scatter|pie|sparklinedata:DataPoint[]([{x,y}]),number[], column ({x:[],y:[]}), or series-first ({series:[...],data:[...]})- options:
theme,title,colors,width,height,legend,curve,orientation,innerRadius,pointShape,referenceLines,annotations, … (see the schema below)
list_chart_types()
Returns the supported chart types and the full JSON Schema for a spec, so you can build a
valid render_chart call.
Schema
The chart-spec JSON Schema is published as
@chartlite/core/schema.json and returned
by list_chart_types.
License
MIT © Riel St. Amand
