tldraw MCP Server
Community MCP server for reading, writing, and editing local tldraw (.tldr) canvas files, turning tldraw into a programmable visual scratchpad for AI agents.
tldraw is an infinite canvas SDK for drawing, diagramming, and visual collaboration. There is no official MCP server published by tldraw, but several community implementations exist. This entry documents @talhaorak/tldraw-mcp, a community MCP server that lets AI agents like Claude read, write, search, and edit local tldraw canvas files (.tldr) on disk.
The server treats a directory of .tldr files as a persistent visual workspace. Agents can list and search canvases, retrieve shapes, and programmatically create, update, or delete shapes within them. It works with the tldraw v2 file format, includes path traversal protection, and validates writes to keep files compatible with the tldraw editor.
Notable alternatives in the same ecosystem include dpunj/tldraw-mcp (in-memory canvas with a live widget UI) and @joelhooks/tldraw-agent (text-to-diagram generation backed by an AI Gateway). Pick the variant that matches whether you want file persistence, a live canvas, or one-shot diagram generation.
Tools
| Tool | Description |
|---|---|
tldraw_read |
Load and parse a .tldr canvas file from disk. |
tldraw_write |
Create or update a .tldr file with format validation. |
tldraw_create |
Initialize a new empty .tldr canvas file. |
tldraw_list |
Enumerate all .tldr files in the configured directory with metadata. |
tldraw_search |
Run full-text search across .tldr canvas files. |
tldraw_get_shapes |
Retrieve shapes from a canvas, optionally filtered by page. |
tldraw_add_shape |
Insert a new shape into a canvas programmatically. |
tldraw_update_shape |
Modify properties of an existing shape. |
tldraw_delete_shape |
Remove a shape from a canvas. |
Prerequisites
- Node.js installed
- A directory where
.tldrfiles will be stored (defaults to~/.tldraw) - No API key or authentication required, the server operates on local files
Installation
Run directly via npx:
npx @talhaorak/tldraw-mcp
Claude Desktop config
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or the equivalent path on your OS:
{
"mcpServers": {
"tldraw": {
"command": "npx",
"args": ["@talhaorak/tldraw-mcp"],
"env": {
"TLDRAW_DIR": "/path/to/your/tldraw/files"
}
}
}
}
Set TLDRAW_DIR to the folder you want the agent to read and write canvases in. Restart Claude Desktop after editing the config.
Opening canvases
The server produces standard .tldr files. Open them in the tldraw web editor at https://tldraw.com or in any tldraw-compatible client to view and edit visually.
- Maintain a persistent library of diagrams that an AI assistant can update over time, for example architecture diagrams that evolve with the codebase.
- Generate flowcharts and shape layouts from natural language and save them as
.tldrfiles to open in the tldraw editor. - Search across an existing collection of
.tldrcanvases to find diagrams containing specific text or labels. - Programmatically add, move, or remove shapes in a canvas as part of an agent workflow, for example annotating an existing system diagram with new components.
- Use tldraw files as a visual scratchpad where the agent records ideas, decisions, or plans as shapes and arrows.
- "Create a new tldraw canvas called
auth-flow.tldrwith a flowchart of the login sequence." - "List all
.tldrfiles in my tldraw directory and summarize what each one contains." - "Search my canvases for any diagram that mentions
paymentsand open it." - "Add a red rectangle labeled
Cacheconnected to the existingAPInode inarchitecture.tldr." - "Delete the deprecated
LegacyServiceshape fromsystem-map.tldr."
- Simple
npxinstall with no API keys or external services required. - Operates on standard
.tldrfiles so output opens directly in the tldraw editor. - Covers a useful surface area for agent workflows: create, read, update, delete, list, and search.
- Includes path traversal protection and write-time validation.
- Community maintained, not an official tldraw project, so long-term support is not guaranteed.
- File-based only, no live canvas or real-time collaboration features.
- Limited high-level helpers, complex layouts require explicit shape positioning by the agent.
- dpunj/tldraw-mcp: in-memory canvas with a live Next.js widget that the agent draws on in real time.
- joelhooks/tldraw-agent: text-to-diagram CLI and MCP server backed by an AI Gateway, focused on one-shot diagram generation.
- AndresMuelas2004/tldraw-mcp-server: larger tool surface (30 tools, 14 shape types) for programmatically creating tldraw documents.