Docs · MCP for agents

Charts, spoken over MCP

An AI graph maker in the literal sense: point a Model Context Protocol client — Claude Desktop, Claude Code, anything that speaks MCP — at this project's server and your assistant gains four chart tools. Describe the data; get back a validated spec, an embed snippet, or a finished image.


Hook it up

The server is part of the open-source repository (public at launch) and runs locally over stdio — your data never leaves the machine. Build it, then add one entry to your client's MCP config, pointing at the built server:

{
  "mcpServers": {
    "meikucharts": {
      "command": "node",
      "args": ["/path/to/apps/mcp/dist/index.js"]
    }
  }
}

The four tools

create_chart

Spec in, embed snippet out. The spec is validated by the engine's own parser first, so what the agent hands back is guaranteed to render — and a bad spec returns the structured {path, message, hint} errors, which agents are notably good at fixing on the second try.

create_chart({
  "spec": {
    "type": "column",
    "theme": "editorial",
    "data": {
      "labels": ["Q1", "Q2", "Q3", "Q4"],
      "series": [{ "name": "Revenue", "values": [48, 52, 47, 61] }]
    }
  }
})
// -> a validated, paste-ready <live-chart> embed snippet

suggest_chart

Raw rows in, a recommendation out: the tool looks at the shape of the data — how many series, how many points, whole numbers or not — and answers with a chart type, the reason, and a ready-made spec you can pass straight to the other tools.

list_themes

The ten looks — five themes, each in light and dark — with enough description for an agent to pick one that fits the page it is writing into. Kept in sync with the engine's theme registry by a drift test.

render_chart

The whole pipeline in one call: spec in, finished PNG or SVG out, delivered into the conversation. PNG renders through a headless browser at 2x; SVG is pure computation — no browser involved at all.

render_chart({
  "spec": { ...same spec shape... },
  "format": "png"   // or "svg"
})
// -> the finished image, straight into the conversation

Limits worth knowing

Tool calls are untrusted input, so the server refuses oversized work before validating it: at most 10,000 values per call, at most 10,000 drawn dots for a dotplot, and rendered PNGs are capped at 16.8 million pixels. Errors always arrive in the same structured shape as everywhere else.

Runs on your machine today; a hosted endpoint comes later.