
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 分