DingCard
This is the DingCard MCP server for automating creation, editing, validation, rendering, sharing, and management of DingCard visual documents.
Read built-in guides for document format, actions, deck/poster content, outlines, HTML import, templates, checks, and rendering.
List templates; create freeform deck or poster documents from templates; add template pages to existing documents.
Create decks from structured content or Markdown outlines; create posters from structured content; convert HTML/CSS into editable freeform documents.
Inspect and validate documents; apply editing actions for nodes, content, styles, geometry, slides, find/replace, and restyling.
Check layout/export issues such as overflow, overlap, contrast, placeholder text, and alignment; optionally auto-fix some issues.
Render freeform documents to PNG, JPEG, PDF, long images, or nine-grid outputs; render Markdown card envelopes to PNGs.
Search and import stock images; list and place icons, decorations, styles, text styles, collages, and filter presets.
Retrieve document JSON; open documents in the DingCard editor; generate share links and QR codes.
Manage server-side projects: list, open, and save drafts.

自由画布
选中任意元素,就地修改。 文字、图片、形状、线段、图标、图表、表格、时间线和二维码放在同一块画布上;多页作品的每一页可以设不同尺寸。
文字:选中一段单独加粗、标色、高亮或加下划线;16 种花字一键套用(霓虹、描边、立体、标签底色……);自己的字体文件(TTF / OTF / WOFF / WOFF2)可以导入,画布和导出都按它画。
图片:独立图片进入裁剪后,可以在原画框里移动图片、拖动八个黑柄,或按比例调整画框;还能加圆角、相框和滤镜。部署服务端后,图片抽屉里的在线图库可以直接搜可商用的图片。
素材:97 个可搜索的线性图标,48 个手绘线条、贴纸和标签;图表有柱状、环形、折线和雷达,数据可以从表格里整列粘贴。
风格:一键给整套卡片换配色或字体组合;改一个颜色或字体时点「全部替换」,整套里同样的颜色和字体一起换掉。
图层:改名、排序、编组、隐藏、锁定。
导出与分享:PNG、JPG、PDF,可以只导当前页,也可以打包成 ZIP、合成一个 PDF、拼成一张长图,或切成朋友圈九宫格。部署服务端后还能生成分享链接,手机扫码就能看,长按存图。
Related MCP server: StoreCraft Studio
Markdown 长文
一篇长文,按卡片尺寸自动分页。 把 Markdown 粘到左边,右边按小红书、微博或推特的尺寸实时分页;--- 手动分页,标题不会单独落在页底。图片粘贴后可以在预览里直接调宽度。
九套长文版式:专栏、备忘录、信笺、夜读、极光、文档、宣纸、瑞士、手账。每套有自己的页眉、页码、标题层级、引文、列表、待办、代码和表格样式,正文一个字不动就能换。

模板
88 套模板,都在仓库里维护。
Markdown 长文版式 9 套。
三页套图 自由画布有八套:编辑部、清单、信号、夜航、粗野、蓝图,和 16:9 的演示套图聚光、答辩。封面、内页、结尾各一页;用 MCP 生成整套卡片时,会按每页的内容换成观点页、清单页、数据页或收尾页。
单页模板 71 张,覆盖 8 种尺寸:小红书 3:4、竖版海报 9:16、方图 1:1、横版 16:9、公众号首图 2.35:1、A4 竖版和横版、朋友圈九宫格。从封面、海报、菜单价目、证书、简历和通知,到节日节气和邀请贺卡。
模板中心按名称、标签、用途和风格搜索,再按尺寸、风格、颜色和收藏筛选;每套模板按自己的比例排开,点开先看每一页和相似模板。在编辑器里,模板也能一页一页加进正在做的作品。做了一套好看的版式,可以按贡献模板提交 Pull Request,合并后所有人都能用。

