tl-draw-mcp
tl-draw-mcp
MCP 服务器 + Claude Code 技能,让 Claude 可以根据提示在实时 tldraw 画布上绘图。
在任何浏览器中打开
http://localhost:3030→ Claude 的绘图会实时显示。四个工具:
create_shape、update_shape、delete_shape、get_canvas。纯 JS,MIT 协议,优先支持 Windows。
1. 安装
git clone <this repo> tl-draw-mcp
cd tl-draw-mcp
npm install
cd packages\web && npm run build
cd ..\server && npm run buildRelated MCP server: Excalidraw MCP Server
2. 集成到 Claude Code
单行命令(推荐 — 无需编辑 JSON):
claude mcp add tldraw --scope user -- cmd /c node "D:/path/to/tl-draw-mcp/packages/server/dist/index.js"验证:
claude mcp list你应该能看到 tldraw 被列出。重启 Claude Code。
3. 安装技能
复制技能文件夹,以便 Claude 知道何时绘图:
xcopy /E /I .claude\skills\tldraw %USERPROFILE%\.claude\skills\tldraw4. 使用
在任何项目中启动 Claude Code。
第一次工具调用将启动服务器 — 打开
http://localhost:3030。右下角的徽章显示
tldraw MCP · connected。提示词:
画一个登录流程的流程图。
5. 开发
cd packages\server && npm test :: 12 handler tests
cd packages\server && npm run dev :: stdio + WS bridge on :3030
cd packages\web && npm run dev :: Vite HMR on :51736. 布局
packages/server MCP stdio server, WS bridge, static host, tool handlers
packages/web Vite + React + tldraw browser app (builds into server/public)
.claude/skills/ SKILL.md for Claude Code
examples/ sample MCP config (if you prefer JSON over the CLI)7. 故障排除
症状 | 修复方法 |
徽章显示 | :3030 端口上有陈旧的服务器进程。执行 |
浏览器中出现 Tldraw 验证错误 | 清除 IndexedDB(F12 → Application → IndexedDB → 删除 |
端口 :3030 被占用 | 服务器会自动回退到 :3031 等端口。通过 |
| 使用 |
查看 plan.md 获取设计说明,查看 LICENSE 获取 MIT 条款。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
This server cannot be deployed
Maintenance
Related MCP Connectors
Whiteboard where any shape opens into another canvas. Claude Code and Codex plugins render plans on it.
Give Claude a whiteboard: notes, links, images and diagrams on a board you both see and edit.
Online whiteboard your AI agent draws on: live shared canvases, solo or with your team.
Create and edit architecture diagrams from your AI agent; get an SVG and a live editable canvas.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to read, write, and search local tldraw (.tldr) files, providing a persistent visual scratchpad for diagramming and note organization. It supports full CRUD operations on canvas shapes and metadata management for local canvas files.14 npm3MIT
- AlicenseAqualityDmaintenanceEnables AI agents to programmatically generate, edit, and view Excalidraw diagrams with real-time browser synchronization. It provides a suite of tools for adding shapes, text, and arrows to diagrams through natural language interactions.113,555 npm102MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to programmatically control a live Excalidraw canvas through element-level CRUD operations and real-time synchronization. It allows agents to iteratively build, inspect, and refine diagrams while providing visual feedback via screenshots and scene descriptions.3,181 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to programmatically control a live Excalidraw canvas with element-level CRUD operations and real-time synchronization. It supports iterative diagramming through scene descriptions, screenshots, and advanced layout tools for collaborative AI-human workflows.3,181 npm2MIT