tldraw MCP Server
Provides tools for creating and editing tldraw diagrams, supporting all 14 shape types, arrow bindings, document management, and more.
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 Server Create a diagram with a rectangle labeled 'Server' and an arrow to a cloud shape"
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 Server
A full-featured Model Context Protocol (MCP) server that lets AI assistants like Claude create and edit tldraw diagrams programmatically. With 30 tools across 7 categories, it supports all 14 tldraw shape types and produces standard .tldr files.
What is MCP?
The Model Context Protocol is an open standard that allows AI models to interact with external tools and services. This server exposes tldraw's drawing capabilities as MCP tools, enabling Claude (or any MCP-compatible client) to create complex diagrams, flowcharts, wireframes, and more — all through natural language.
Related MCP server: tldraw MCP Server
Features
14 shape types: geo, text, arrow, note, frame, draw, line, image, video, bookmark, embed, highlight, and more
30 tools organized into 7 categories
Rich text support with tldraw's native format
Arrow bindings — connect shapes with smart arrows
Full document lifecycle — create, load, save, and export
.tldrfilesZero browser dependencies — pure Node.js, generates files directly
Prerequisites
Node.js 18+
npm or compatible package manager
An MCP-compatible client (Claude Code, Claude Desktop, etc.)
Installation
git clone https://github.com/AndresMuelas2004/tldraw-mcp-server.git
cd tldraw-mcp-server
npm install
npm run buildConfiguration
Claude Code
Add to your Claude Code MCP settings:
{
"mcpServers": {
"tldraw": {
"command": "node",
"args": ["C:/path/to/tldraw-mcp-server/dist/index.js"]
}
}
}Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"tldraw": {
"command": "node",
"args": ["C:/path/to/tldraw-mcp-server/dist/index.js"]
}
}
}Replace C:/path/to/tldraw-mcp-server with the actual path to the cloned repository.
Available Tools
Document Management
Tool | Description |
| Create a new empty document |
| Load a |
| Save the current document |
| Get document metadata |
Shape Creation (14 types)
Tool | Description |
| Geometric shapes (rectangle, ellipse, diamond, star, cloud, etc.) |
| Text labels |
| Arrows (with optional bindings) |
| Sticky notes |
| Frames for grouping |
| Freehand drawings |
| Multi-point lines |
| Image shapes |
| Video embeds |
| URL bookmarks |
| Embedded content |
| Highlighter strokes |
Connections
Tool | Description |
| Bind arrow endpoints to shapes |
| Remove arrow bindings |
Shape Manipulation
Tool | Description |
| Move shapes to new coordinates |
| Resize shapes |
| Rotate shapes |
| Delete shapes |
| Duplicate shapes |
| Change shape styles |
| Set shape opacity |
| Update any shape property |
| Lock/unlock shapes |
Grouping & Ordering
Tool | Description |
| Group shapes together |
| Ungroup shapes |
| Move shapes into frames/groups |
| Change z-order (front/back) |
Pages
Tool | Description |
| Create a new page |
| List all pages |
| Rename a page |
| Delete a page |
| Reorder pages |
Query & Camera
Tool | Description |
| List all shapes on a page |
| Get shape details by ID |
| List all bindings |
| Get bindings for a specific shape |
| List all assets |
| Set camera position and zoom |
Project Structure
tldraw-mcp-server/
├── src/
│ ├── index.ts # Server entry point
│ ├── register-tools.ts # Tool registration
│ ├── schemas/ # Zod schemas for shapes and styles
│ ├── state/ # Document state management
│ ├── tools/ # Tool implementations (one file per category)
│ └── utils/ # Helpers (IDs, indices, rich text, defaults)
├── examples/ # Usage examples (diagram generation, serving)
├── dist/ # Compiled output (generated)
├── package.json
└── tsconfig.jsonExamples
The examples/ directory contains scripts that demonstrate usage:
generate-diagram.mjs— Builds a complete multi-shape diagram programmaticallyserve-tldr.mjs— Serves a.tldrfile over HTTPserve-html.mjs— Serves an HTML export of a diagraminject-diagram.mjs— Encodes a.tldras base64 for browser injectionprep-inject.mjs— Generates a Playwright-compatible inject functionpw-inject.mjs— Full Playwright script for injecting diagrams into tldraw
# Build first
npm run build
# Generate a sample diagram
node examples/generate-diagram.mjsContributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch (
git checkout -b feature/my-feature)Commit your changes
Push to the branch and open a Pull Request
License
Available Tools
41 toolstldraw_bind_arrowA
Bind an arrow's start or end terminal to a target shape. This creates a visual connection that follows the shape when moved.
Inputs: arrowId (required), terminal (required), targetShapeId (required), isExact, +2 more.
tldraw_create_arrowB
Create an arrow shape. Supports straight, curved (bend), and auto-binding to shapes. Set startBinding/endBinding to connect the arrow to shapes.
Inputs: x (required), y (required), pageId (required), bend, +19 more.
tldraw_create_assetA
Create an asset record (image, video, or bookmark). Use the returned asset ID with shape creation tools like tldraw_create_image or tldraw_create_video.
Inputs: src (required), type (required), h, w, +4 more.
tldraw_create_bookmarkB
Create a bookmark shape that displays a URL preview card.
Inputs: x (required), y (required), url (required), pageId (required), +7 more.
tldraw_create_drawA
Create a freehand drawing shape from an array of points. Points are encoded into tldraw's internal format automatically.
Inputs: x (required), y (required), pageId (required), points (required), +9 more.
tldraw_create_embedB
Create an embed shape for external content (YouTube, Figma, CodeSandbox, Google Maps, etc.).
Inputs: x (required), y (required), url (required), pageId (required), +6 more.
tldraw_create_frameA
Create a frame shape. Frames act as containers — other shapes can be reparented into them using tldraw_reparent_shapes.
Inputs: x (required), y (required), pageId (required), h, +6 more.
tldraw_create_geoB
Create a geometric shape. 20 subtypes available: rectangle, ellipse, triangle, diamond, pentagon, hexagon, octagon, star, rhombus, rhombus-2, oval, trapezoid, arrow-right, arrow-left, arrow-up, arrow-down, x-box, check-box, cloud, heart. Supports text labels inside the shape.
Inputs: x (required), y (required), pageId (required), h, +15 more.
tldraw_create_highlightA
Create a highlighter stroke shape from an array of points. Similar to draw but with translucent highlight appearance.
Inputs: x (required), y (required), pageId (required), points (required), +6 more.
tldraw_create_imageB
Create an image shape. Requires an asset ID (create one first with tldraw_create_asset).
Inputs: x (required), y (required), pageId (required), assetId (required), +9 more.
tldraw_create_lineB
Create a line shape with multiple control points. Supports straight line segments or cubic spline interpolation.
Inputs: x (required), y (required), pageId (required), points (required), +8 more.
tldraw_create_noteA
Create a sticky note shape. Notes have a fixed square size and colored background.
Inputs: x (required), y (required), pageId (required), font, +10 more.
tldraw_create_pageA
Add a new page to the document.
Inputs: name.
tldraw_create_textC
Create a text shape on the canvas.
Inputs: x (required), y (required), text (required), pageId (required), +11 more.
tldraw_create_videoA
Create a video shape. Requires an asset ID (create one first with tldraw_create_asset).
Inputs: x (required), y (required), pageId (required), assetId (required), +8 more.
tldraw_delete_pageA
Delete a page and all its shapes. Cannot delete the last remaining page.
Inputs: pageId (required).
tldraw_delete_shapesA
Delete shapes and cascade-delete their bindings and children.
Inputs: shapeIds (required).
tldraw_duplicate_shapesB
Duplicate shapes with an optional offset.
Inputs: shapeIds (required), offsetX, offsetY.
tldraw_get_bindings_for_shapeB
Get all bindings (arrow connections) that involve a specific shape.
Inputs: shapeId (required).
tldraw_get_document_infoA
Get an overview of the current document: pages, shape counts per page, total bindings, and assets.
Inputs: no named parameters.
tldraw_get_shapeB
Get full details of a shape including all its properties.
Inputs: shapeId (required).
tldraw_group_shapesA
Group multiple shapes together into a group shape. Minimum 2 shapes required.
Inputs: pageId (required), shapeIds (required).
tldraw_list_assetsB
List all assets in the current document.
Inputs: no named parameters.
tldraw_list_bindingsA
List all bindings (arrow connections) in the document, optionally filtered by page.
Inputs: pageId.
tldraw_list_pagesA
List all pages in the document with their IDs, names, and shape counts.
Inputs: no named parameters.
tldraw_list_shapesA
List shapes on a page. Optionally filter by shape type and/or color.
Inputs: pageId (required), type, color.
tldraw_lock_shapesA
Lock or unlock shapes. Locked shapes cannot be selected or moved in the UI.
Inputs: isLocked (required), shapeIds (required).
tldraw_move_shapesB
Move shapes by delta (relative) or to absolute position. Provide deltaX/deltaY for relative moves, or toX/toY for absolute positioning.
Inputs: shapeIds (required), toX, toY, deltaX, +1 more.
tldraw_rename_pageB
Rename a page.
Inputs: name (required), pageId (required).
tldraw_reorder_pageA
Move a page before or after another page in the page list.
Inputs: pageId (required), position (required), referencePageId (required).
tldraw_reorder_shapesA
Change z-order of shapes: move to front, to back, one step forward, or one step backward.
Inputs: shapeIds (required), operation (required).
tldraw_reparent_shapesA
Move shapes into or out of frames/groups. Set newParentId to a frame/group ID to nest, or to a page ID to un-nest.
Inputs: shapeIds (required), newParentId (required).
tldraw_resize_shapesC
Set width and/or height of shapes.
Inputs: shapeIds (required), h, w.
tldraw_restyle_shapesA
Change visual style properties of shapes (color, fill, dash, size, font).
Inputs: shapeIds (required), dash, fill, font, +2 more.
tldraw_rotate_shapesB
Set rotation of shapes in radians.
Inputs: rotation (required), shapeIds (required).
tldraw_save_documentA
Save the current document to a .tldr file on disk.
Inputs: filePath (required).
tldraw_set_cameraA
Set the camera (viewport) position and zoom level for a page.
Inputs: pageId (required), x, y, z.
tldraw_set_opacityA
Set opacity of shapes (0 = transparent, 1 = fully opaque).
Inputs: opacity (required), shapeIds (required).
tldraw_unbind_arrowB
Remove the binding from an arrow's start or end terminal.
Inputs: arrowId (required), terminal (required).
tldraw_ungroup_shapesB
Dissolve a group, promoting its children back to the parent level.
Inputs: groupId (required).
tldraw_update_shape_propsC
Low-level: directly set any properties on a shape's props object. Use with caution.
Inputs: props (required), shapeId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 41 tools
Each tool targets a distinct action and resource type. For example, the 12 create tools each handle a different shape type (geo, text, arrow, draw, line, note, frame, image, video, embed, highlight, bookmark), and all manipulation tools (move, resize, rotate, delete, etc.) are clearly separated. There is no functional overlap or confusion between tools.
All tools follow a consistent 'tldraw_verb_noun' pattern in snake_case, with clear verbs like create, list, get, set, delete, rename, etc. The naming is predictable and uniform, making it easy for an agent to infer the action from the tool name.
With 41 tools, the count exceeds the typical well-scoped range (3-15) significantly. While each tool serves a specific purpose, the sheer number can overwhelm an agent and suggests that some consolidation could be beneficial (e.g., merging the many create tools or using parameters). The scope is broad, but the tool count feels heavy.
The tool surface covers the full lifecycle of tldraw documents, pages, shapes (creation, manipulation, styling, grouping, binding), assets, and camera control. It includes CRUD operations for pages, a wide range of shape types, and support for bindings and assets. There are no obvious gaps for typical drawing and diagramming workflows.
Maintenance
Related MCP Connectors
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
Generate and edit images, video, voice and music from any MCP client. 50 tools, 46 models.
Make videos, images, voice and avatars from your AI assistant. 50 tools on a hosted MCP server.
AI tool directory MCP server, live since July 2026. Tools, agents, models, companies, services.
Related MCP Servers
- AlicenseAqualityDmaintenanceA minimal MCP server for AI-driven canvas manipulation and visualization using tldraw. It enables AI clients to programmatically create, update, and manage shapes, flowcharts, and frames on a live interactive canvas.92MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that gives AI agents programmatic control over a live tldraw canvas, enabling diagram creation through natural language.1MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI agents to create beautiful ASCII diagrams using Unicode box-drawing characters, with support for stateful canvas operations, multiple shape types, and style customization.2-
- AlicenseBqualityCmaintenanceMCP server that enables AI assistants to create, parse, render, and validate Draw.io diagrams programmatically.1465 PyPI2MIT