
Microcharts
io.github.ganapativs由 GitHub 帳號 ganapativs 發布v0.1.17更新於 Oct 24, 2026
Find, wire, and render microcharts — word-sized React charts with generated alt text.
概覽
一個本機 MCP 伺服器,讓助理找到合適的微型圖表、取得接入方式,並渲染成自帶替代文字的獨立 SVG。
- 可以做什麼
- 尋找圖表:依自然語言問題(可選依資料形狀)對微型圖表目錄排序,回傳符合的圖表識別碼與理由。取得接入資訊:提供所選圖表的匯入路徑、屬性、資料形狀、適用與避免建議、可執行範例和可直接渲染的範例。渲染圖表:輸出完整的獨立 SVG 及產生的摘要和替代文字,支援內嵌樣式或裸格式。讀取資源:包含所有圖表與中繼資料的目錄,以及把微型圖表接入程式碼庫的提示詞。同樣三項能力也以 Vercel AI SDK 工具和一般函式形式匯出。
- 適用情境
- 適合需要助理在聊天或程式碼庫中內嵌小型詞級圖表(如迷你趨勢線、子彈圖、點圖或 OHLC 圖)的情境,並希望得到真正渲染的 SVG 和無障礙替代文字,而不是用戶端可能無法渲染的圖表標記。
- 執行需求
- 透過 npx 從 npm 套件 @microcharts/mcp 以 stdio 在本機執行,需要 Node.js 和 npx。無需帳號、API 金鑰、環境變數或請求標頭,也沒有託管服務。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Microcharts,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
@microcharts/mcp
An MCP server and Vercel AI-SDK toolset for microcharts — let a model find the right word-sized chart, get exactly how to wire it, and render it to a finished SVG with real alt text.
microcharts is built so a model can write charts. This is how a model calls them: not "emit some grammar and hope
the client renders it," but a tool call that returns the real library's static SVG, honest by construction, with the
generated describeSeries accessible name attached.
- Runs on your machine. stdio server, distributed on npm. Nothing is hosted; no account, no key, no data leaves.
- Works anywhere. The render tool returns self-contained SVG, so a chat surface that can't run React can still show a real chart.
- Zero setup.
npx @microcharts/mcp— the package brings its own copy of@microcharts/react.
Install
Add it to any MCP client. For Claude Desktop (claude_desktop_config.json) or Cursor (.cursor/mcp.json):
That's it — the client spawns the server over stdio on demand.
Tools
find_microchart(question, dataShape?)
Rank the catalog against a plain-language question. Start here when you know the question, not the chart.
get_microchart(slug)
Everything needed to wire one chart: import paths, its props plus the shared props, data shape, best/avoid guidance, a
copy-runnable example, and sample — that same example as JSON props, ready to pass straight to render_microchart.
Every chart takes its own data shape — number[] for a sparkline, { label, value }[] for a dot plot,
{ open, high, low, close }[] for OHLC — so sample is the shortest path from "which chart" to "a render that works".
render_microchart(type, data?, props?, format?)
Render to a finished, self-contained SVG plus its generated alt text. Pass the series as data; put other props
(value, target, curve, color, width) in props.
format is "svg" (default, styles embedded — drops into any surface) or "bare" (no CSS, for pages that already load
@microcharts/react/styles.css).
Missing or wrong-shaped data is rejected by name rather than passed through to React, so a caller gets
"dot-plot" needs \data`. Data shape: { label, value }[]. Call get_microchart("dot-plot") for a ready-to-render
sample.` instead of a stack trace. Oversized payloads are refused too — a microchart is a word-sized mark.
It also exposes two resources: microcharts://catalog (every chart + metadata) and microcharts://agent-setup (the
prompt for wiring microcharts into a codebase).
Use it from the Vercel AI SDK
The same three capabilities ship as AI-SDK tools (on the /ai-sdk subpath, so the core never pulls in ai):
The functions are exported directly too — findChart, getChart, renderChart — if you want them without the tool
wrapper.
Versioning
This server bundles the chart catalog and renders with @microcharts/react (installed as a normal dependency). Its
version tracks its own changes; a compatible library is pulled in automatically. The library version a given snapshot
was cut from is on the microcharts://catalog resource.
Links
- Docs: https://microcharts.dev/docs/mcp
- Library:
@microcharts/react - Source: https://github.com/ganapativs/microcharts/tree/main/packages/mcp
MIT
來源:packages/mcp/README.md,提交 378d4fe
工具
0版本歷史
1- v0.1.17最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分