MCP 自动化
AI 客户端,直接出整套卡片。 stdio MCP 服务器 dingcard-mcp 发布在 npm 上,提供 22 个工具,也登记在 MCP 官方注册表,名字是 io.github.lottshin/dingcard。文档校验、编辑和渲染跟编辑器共用同一套代码;工具之间传 documentId,图片可以直接写本机路径。在 MCP 客户端的配置里加上:
{
"mcpServers": {
"dingcard": { "command": "npx", "args": ["-y", "dingcard-mcp"] }
}
}需要 Node.js 22 以上和本机安装的 Google Chrome(渲染和检查用)。
工具 | 做什么 |
| 列出模板的尺寸、用途、风格,以及能放多少内容 |
| 按内容生成整套卡片,模板的示例文字全部换掉 |
| 按导出的样子检查文字被裁、叠住、对比度低、残留示例文字和大片留白,放不下的字自动缩小 |
| 无头渲染成逐页 PNG、JPG,一个 PDF、一张长图或九宫格切图 |
| 在叮卡编辑器里打开,由人接着改 |
另外还有按大纲生成整套卡片、生成单张海报、把 HTML 转成可编辑的设计、加入模板页、放装饰素材、搜索和导入在线图库的图片、生成分享链接、读写服务端作品和渲染 Markdown 长文等工具。完整清单、客户端接入配置和安全边界见 MCP 自动化接口。AI 生成的 .json 文档也可以拖进「我的项目」,存成项目后在编辑器里打开。
作品示例:山月 · 藍染海報
由 MCP 绘制,没有用一张图片:54 个形状、46 条线段、5 段文字和 9 组多段渐变。月晕是同心椭圆加模糊,山脊是远淡近浓的三层剪影,湖面的波纹是一条条线段(右页的红点是它们的控点)。整份文档在 docs/assets/yamatsuki-poster.json,拖进「我的项目」就能拆开重编。
使用与部署
在线使用
打开在线 Demo 就能用,不需要账号。作品自动保存在当前浏览器里,重要作品记得导出。
想要一份自己的在线地址,可以一键部署到 Vercel。不需要环境变量,作品同样保存在访问者的浏览器里。
Docker 部署
需要真实账号、跨设备同步、服务端图片和分享链接时,用 Fastify + SQLite 后端部署完整应用。预构建镜像支持 linux/amd64 和 linux/arm64:
docker pull ghcr.io/lottshin/dingcard:0.61.0.env.example 中的 DINGCARD_VERSION=0.61.0 会固定使用上面的镜像。下面的流程适用于已经安装 Git、Docker Engine、Docker Compose 和 OpenSSL 的 Linux 服务器:
git clone https://github.com/lottshin/DingCard.git
cd DingCard
cp .env.example .env
JWT_SECRET="$(openssl rand -hex 32)"
sed -i "s/^JWT_SECRET=.*/JWT_SECRET=${JWT_SECRET}/" .env
unset JWT_SECRET
docker compose pull
docker compose up -d --no-build
curl -f http://127.0.0.1:8080/api/health健康检查返回 {"ok":true} 后,通过 http://服务器地址:8080 打开叮卡。域名、HTTPS、备份、升级、在线图库和源码构建见部署指南。
作品存在哪里
在线版和本地运行默认用本地模式(LocalStore),账号和作品存在当前浏览器里,清理浏览器数据会一起删掉。部署了服务端就是服务器模式(RemoteStore),账号和作品存在服务器上,能跨设备同步。两边是独立的数据源,切换模式不会迁移已有的账号、作品或图片。
本地开发
需要 Git、Node.js 22+ 和 npm,不需要后端:
git clone https://github.com/lottshin/DingCard.git
cd DingCard
npm ci
npm run dev测试命令、服务器模式联调和数据存储的细节见开发指南。
文档
React、TypeScript、Vite 写成,后端是 Fastify + SQLite。以 MIT 许可开源。
Available Tools
22 toolsadd_decorationsA
把装饰素材放到一页上(一次可放多个,按顺序叠放;list_assets 的 decorations 查 id):每项给 decoration、x、y(盒子左上角的页面坐标)、width(不给按页面短边的默认比例),高度按装饰的宽高比算。color(#RRGGBB)换掉装饰本来的主色(手绘线条和贴纸换整体颜色,标签换底色,字色自动取黑或白);text 换标签上的字;rotation 旋转(度);below 填同页一个顶层节点的 id 或图层名,装饰就放在它下面一层(荧光笔、胶带、色块垫在文字下面时用),不给则放在最上层。用 documentId 时就地更新这份文档,返回每个装饰的 nodeId、path 和盒子;之后可以用 apply_actions 改,用 check_document 检查有没有压住文字。
Inputs: items (required), slideId, document, documentId, +2 more.
add_template_pagesA
把模板的页面加进一份自由画布文档,和编辑器模板面板里点一页一样:套图模板可以只加某几页(再来一张内页、换个结尾页),单页海报加进来就是新的一页。页面保留模板自己的尺寸和示例文字,之后用 inspect_document 找到图层、apply_actions 改字,check_document 会把没改的示例文字报出来。要直接按内容填好:套图的页用 create_document_from_content 每页的 templateId,海报用 create_poster_from_content 的 documentId。返回加进来的页(slideId、名称、在文档里是第几页),默认附上这些页的缩略图。
Inputs: templateId (required), pages, document, previews, +5 more.
apply_actionsA
对文档应用一串编辑动作(与编辑器 UI 同一归约器,语义完全一致),返回每个动作是否生效(changes)和没生效的原因(reasons,与 changes 一一对应:没改动时是 null,被拒时写清哪个键、哪条规则)。用 documentId 时就地更新这份文档(version 加一),传 document / documentPath 时另存为一份新文档并返回它的 documentId;动作里图片 src 写成本机文件路径的会读进来嵌入。常用:node/insert-children(插入节点)、node/update-content(改字/改数据元素内容)、node/update-style(改样式)、node/update-geometry(改位置尺寸)、slide/*(页的增删换序)、document/find-replace(整套查找替换)、document/restyle(整套换配色字体)。每个动作的完整写法见 get_guide("actions")。文档怎么写见 dingcard://schema/freeform 资源或 get_guide("document-model")。
Inputs: actions (required), document, documentId, documentPath, +1 more.
check_documentA
检查自由画布文档排出来的样子:在与导出相同的页面里排版后,逐页列出读者会注意到的问题——文字放不下、叠住、被挡住或跑出页面,对比度太低,还留着示例文字,图片没加载出来,图形、二维码、表格、图表画坏了,对齐差几 px,标题和正文拉不开层级,页面上一大片空白,该放图片的色块空着。每条带 kind、page、slideId、node(图层名)、path(apply_actions 用的节点路径)和改法,每种 kind 是什么意思见 get_guide("check")。fix: true 时把放不下的文字缩到能放下的字号、把差几 px 的对齐吸齐,并保存(用 documentId 时就地更新,返回 documentId 和 version),附改了哪些(fixed 是缩过的字号,snapped 是挪过的位置)和剩下的问题。文档怎么写见 dingcard://schema/freeform 资源或 get_guide("document-model")。
Inputs: fix, document, documentId, documentPath, +1 more.
create_document_from_contentA
按结构化内容生成一整套自由画布卡片(v44):封面 + 每个 page 一页 + 可选结尾页,风格沿用所选模板。适合已经整理好标题、正文、要点的内容;每页还能配一种数据元素(chart / table / timeline / progress)。content 的完整写法(页面字段、版式选择、数据元素、生成规则)见 get_guide("deck-content")。生成后建议先 check_document,再 render_document 看缩略图。
Inputs: content (required), templateId (required), includeDocument.
create_document_from_htmlA
把你写的 HTML/CSS 网页转成在叮卡里能逐个修改的自由画布文档(v44)。适合模板排不出来的版式:直接用网页写法排版,叮卡在浏览器里排好后,把每个色块、文字、图片和 SVG 图形读成形状、文字框、图片和图形节点,位置、字号、颜色、圆角、阴影、渐变等全部照网页来,层叠顺序按 CSS(含 z-index)。返回 documentId、每页 id 和尺寸、notes(哪里没转过来),默认附缩略图。之后 check_document 检查、apply_actions 修改、render_document 出图、open_in_editor 交给人。HTML 怎么写(section 分页、内置字体、图片、svg、表格、data-name)见 get_guide("html-import")。
Inputs: html, width, height, htmlPath, +2 more.
create_document_from_outlineA
按 Markdown 大纲生成一整套自由画布卡片(v44):封面 + 每个 "## 小节" 一页 + 可选结尾页,风格沿用所选模板;小节里的 Markdown 表格也变成这一页的表格元素。大纲的完整语法(小节、要点、引文、表格、结尾页)见 get_guide("outline")。生成后建议先 check_document,再 render_document 看缩略图。
Inputs: outline (required), templateId (required), includeDocument.
create_document_from_templateA
按模板 id 实例化一份完整的可编辑文档:自由画布模板保存在服务端,返回 documentId(之后传给 inspect_document / apply_actions / check_document / render_document 等)和各页 id、名称;Markdown 模板返回 { source, platformId, themeId, fontFamily, radius, profile, images? } 信封(可用 render_markdown 无头渲染)。
Inputs: templateId (required), includeDocument.
create_poster_from_contentA
按内容生成一张海报(单页模板:小红书封面、菜单、价目表、证书、九宫格、课程表、各种海报、请柬、贺卡、封面、宣传单、数据盘点、对比表、成长记录等),尺寸跟模板走。模板里的示例文字全部换成内容,没给的连同它的底板、按钮一起删掉。不同模板吃不同的字段(菜单的 details、课程表的 table、数据盘点的 chart、证书的 recipient),content 每个字段的写法和放不下时怎么排见 get_guide("poster-content");summary.moved / unplaced / shrunk 说明文字放到了哪里、缩了多少。给 documentId 时海报加成那份文档的一页。
Inputs: content (required), templateId (required), document, documentId, +3 more.
get_documentA
取回一份文档的完整 JSON:给 path 时写成 JSON 文件(目录不存在会创建)并返回路径,不给时直接返回文档。写成文件的文档可以拖进叮卡「我的项目」,或之后用 documentPath 传回来。
Inputs: path, document, documentId, documentPath.
get_guideA
按主题读一份使用指南:文档怎么写、每个动作怎么发、content / outline / 海报内容怎么填、HTML 怎么写、模板字段和检查项是什么意思、渲染导出有哪些方式。工具说明里只写了做什么;要动手写参数之前,先来这里读对应主题的完整写法。section 给主题 id(不给就列出全部主题 id 和标题):document-model 文档模型、actions 动作清单、deck-content 套图内容、outline Markdown 大纲、poster-content 海报内容、html-import 网页转文档、templates 模板清单、check 检查项、render-export 渲染与导出。
Inputs: section.
import_stock_imageA
把 search_images 选中的一张照片通过部署的服务端转存到账号的图片库里,得到稳定的原图地址(比缩略图清晰,也不会因为图库改链接而失效)。返回的 url 直接填进图片字段。需要 DINGCARD_SERVER_URL(和账号);没配置时不用转存,直接用 search_images 结果里的 url。
Inputs: id (required), source (required).
inspect_documentA
检查文档结构:页面摘要(尺寸/背景/节点数)与递归节点树(id、name、type、几何、文本摘要;内置图标标出 icon id,装饰素材标出 decoration id,组成装饰的组也标在组上),以及整套卡片的 style:用到的颜色(按占的面积排序,附 share 和用在 background/fill/text/line/shadow 哪些地方)、字体(texts 用了几段文字、largest 最大字号)和正文字号 bodySize。改文档前先 inspect,拿到节点 id / 路径再发动作。文档怎么写见 dingcard://schema/freeform 资源或 get_guide("document-model")。
Inputs: document, documentId, documentPath.
list_assetsA
查内置素材与样式清单,kind 选一类:icons 内置图标(query 中文或英文搜、ids 按 id 取;example 是可直接 node/insert-children 的完整 path 节点)、decorations 装饰素材(手绘线条、贴纸、标签;category 只看一类,用 add_decorations 放置)、styles 配色与字体组合(document/restyle 一键套用)、text_styles 现成花字(patch 直接作为 node/update-style 的补丁)、collages 拼图版式(example 是完整的拼图组节点,格子换图片填充)、filter_presets 照片滤镜预设(patch 同样给 node/update-style)。不给 kind 返回每类的条数和用法。
Inputs: ids, kind, query, category, +2 more.
list_templatesA
列出叮卡内置模板,按内容和尺寸挑模板、拿 templateId。默认每个模板一张简卡:id、标题、描述、kind、format(尺寸 id)、uses(用途)、styles(风格)。kind 是 deck(一整套,用 create_document_from_content / create_document_from_outline 生成)或 poster(单页,用 create_poster_from_content 生成)。kind / format / q 只取子集(如 kind: "poster"、format: "xhs"、q: "菜单")。挑出两三个候选后用 ids 取详情:每页能放多少要点(capacity)、海报有哪些位置(posterCapacity)、颜色、标签和像素尺寸,字段含义见 get_guide("templates")。不同页可以用不同模板:create_document_from_content 的每页可以写自己的 templateId,add_template_pages 把任何模板的某几页加进已有文档。
Inputs: q, ids, kind, format.
open_in_editorA
在叮卡编辑器里打开这份自由画布文档,方便人接着手改:服务端把文档放在本机地址上,在浏览器里打开编辑器的导入链接,编辑器读进来存成一个新项目(不登录也行,存在这台设备的浏览器里)。默认打开服务端自带的编辑器 http://127.0.0.1:5390(DINGCARD_APP_PORT 可改端口,被占用时换一个空闲端口);设了环境变量 DINGCARD_APP_URL 或传 appUrl,就在那个叮卡里打开。open: false 只返回链接(url)不打开浏览器。
Inputs: open, title, appUrl, document, +2 more.
render_documentA
把自由画布 v44 文档(v1–43 输入自动迁移)无头渲染为图片或 PDF(与编辑器导出同一管线:网页字体按字符子集嵌入、图片就绪等待、逐页导出),默认逐页 PNG 到 outputDir,另附每页小缩略图供你直接查看效果。长图、九宫格、PDF、JPEG、倍率等输出方式见 get_guide("render-export")。仅支持自由画布文档;文档中的图片 src 必须是浏览器可加载的 URL 或 data URL。文档怎么写见 dingcard://schema/freeform 资源或 get_guide("document-model")。
Inputs: outputDir (required), grid, long, scale, +8 more.
render_markdownA
把 Markdown 文档信封无头渲染为一套卡片 PNG(与 Markdown 工作台导出同一管线:DOM 实测分页、平台头部与主题、网页字体按字符子集嵌入、逐页 pixelRatio 3 导出)。输出 -01.png、-02.png… 到 outputDir;页数由分页决定。 document 为 Markdown 文档信封:{ source: Markdown 文本(--- 为手动分页), platformId: 'rednote'|'weibo'|'twitter', themeId: 主题 id(如 'light'), fontFamily, radius: 数字圆角, profile: { nickname, handle, location, avatarColor, avatarImage: dataURL 或 null, verified, headerFirstPageOnly }, images?: { "img:": dataURL } }。
Inputs: document (required), outputDir (required), baseName, previews.
search_imagesA
搜索在线图库的照片,给卡片配图:返回缩略图和能直接使用的图片地址,把它们填进图片字段(create_poster_from_content 的 image、图片节点的 src、页面的图片背景都接受 http(s) 地址)。配置了 DINGCARD_SERVER_URL(和账号)时走部署服务端的图库代理(Pixabay / Unsplash / Pexels / Openverse,密钥留在服务端),选中的图用 import_stock_image 转存成账号里的稳定地址;没配置时直连 Openverse(免密钥、只搜 CC0 可商用图),结果里的 url 可以直接用、无需转存。搜索词用中英文内容词都行,如 "咖啡馆 内景"、"city night skyline"。
Inputs: query (required), page, source.
server_projectsA
管部署的叮卡服务端账号里存的作品(人在编辑器里存的,AI 接着做):action 选操作——list 列出作品(id、标题、类型 mode、更新时间,query 按标题过滤,这是接着做已有作品的第一步)、open 按 id 载入(自由画布作品返回 documentId,之后 inspect_document / apply_actions / render_document / share_document 都能用;Markdown 作品返回 markdownDocument 信封,交给 render_markdown)、save 把一份文档存回账号(不给 projectId 存成新作品,给 open 返回的 projectId 时覆盖那一份)。需要环境变量 DINGCARD_SERVER_URL 加 DINGCARD_SERVER_TOKEN(带 drafts 权限的 API 令牌)或账号环境变量。
Inputs: action (required), id, query, title, +5 more.
validate_documentA
校验文档是否为合法的自由画布 v44 文档(v1–43 自动迁移,src 是本机路径的图片读进来嵌入);合法时保存在服务端并返回 documentId(已有 documentId 的照旧),非法时返回原因:第几页、哪个节点、多了或缺了哪个键,或者该写哪个 documentVersion。 文档速写:{ documentVersion: 44, slides: [{ id, name, width(128–4096), height(128–4096), background, nodes, guides? }], activeSlideId };节点 11 选一(text / image / shape / line / path / qrcode / chart / table / timeline / progress / group),公共必填键 id, name, locked, hidden, type, x, y, rotation, scale,其余键按节点类型精确匹配(不多不少),全文档节点 id 唯一。每种节点的完整键表见 dingcard://schema/freeform 资源或 get_guide("document-model"),写之前先读;拿不准就先写个大概来校验,按返回的原因改。
Inputs: document, documentId, documentPath, includeDocument.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 22 tools
Each tool has a well-described distinct role, but there are five creation entry points (from_content, from_outline, from_template, from_html, create_poster_from_content) whose boundaries an agent must infer from content-shape nuances, and three quality tools (validate_document= schema, inspect_document= structure, check_document= visual problems) whose names alone don't clearly separate them. The detailed descriptions do resolve most confusion, so it lands at mostly-distinct with a few confusable pairs.
A strong snake_case verb_noun convention dominates: create_*_from_*, get_document, list_templates, add_decorations, apply_actions, check_document, render_markdown, share_document. The exceptions are minor — server_projects is a bare noun multiplexed by an action param, and add_template_pages/add_decorations mix patterns but stay readable.
22 tools is on the heavy side for a card-design server, and part of that weight is genuine overlap: five separate document-creation tools plus three inspection/validation tools could be consolidated behind parameters. Every tool does earn a place in the workflow, but the surface feels broader than strictly necessary.
The lifecycle is nearly end-to-end: authoring (template/content/outline/HTML/poster), editing (apply_actions), validation/inspection/visual checking, rendering, local editor handoff, sharing, server project management, plus asset/template/stock-image discovery. Minor gaps exist — no document deletion, duplication, or local document listing — but agents can work around these.
Maintenance
Related MCP Connectors
Generate branded images at scale: design templates and render them to PNGs by prompt.
Render on-brand images, PDFs and videos from templates; create and edit templates and brands.
JSON in, PDF out. Render invoices, certificates, reports and cards from a template and a payload.
Render PDFs from templates you design once: list templates, check the data shape, preview, render.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceProduct mockup rendering API for e-commerce and print-on-demand. Upload Photoshop PSD templates, render photorealistic mockups by placing your designs onto smart object layers. 9 tools including AI-powered render (no PSD needed), template management, and account info. Supports remote HTTP (OAuth) and local stdio (npx) transports.1,116 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to create high-resolution marketing images from simple JSON configs without design skills or API keys. Provides presets, themes, and layouts to render deterministic PNGs locally.MIT

formfeedofficial
AlicenseAqualityBmaintenanceRender PDFs and images from HTML templates (Jinja2, Liquid, Handlebars) or Word and PowerPoint files through the Formfeed API, check data against a template's schema before rendering, and convert Office documents to PDF.181MIT
keyline-mcpofficial
FlicenseNot gradedqualityBmaintenanceEnables AI agents to author designs as structured JSON scenes and render them to PNG, JPEG, WebP, vector PDF, animated PNG, GIF, MP4 or WebM at every target size, using one native binary with no browser or headless Chrome.6-