tldraw
Draw and visually collaborate with your agents on tldraw's canvas.
사용해야 할까요
품질 및 안전성
발견 사항 (2)
- LOW_exec_callback에서
- LOW_get_canvas_state에서
도구 정의와 프로토콜 준수에 대한 자동 분석을 기반으로 합니다.
컨텍스트 비용
이는 서버의 도구가 모델의 컨텍스트에 로드될 때마다 소비되는 대략적인 토큰 수입니다. 수치가 높을수록 다른 작업에 사용할 수 있는 주의가 줄어듭니다.
설치
원클릭 설치
`claude_desktop_config.json` 파일에 다음을 추가하세요:
{
"mcpServers": {
"tldraw": {
"url": "https://tldraw-mcp-app.tldraw.workers.dev/mcp"
}
}
}원격 엔드포인트
https://tldraw-mcp-app.tldraw.workers.dev/mcpstreamable-httphttps://tldraw-mcp-app.tldraw.workers.dev/ssesse할 수 있는 일
도구 목록
도구 (6)
🟢search(code)
Search the tldraw Editor API spec by writing JavaScript that receives a `spec` object and returns a result. The spec contains: spec.members (all Editor methods/properties with name, kind, signature, description, category), spec.categories (category names), spec.types.shapes (focused shape type definitions with props), spec.types.shapeTypes (list of all shape type strings), spec.helpers (exec helper functions with descriptions, params, examples). Examples: - Find shape methods: return spec.members.filter(m => m.category === "shapes").map(m => ({ name: m.name, signature: m.signature })) - Get arrow shape props: return spec.types.shapes.find(s => s.shapeType === "arrow") - List all categories: return spec.categories - Find a helper: return spec.helpers.find(h => h.name === "createArrowBetweenShapes")
입력 스키마
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "JavaScript code that receives `spec` and returns a result. Must use `return` to produce output."
}
},
"required": [
"code"
],
"$schema": "http://json-schema.org/draft-07/schema#"
}🟡exec(code, canvasId)
Execute JavaScript code on a tldraw canvas. The code runs in the widget with access to the live `editor` instance, helper functions, and normal js. Use the `search` tool first to discover available Editor methods and shape types. Each canvas has a unique `canvasId`. Omit `canvasId` to create a new blank canvas. To edit an existing canvas, pass the `canvasId` that was returned by a previous exec call. Shapes and text grow depending on the amount of text they have. Use clever scripting to ensure there are no unintended overlaps. Examples: - Create a rectangle: editor.createShape({ _type: 'rectangle', shapeId: 'box1', x: 200, y: 120, w: 320, h: 180, text: 'Hello' }) - Connect shapes with an arrow: editor.createShape({ _type: 'arrow', shapeId: 'a1', fromId: 'box1', toId: 'box2', x1: 0, y1: 0, x2: 100, y2: 0 }) - Select and zoom: editor.select('box1'); editor.zoomToSelection() - Read shapes: return editor.getCurrentPageShapes() - Distribute evenly: editor.distributeShapes(editor.getSelectedShapeIds(), 'horizontal') - Box around shapes: boxShapes(['box1', 'box2'], { text: 'Group label', color: 'blue' }) - Stack shapes dynamically: editor.createShape({ _type: 'rectangle', shapeId: 'a', x: 0, y: 0, w: 300, h: 200, text: 'First box\nwith wrapping text' }); const bounds = editor.getShapePageBounds('a'); editor.createShape({ _type: 'rectangle', shapeId: 'b', x: 0, y: bounds.maxY + 20, w: 300, h: 200, text: 'Below first' })
입력 스키마
{
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "JavaScript code to execute. Has access to `editor` (tldraw Editor instance) and helper functions."
},
"canvasId": {
"description": "Canvas ID to edit. Omit to create a new blank canvas. Pass a canvasId from a previous exec result to continue editing that canvas.",
"type": "string"
}
},
"required": [
"code"
],
"$schema": "http://json-schema.org/draft-07/schema#"
}⚪_exec_callback(channel, execKey, result, error)
App-only: widget calls this to resolve a pending exec request.
입력 스키마
{
"type": "object",
"properties": {
"channel": {
"type": "string"
},
"execKey": {
"type": "string"
},
"result": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"result": {},
"error": {
"type": "string"
},
"canvasId": {
"type": "string"
}
},
"required": [
"success"
]
},
"error": {
"type": "string"
}
},
"required": [
"channel"
],
"$schema": "http://json-schema.org/draft-07/schema#"
}🟢_get_canvas_state(canvasId)
App-only: get the latest checkpoint for a canvas by its canvasId.
입력 스키마
{
"type": "object",
"properties": {
"canvasId": {
"type": "string",
"minLength": 1
}
},
"required": [
"canvasId"
],
"$schema": "http://json-schema.org/draft-07/schema#"
}🟢read_checkpoint(checkpointId)
App-only: read shapes from a checkpoint by ID.
입력 스키마
{
"type": "object",
"properties": {
"checkpointId": {
"type": "string",
"minLength": 1
}
},
"required": [
"checkpointId"
],
"$schema": "http://json-schema.org/draft-07/schema#"
}🟡save_checkpoint(checkpointId, shapesJson, assetsJson, bindingsJson, canvasId)
App-only: save shapes to a checkpoint (from user edits). shapesJson and assetsJson must be JSON array strings.
입력 스키마
{
"type": "object",
"properties": {
"checkpointId": {
"type": "string",
"minLength": 1
},
"shapesJson": {
"type": "string"
},
"assetsJson": {
"type": "string"
},
"bindingsJson": {
"type": "string"
},
"canvasId": {
"type": "string"
}
},
"required": [
"checkpointId",
"shapesJson"
],
"$schema": "http://json-schema.org/draft-07/schema#"
}커뮤니티
증거