tldraw-mcp
Enables AI-driven manipulation of a tldraw canvas, including tools for creating, updating, and deleting shapes, managing frames, and generating auto-layout flowcharts.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tldraw-mcp Draw a flowchart showing the user authentication process"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tldraw-mcp
Minimal MCP server for AI-driven canvas manipulation with tldraw.
Architecture
┌─────────────┐ stdio ┌─────────────┐ WebSocket ┌─────────────┐
│ AI Client │◄──────────────►│ tldraw-mcp │◄───────────────►│ Widget │
│ (Claude,etc)│ │ (server) │ :4000 │ (tldraw) │
└─────────────┘ └─────────────┘ └─────────────┘
:3000Related MCP server: tldraw MCP Server
Tools
Tool | Description |
| Create shapes (rectangle, ellipse, star, cloud, diamond, etc.) |
| Update shape properties (position, size, color, fill) |
| Delete shapes by ID |
| Connect two shapes with an arrow |
| Create a frame to group shapes together |
| Create a flowchart with nodes and edges (auto-layout) |
| Get current canvas state |
| Zoom canvas to fit all shapes |
| Clear all shapes |
Quick Start
# 1. Clone and install
git clone https://github.com/dpunj/tldraw-mcp
cd tldraw-mcp
bun install
# 2. Start the widget (tldraw canvas + WebSocket server)
cd widget
bun install
bun run dev
# Opens http://localhost:3000 (canvas) + ws://localhost:4000 (relay)
# 3. In another terminal, test the MCP server
cd ..
bun run devClaude Desktop Config
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"tldraw": {
"command": "bun",
"args": ["run", "/path/to/tldraw-mcp/src/index.ts"]
}
}
}Environment Variables
Variable | Default | Description |
|
| Widget WebSocket URL |
|
| Widget WS server port |
Development
# MCP server
bun run dev # Run server
bun run build # Build for distribution
bun run check # TypeScript check
# Widget
cd widget
bun run dev # Start vite + WS serverLicense
MIT
Available Tools
9 toolsclear_canvasA
Remove all shapes from the canvas
Inputs: no named parameters.
connect_shapesC
Connect two shapes with an arrow
Inputs: from (required), to (required), label.
create_flowchartC
Create a flowchart diagram with nodes and connections. Nodes are auto-arranged.
Inputs: nodes (required), edges, direction.
create_frameC
Create a frame to group shapes together
Inputs: x (required), y (required), width, height, +1 more.
create_shapeC
Create a shape on the canvas (rectangle, ellipse, text, note, etc.)
Inputs: type (required), x (required), y (required), width, +5 more.
delete_shapesC
Delete one or more shapes from the canvas
Inputs: ids (required).
get_snapshotB
Get current state of all shapes on the canvas
Inputs: no named parameters.
update_shapeC
Update properties of an existing shape
Inputs: id (required), x, y, width, +4 more.
zoom_to_fitA
Zoom the canvas to fit all shapes in view
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Every tool has a clearly distinct purpose with no ambiguity. For example, create_shape makes individual shapes, create_frame groups them, create_flowchart auto-arranges nodes, and connect_shapes specifically adds arrows between shapes. The actions (clear, create, delete, get, update, zoom) are well-separated by target objects.
All tools follow a consistent verb_noun pattern using snake_case throughout. Verbs like create, delete, update, get, clear, connect, and zoom are applied predictably to nouns like canvas, shapes, flowchart, frame, snapshot, ensuring readability and predictability across the set.
With 9 tools, this is well-scoped for a diagramming/canvas server. Each tool earns its place by covering distinct operations like creation, modification, deletion, viewing, and canvas management, without being overly sparse or bloated for the domain.
The tool surface provides complete CRUD/lifecycle coverage for canvas shapes and diagrams. It includes creation (create_shape, create_frame, create_flowchart), reading (get_snapshot), updating (update_shape, connect_shapes), deletion (delete_shapes, clear_canvas), and utility (zoom_to_fit), with no obvious gaps for the stated purpose.
Maintenance
Related MCP Connectors
Connect AI agents to Flato's editable canvas runtime through a hosted MCP server.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Cloud-hosted MCP server for durable AI memory
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Related MCP Servers
- FlicenseAqualityDmaintenanceMinimal MCP server for editing tldraw .tldr files via JSON manipulation. Headless, no browser needed.181-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that gives AI agents programmatic control over a live tldraw canvas, enabling diagram creation through natural language.1MIT
- AlicenseNot gradedqualityDmaintenanceA MCP server that bridges web canvas with local Codex/Claude, exposing 23 tools for reading, creating, modifying, connecting, and generating canvas content via local HTTP bridge and stdio MCP.AGPL 3.0
- AlicenseAqualityDmaintenanceA full-featured MCP server that lets AI assistants create and edit tldraw diagrams programmatically with 30 tools across all 14 shape types.433MIT