blueprint-chart/mcp
This server lets LLMs author, validate, render, and share Blueprint Chart (.bpc) charts using MCP tools, resources, and prompts.
Validate DSL: Parse and semantically validate
.bpcsource, returning structured errors and warnings with suggestions.Inspect DSL: Summarize a chart's type, scenes, series, rows, highlights, annotations, and other structural details.
Recommend chart type: Get ranked chart-type suggestions based on column types, row count, and a goal.
Render charts: Render to SVG, PNG, or HTML with width/height control, optional disk saving, and stateless hosted URLs.
List chart types: Enumerate all renderable chart types with aliases and summaries.
Describe chart type: Get when-to-use, when-not-to-use, properties, directives, and data shape for a specific chart type.
Get example: Fetch canonical
.bpcsamples by sample name or chart type.Search examples: Find canonical examples by topic keywords and/or chart type.
Get grammar: Retrieve the full DSL grammar reference or a focused section.
List palettes: List named color palettes and their hex colors for
colorPalette.Export charts: Create editable and embeddable shareable URLs with an inline preview.
Reference resources: Read
bpc://resources like handbook pages, guides, chart-type docs, grammar, and samples.Authoring prompt: Use the
author_chartprompt to guide end-to-end chart creation, validation, and iteration.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@blueprint-chart/mcp create a bar chart of monthly revenue"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Status | |
CI checks | |
Latest version | |
Release date | |
Open issues | |
Websites |
|
Smithery |
The MCP exposes Blueprint Chart's dataviz handbook, DSL grammar reference, chart-type docs, and canonical samples as MCP resources, plus eleven deterministic tools: validate_dsl, inspect_dsl, recommend_chart_type, render, list_chart_types, describe_chart_type, get_example, get_grammar, export_chart, search_examples, and list_palettes. Your LLM writes the .bpc; the MCP grounds it in real dataviz pedagogy and gives it a tight feedback loop.
Install
npx @blueprint-chart/mcp # stdio (for Claude Desktop, Claude Code, Cursor)
npx @blueprint-chart/mcp --http # HTTP/SSE on 127.0.0.1:4321Related MCP server: sales-analytics
Use with Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"blueprint-chart": {
"command": "npx",
"args": ["-y", "@blueprint-chart/mcp"]
}
}
}Use with Claude Code
claude mcp add blueprint-chart \
-e BLUEPRINT_CHART_EDITOR_URL=https://blueprintchart.com \
-e BLUEPRINT_CHART_DOCS_URL=https://docs.blueprintchart.com \
-- npx -y @blueprint-chart/mcpTools
Tool | Purpose |
| Parse |
| Parse and summarize: |
| Rank chart types for a given column shape and row count |
| Render to SVG (default), PNG, or HTML; with |
| List all renderable chart types (tool equivalent of |
| Properties, when-to-use, when-NOT-to-use, and data-shape for one chart type (tool equivalent of |
| Fetch a canonical |
| Find canonical examples by topic keywords and/or chart type (returns pointers; fetch full DSL with |
| Full DSL syntax reference (tool equivalent of |
| List named colour palettes with hex colours for |
| Validate a |
The discovery tools (list_chart_types, describe_chart_type, get_example, search_examples, get_grammar, list_palettes) let clients without MCP resource support access the same reference material that the bpc:// URIs expose.
Saving rendered output
The render tool can write its output to disk via save: <path>. This is disabled by default. Set MCP_FS_WRITE_DIR to a directory to enable it — ideally an absolute path; a relative value is resolved from the server's working directory at startup. Every write lands inside that directory (a sandbox), so you never have to worry about where a client puts files: relative save paths are joined to it, an absolute path already inside it is used as-is, and any other absolute path is re-anchored under it (the leading slash is stripped and the rest joined on, so save: "/tmp/foo.png" becomes <dir>/tmp/foo.png). Only paths that still escape via ../ traversal are rejected. Missing subdirectories are created automatically. Containment is checked lexically (no realpath), so a symlink whose lexical path is inside the sandbox still passes the check and is then resolved by the OS at write time — if its target is outside the sandbox, the write reaches it. Avoid placing symlinks in the sandbox if isolation matters to you.
Add the -e flag to your claude mcp add command:
claude mcp add blueprint-chart \
-e MCP_FS_WRITE_DIR=/path/to/output \
-- npx -y @blueprint-chart/mcpResources
bpc://grammar— full DSL syntax referencebpc://handbook/<slug>— dataviz pedagogy (choosing, design-principles, color, typography, annotations, accessibility, ...)bpc://guide/<slug>— usage guides (scenes, palettes, data-transforms, ...)bpc://chart-types/<slug>— per-chart-type docsbpc://samples/<id>— canonical.bpcexamplesbpc://reference/dsl/<slug>,bpc://reference/api/<slug>— full reference
Prompts
author_chart— primes the LLM end-to-end (read → write → validate → render → iterate)
Examples
Quickstart with Claude
Once the MCP is connected, ask Claude to make a chart:
You: Make a horizontal bar chart of English letter frequencies — top 10, highlight E.
Claude: (calls
list_chart_types,get_example({ chartType: "bar-horizontal" }), writes the.bpc, callsvalidate_dslto confirm it parses, callsrenderwithformat: 'png'and shows you the image and the source)Here's the chart:
![image]
chart bar-horizontal { title = "E is the most frequent letter in English" sort = descending valueLabels = true highlight "E" data { "E" = 12.70; "T" = 9.06; "A" = 8.17; ... } }
The MCP grounds Claude in real dataviz pedagogy (the handbook) before it writes a single line of DSL, then closes the loop with deterministic parse + render feedback.
What .bpc looks like
chart bar-vertical {
title = "E is the most frequent letter in English"
description = "How often each letter appears in typical English text"
source = "Lewand, Cryptological Mathematics"
colorPalette = "London"
sort = descending
valueLabels = true
highlight "E"
data {
"E" = 12.70
"T" = 9.06
"A" = 8.17
"O" = 7.51
...
}
}Full grammar at bpc://grammar; 17 canonical samples at bpc://samples/<id> (letter-frequency, co2-emissions, quarterly-revenue, browser-market, temperature-anomaly, population-stacked-bar, ...).
validate_dsl — parse with structured diagnostics
Request:
{
"name": "validate_dsl",
"arguments": { "source": "chart bar-vertical {\n title = \"oops\n}" }
}Response — valid is false; each entry in errors[] carries a code, human-readable message, and an actionable suggestion:
{
"valid": false,
"errors": [
{
"code": "E_PARSE",
"message": "Expected \"\\\"\" but end of input found.",
"suggestion": "Close the string literal on line 2."
}
],
"warnings": []
}inspect_dsl — structured summary
Request:
{ "name": "inspect_dsl", "arguments": { "source": "<.bpc source>" } }Response:
{
"ok": true,
"data": {
"chartType": "bar-vertical",
"scenes": [{ "index": 1, "hasTransition": false }],
"hasAnnotations": false,
"hasColorizes": false,
"hasHighlights": true,
"hasAreaFills": false,
"seriesCount": 0,
"rowCount": 26
}
}recommend_chart_type — ranked suggestions
Request:
{
"name": "recommend_chart_type",
"arguments": { "columnTypes": ["date", "number", "number", "number"], "rowCount": 24 }
}Response:
{
"ok": true,
"data": {
"recommendations": [
{ "chartType": "line-multi", "label": "Multi-Line Chart", "fitness": "best",
"reason": "1 date + 3 numeric columns — compare trends" },
{ "chartType": "bar-multi", "label": "Grouped Bar Chart", "fitness": "alternative",
"reason": "Can also show as grouped bars" }
]
}
}render — SVG (default), PNG, or HTML
Request:
{
"name": "render",
"arguments": { "source": "<.bpc source>", "format": "png", "width": 800, "height": 500 }
}Response:
{
"ok": true,
"data": {
"svg": "<svg ...>...</svg>",
"png": "<base64-encoded image>",
"mimeType": "image/png",
"urls": {
"png": "https://mcp.blueprintchart.com/render.png?bpc64=…",
"svg": "https://mcp.blueprintchart.com/render.svg?bpc64=…",
"bpc": "https://mcp.blueprintchart.com/render.bpc?bpc64=…"
}
}
}The urls field is only present when MCP_PUBLIC_URL is configured; every render and export_chart response then includes these stateless links, with the chart data travelling inside the URL (as bpc64, a URL-safe base64 encoding of the .bpc source) — no session, no server state required. Set modelVisible:false in the request to drop the inline image from the response entirely, spending no image tokens.
If rasterization fails (rare), errors[] is non-empty — each entry has a code ("E_RENDER") and a suggestion — and the response still includes the SVG that was successfully produced, so partial success is preserved.
Hosted render URLs
Embed a chart directly in a page:
<img src="https://<your-mcp-host>/render.png?bpc64=<bpc64value>&width=800&height=500" alt="My chart" width="800" height="500">/render.bpc serves the raw .bpc source — it's "view source" for any chart URL, handy for sharing or reproducing a chart from its link alone.
Sources whose encoding exceeds 8 KB return 413 from the endpoints (and the tool omits urls, returning urlsOmitted: "source-too-large" instead) — use the inline PNG for very large charts.
Reading a resource
{ "uri": "bpc://handbook/choosing" }Returns the full Markdown of the "Choosing the Right Chart" handbook page (same content as docs.blueprintchart.com).
{ "uri": "bpc://samples/letter-frequency" }Returns the raw .bpc source for the letter-frequency sample as text/plain — exactly what the LLM should imitate.
License
MIT
Available Tools
11 toolsdescribe_chart_typeARead-onlyIdempotent
Return everything an LLM needs to write a .bpc for a given chart type — typically your second call, after recommend_chart_type. Input: { chartType: "bar-horizontal" } (or any canonical/alias name). Returns summary, when-to-use, when-NOT-to-use, full property list with enum choices, data-shape example, and a pointer to a canonical sample.
Inputs: chartType (required). Returns: name, aliases, docsUrl, summary, +6 more
export_chartARead-onlyIdempotent
Turn a validated .bpc source into shareable URLs plus an inline visual preview of what was published. Returns { copyUrl, embedUrl, urls?, frame } and a scene-0 PNG image block so you can confirm the chart looks right before sharing. copyUrl opens an editable copy in the editor; embedUrl is a read-only iframe target; urls.{png,svg,bpc} (when MCP_PUBLIC_URL is set) are stateless rendered-image/source links. Set modelVisible:false to show the preview to the user only. Requires BLUEPRINT_CHART_EDITOR_URL; preview failures never block the export.
Inputs: source (required), modelVisible. Returns: urls, frame, copyUrl, embedUrl, +1 more
get_exampleARead-onlyIdempotent
Return a canonical .bpc example. Pass { name } for a specific sample id, { chartType } for the first sample of that type, or no args for a starter sample.
Inputs: name, chartType. Returns: id, dsl, title, chartType
get_grammarCRead-onlyIdempotent
Return the .bpc DSL grammar as markdown. Pass { section: "chart" | "data" | "properties" | "scenes" | "annotations" } for a focused subset, or no args for the full grammar.
Inputs: section. Returns: text, section
inspect_dslARead-onlyIdempotent
Parse a .bpc source and return a structured summary: chartType, scenes, data (rowCount, entryCount, labels, seriesNames, multiSeries), annotation/colorize/highlight/area-fill presence flags, series count.
Inputs: source (required). Returns: data, scenes, chartType, seriesCount, +4 more
list_chart_typesARead-onlyIdempotent
Reference list of every chart type the renderer supports, with aliases and one-line summaries. To choose a type for a dataset, call recommend_chart_type instead.
Inputs: no named parameters. Returns: chartTypes
list_palettesARead-onlyIdempotent
List every named colour palette with its label and hex colours, for use in colorPalette = "<name>".
Inputs: no named parameters. Returns: palettes
recommend_chart_typeARead-onlyIdempotent
Start here before writing any .bpc. Takes column types, row count, and the user's goal (a prose sentence — it determines the chart family: comparison/ranking/part-to-whole/composition-over-time/trend/range). Returns ranked chart-type recommendations plus guidance.
Inputs: rowCount (required), columnTypes (required), goal. Returns: guidance, recommendations
renderAIdempotent
Render a .bpc source to SVG (default), PNG, or HTML. With format:"png" the chart comes back as an inline IMAGE you and the user can both see — render, look at the result, fix issues, re-render. Always returns structured frame metadata. When MCP_PUBLIC_URL is set the response includes stateless urls ({png,svg,bpc}). Set modelVisible:false to display the image to the user without spending model image tokens. Pass save:<path> to write the output into MCP_FS_WRITE_DIR instead of returning it inline. Width/height are capped at 1600; PNGs are rasterized at 2× for retina sharpness.
Inputs: source (required), save, scene, width, +3 more. Returns: urls, frame, savedTo, mimeType, +1 more
search_examplesARead-onlyIdempotent
Find canonical .bpc examples by topic keywords and/or chart type. Returns ranked pointers { id, title, description, chartType } — call get_example with an id to fetch the full DSL.
Inputs: limit, query, chartType. Returns: results
validate_dslARead-onlyIdempotent
Parse and semantically validate a .bpc source. Returns { valid, errors[], warnings[] }. Errors include unknown chart types, unknown properties, and empty data blocks with nearest-neighbour suggestions.
Inputs: source (required). Returns: valid, errors, warnings
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool targets a distinct task: palette listing, DSL validation, inspection, chart type recommendation, grammar reference, rendering, chart type listing/details, example retrieval/search, and export. The only potential overlap is validate_dsl vs. inspect_dsl, but their outputs (errors/warnings vs. structured summary) are clearly different.
Most tool names follow a verb_noun snake_case pattern (e.g., list_palettes, validate_dsl, describe_chart_type). The sole deviation is 'render', a verb-only name, but it remains clear and stylistically consistent with the imperative, lowercase convention.
11 tools is well within the ideal 3-15 range and each tool earns its place in the chart-authoring workflow, covering discovery, validation, rendering, and export without redundancy or bloat.
The tool set provides a complete lifecycle for working with .bpc DSL: discovery (palettes, chart types, examples), guidance (recommend, describe), grammar reference, validation/analysis, rendering, and export. No obvious dead ends or missing operations for the apparent purpose.
Maintenance
Related MCP Connectors
Renders interactive Chart.js charts and dashboards inline in AI conversations.
Clean messy tabular data and render publication-ready PNG charts from your AI assistant.
Generate production-ready chart code (Recharts, Chart.js, ECharts, Plotly) from a prompt.
Create, inspect, manage, and render charts and data visualizations as SVG/PNG or interactive embeds.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to generate safe, runnable HTML chart pages from structured JSON data using Apache ECharts. It provides tools for chart type recommendation, page generation, validation, and patching with controlled, deterministic output.6 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to load tabular data from CSV/Excel/JSON, clean and analyze it, generate charts, and write a report with conclusions.MIT
- FlicenseNot gradedqualityDmaintenanceEnables LLM clients to load, clean, visualize, and analyze tabular datasets, and to generate multi-format analytic reports through natural language instructions.-
- FlicenseNot gradedqualityCmaintenanceEnables agents to compile a semantic chart description (data, semantic types, chart intent) into native specs for five charting libraries and headlessly render three of them to SVG or PNG, delivered inline or as signed, expiring artifact URLs. It also exposes tools for validating charts, listing chart types and themes, plus resources and prompts that supply chart-authoring and theming conventions.-