tldraw MCP Server
Provides tools for creating and editing tldraw diagrams, supporting all 14 shape types, arrow bindings, document management, and more.
Click on "Install 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 ServerCreate 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.
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
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AndresMuelas2004/tldraw-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server