
drawspec
io.github.nuncaeslupus由 GitHub 账号 nuncaeslupus 发布v0.4.3更新于 Oct 24, 2026
验证并渲染声明式图表规范,输出干净的 SVG 或 PNG;无需坐标。
AI 翻译由 AI 模型根据下方的原文描述翻译,可能有误。
原文描述
Validate and render declarative diagram specs to clean SVG or PNG; no coordinates needed.
概览
drawspec 的本地 MCP 服务;无需登录;STDIO。
暂无 AI 概览:以下信息来自注册中心条目和服务本身。
安装
在 SourceWeft 中
- 打开 控制台中的 drawspec,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
[图片] drawspec
[PyPI] [License: MIT] [drawspec MCP server – quality and maintenance score on Glama] [drawspec on mcprush]
Diagrams from a JSON description — no coordinates, so nothing to misplace. You say what the diagram means: the boxes, the arrows, the labels, and a role for each. drawspec decides every position, size, route and colour, and draws a clean SVG, PNG or plain-text diagram.
It is built for language models first. An LLM that writes SVG by hand gets the
content right and the placement wrong — arrows that miss their boxes, text that
spills out, lines that stop short. A drawspec document has no x, y or font
size to get wrong: those fields are refused, and every mistake comes back as an
error pointing at the exact field, so the model can fix it and try again.
Browse the gallery: more than 30 kinds, drawn →
Example
You write this:
drawspec draws this:
The same document as text, for a terminal, a commit message or a code block
(--format text --charset ascii):
A sequence diagram works the same way — participants and messages in order; activation bars, arrows and spacing are worked out for you:
More than 30 kinds of diagram
Flow charts, sequence diagrams, state machines, ER and class diagrams, Gantt charts, swimlanes, mind maps, timelines, Venn, Sankey, treemaps, pie and bar charts, kanban boards, fishbone, family trees, file trees, timing diagrams, network diagrams, tournament brackets, cladograms and more — one format for all of them. Click a drawing to open it full size, or a kind's name for its source — the code is all here.
The full list: flow · tree · cycle · stack · timeline · columns ·
matrix · pyramid · rings · funnel · chart · quadrant · scatter ·
curve · files · states · sequence · lanes · entities · gantt ·
board · fishbone · venn · journey · treemap · sankey · numberline ·
barmodel · waterfall · pie · mindmap · argument · familytree ·
meter · rag · clock · sunburst · timing · gitgraph · network · railroad · usecase ·
wardley · packet · pert · automaton · neuralnet. Each has an example in docs/reference,
and the gallery
(docs/gallery/index.html) draws every one.
Using it from an LLM
- MCP server —
pip install 'drawspec[mcp]'addsdrawspec-mcp, with the toolslist_kinds,get_example,get_schema,validate_documentandrender_document. A mistake comes back as data the model can act on:{"pointer": "/edges/0/to", "message": …}. See the guide. AGENTS.md— the whole format on one page, written for a model to read in one pass: which kind fits, the size limits, the roles, worked examples, and what each error means.llms.txtindexes it.- Agent Skill — copy
skills/drawspec/into your skills directory. - JSON Schema — start a document with
"$schema": "https://nuncaeslupus.github.io/drawspec/schema/drawspec-v1.schema.json"for completion and errors as you type, in an editor or a structured-output call.
A typical loop: the model picks a kind, writes the JSON, calls
validate_document, fixes what is reported, and renders.
What you get
- SVG that pastes inline into Markdown or HTML: it takes the page's text colour,
carries no global styles or colliding ids, and never relies on colour alone, so it
works in dark mode and in greyscale print.
--variant dark=<theme>adds a dark version that followsprefers-color-scheme. - PNG on a light, dark or transparent background (
pip install 'drawspec[png]'). - Plain text (box-drawing or ASCII) for many kinds, including flows, state machines, sequences, Gantt charts, syntax diagrams, file trees and packet headers (as an RFC draws them).
- Themes: change one TOML file and every diagram in a project follows.
drawspec theme from site.cssbuilds one from your CSS or design tokens. - Readable by design: each kind has a size budget; past it, drawspec asks you to split the diagram rather than draw a dense one.
Command line
What it is not
- Not a graph-layout engine. For a hundred-node graph, use Graphviz.
- Not a plotting library.
chartstates a few numbers you already know; it has no statistics, dates, log scales or interactivity. - Not a drawing program. Anything whose point is where things are — a floor plan, a map — has no place in a format without coordinates.
Documentation
The references are generated from the code (make docs), and a test fails if they
drift.
Development
The library is in src/drawspec/, the examples in docs/reference/, the tests in
tests/. docs/brief.md and corpus/ hold the original design brief and the
evidence it was based on. .claude/ and claude-arsenal/ are development tooling
and do not affect the package.
Related projects
Built with claude-arsenal, a spec-driven Claude Code workflow whose skills draw their diagrams with drawspec. By the same author:
- integral-job-search — a candidate-centred job search run as a conversation in Claude Code.
- literary-critic — lets an LLM index, analyse and advise on a full novel manuscript the way a professional editor would.
- doc-control — a deterministic tool for AI agents to edit Word documents as tracked changes (in development).
License
MIT — see LICENSE.
来源:README.md,提交 12b72d0
工具
0版本历史
6- v0.4.3最新Oct 20, 2026
- v0.4.2Oct 19, 2026
- v0.4.1Oct 19, 2026
- v0.3.3Oct 15, 2026
- v0.3.2Oct 15, 2026
- v0.3.1Oct 15, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分