
Blueprint Chart
io.github.blueprint-chart由 GitHub 账号 blueprint-chart 发布v0.2.1更新于 Oct 24, 2026
The open chart format an LLM writes and the browser renders — to interactive, accessible SVG.
概览
让助手编写、校验并把 Blueprint Chart 的 .bpc 图表文件渲染为交互式 SVG、PNG 或 HTML。
- 可以做什么
- 把 Blueprint Chart 的数据可视化手册、DSL 语法、图表类型文档和规范示例作为 MCP 资源提供,并附带十一个确定性工具。助手编写 .bpc 源码后,validate_dsl 与 inspect_dsl 会解析并返回结构化错误、警告和摘要。render 可输出 SVG、PNG 或 HTML 及帧元数据,recommend_chart_type 按列结构推荐图表类型,export_chart 返回可分享的编辑器与嵌入链接。list_chart_types、get_example、search_examples、get_grammar、list_palettes 等发现类工具提供参考资料。
- 适用场景
- 适合希望助手真正生成图表而非仅描述图表的场景,解析与渲染的反馈闭环能及时发现 DSL 错误。适用于报告、仪表盘和文档配图,输出为可移植的 .bpc 文件或可嵌入的 SVG。它不是通用的数据分析或电子表格服务器。
- 运行要求
- 通过 npx @blueprint-chart/mcp 以 stdio 在本地运行(需要 Node.js);另有 HTTP/SSE 模式,监听 127.0.0.1:4321。未声明需要账号或身份验证。可选环境变量:BLUEPRINT_CHART_EDITOR_URL 供 export_chart 使用,MCP_PUBLIC_URL 用于生成无状态渲染链接,MCP_FS_WRITE_DIR 用于启用把渲染结果写入磁盘。
安装
在 SourceWeft 中
- 打开 控制台中的 Blueprint Chart,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Model Context Protocol server for authoring Blueprint Chart .bpc files with LLMs, grounded in real dataviz pedagogy with a tight parse + render feedback loop. An open, plain-text chart format an AI can write and any browser can render. Self-contained, no backend, no account required.
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
Use with Claude Desktop
Add to claude_desktop_config.json:
Use with Claude Code
Tools
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:
Resources
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]
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
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:
Response — valid is false; each entry in errors[] carries a code, human-readable message, and an actionable suggestion:
inspect_dsl — structured summary
Request:
Response:
recommend_chart_type — ranked suggestions
Request:
Response:
render — SVG (default), PNG, or HTML
Request:
Response:
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:
/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
Returns the full Markdown of the "Choosing the Right Chart" handbook page (same content as docs.blueprintchart.com).
Returns the raw .bpc source for the letter-frequency sample as text/plain — exactly what the LLM should imitate.
License
MIT
来源:README.md,提交 5b71066
工具
0版本历史
1- v0.2.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分