You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -21,6 +20,14 @@ An MCP server that gives AI agents (AdaL, Claude, Cursor, Codex CLI…) programm
21
20
22
21
**Inspired by**[mcp_excalidraw](https://github.com/yctimlin/mcp_excalidraw) — the same quality and completeness, built for the tldraw ecosystem.
23
22
23
+
## Architecture
24
+
25
+
<imgsrc="assets/architecture-diagram.png"alt="tldraw MCP Server architecture — three-layer flow from MCP clients through the MCP server to the canvas server and browser UI" />
26
+
27
+
**Flow:** MCP client → MCP server (Zod validation) → Canvas server (Express HTTP) → WebSocket broadcast → Browser (tldraw editor, real time).
28
+
29
+
---
30
+
24
31
## Quick Start
25
32
26
33
### Prerequisites
@@ -68,52 +75,31 @@ The `.mcp.json` at the repo root works out-of-the-box for any project-level MCP
68
75
69
76
## MCP Client Configuration
70
77
71
-
The default launch mode is still **stdio**, so existing AdaL/Claude/Cursor configs continue to work. Set `MCP_TRANSPORT=http`only when you want a shared Streamable HTTP endpoint.
78
+
The default transport is **stdio**, so existing configs continue to work. Set `MCP_TRANSPORT=http`for shared HTTP endpoints (OpenAI Agents SDK, etc.).
72
79
73
80
### Transport and adapter options
74
81
75
82
| Variable | Default | Purpose |
76
83
|----------|---------|---------|
77
84
|`MCP_TRANSPORT`|`stdio`|`stdio` for subprocess clients, `http` for Streamable HTTP |
If you need an HTTP endpoint while keeping the stdio server path,`supergateway`can wrap the existing command:
227
+
Wrap the stdio server with`supergateway`for an HTTP endpoint:
260
228
261
229
```bash
262
230
npx -y supergateway \
@@ -289,13 +257,11 @@ WantedBy=multi-user.target
289
257
290
258
### Migration and rollback
291
259
292
-
No migration is required for existing AdaL users: stdio remains the default. To roll back optional behavior, unset `MCP_TRANSPORT`, `MCP_PERFORMANCE_MODE`, and `INCLUDE_SERVER_IN_TOOL_NAMES`, then use the original `.mcp.json` shape with only `EXPRESS_SERVER_URL`.
260
+
No migration is required for existing AdaL users — stdio remains the default. To roll back optional behavior, unset `MCP_TRANSPORT`, `MCP_PERFORMANCE_MODE`, and `INCLUDE_SERVER_IN_TOOL_NAMES`, then use the original `.mcp.json` shape with only `EXPRESS_SERVER_URL`.
293
261
294
262
---
295
263
296
-
## MCP Tools
297
-
298
-
### Implemented (20 tools)
264
+
## MCP Tools (20 tools)
299
265
300
266
| Tool | Description |
301
267
|------|-------------|
@@ -304,7 +270,7 @@ No migration is required for existing AdaL users: stdio remains the default. To
304
270
|`update_element`| Partially update any element property |
305
271
|`delete_element`| Delete an element by ID |
306
272
|`query_elements`| List/filter elements by type and bounding box |
307
-
|`batch_create_elements`| Create multiple elements atomically (efficient for diagrams) |
273
+
|`batch_create_elements`| Create multiple elements atomically |
308
274
|`clear_canvas`| Remove all elements (requires `confirm: true`) |
309
275
|`read_diagram_guide`| Return tldraw color names, presets, and layout best practices |
310
276
|`describe_scene`| Summarize the current canvas elements, positions, labels, and connections |
@@ -318,14 +284,15 @@ No migration is required for existing AdaL users: stdio remains the default. To
318
284
|`distribute_elements`| Distribute multiple elements evenly using an atomic batch update |
319
285
|`auto_layout`| Automatically arrange elements using dagre, force-directed, or grid layout |
320
286
|`export_svg`| Export the current canvas as an SVG string |
321
-
|`export_pdf`| Export the current canvas as a PDF file (requires Playwright for full fidelity) |
287
+
|`export_pdf`| Export the current canvas as a PDF file |
**Flow:** MCP client calls a tool → MCP server validates with Zod → HTTP POST to canvas server → canvas server broadcasts via WebSocket → browser frontend applies to tldraw editor in real time.
373
-
374
-
---
375
-
376
315
## Development
377
316
378
317
```bash
@@ -389,24 +328,10 @@ npm run dev:frontend # Vite dev server on :5173
389
328
# Build everything
390
329
npm run build:all
391
330
392
-
# Run regression tests once
393
-
npm test -- --run
394
-
395
-
# Test MCP tools directly
396
-
npx @modelcontextprotocol/inspector --cli \
397
-
-e EXPRESS_SERVER_URL=http://127.0.0.1:3000 \
398
-
-- node dist/index.js --method tools/list
399
-
```
400
-
401
-
### Testing
402
-
403
-
```bash
404
-
# Run the Vitest regression suite once
331
+
# Run the full test suite once
405
332
npm test -- --run
406
333
```
407
334
408
-
The tests cover REST edge cases such as duplicate custom IDs, atomic batch create validation, and atomic batch updates.
0 commit comments