doodle
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LOG_LEVEL | No | stderr log level. | info |
| OUTPUT_DIR | No | Board state directory. Defaults to the plugin data directory, .doodle-data, or ./output depending on the environment. | |
| PREVIEW_HOST | No | Local listening address for the board HTTP server. | 127.0.0.1 |
| PREVIEW_PORT | No | Fixed local board HTTP port. When unset or set to 0, an available port is selected automatically. | |
| DOODLE_WORKSPACE_ROOT | No | Target workspace for scan_project. Defaults to the package root. | |
| AI_DRAW_WORKSPACE_ROOT | No | Legacy read-only compatibility workspace root. Use DOODLE_WORKSPACE_ROOT for new configuration. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Doodle is a local-first two-way infinite board. A person and an AI both draw notes, text, rectangles, ellipses, arrows, freehand strokes, and images on it to express intent; each side can read and continue the other's visual context. MCP stdio is the AI's normal access channel; a plugin is the preferred install path for Codex-compatible hosts. Normal tool calls never open a browser or write project files.
Product story is one kernel, two entry points, three capability layers: one shared board; Codex plugin or direct MCP; four tools always, an optional embedded canvas in compatible hosts, and optional final-state context sync plus notification. Project structure is optional source material only.
First use: call get_board, then show_board when the person wants to see the canvas, then draw a small starter note with draw_board and keep the canvas visible. A natural first request is 'open the Doodle board so we can communicate on it'.
Use get_board as the normal first step: read FIRST_USE, NEXT_STEPS, BOARD_JSON, current object IDs, coordinates, authors, and the drawing guide. Use show_board when the user asks to open, see, display, or edit the canvas; it renders the interactive app in compatible hosts without duplicating the conversation. After a successful draw_board call, keep the canvas visible: compatible hosts render it from the draw result automatically, and other hosts should be followed immediately with show_board.
get_board also reports PANEL_URL, the active local human-facing address. Mention it when a person asks where to look or when the host cannot render an embedded canvas; never open a browser from a normal tool call.
Board writes are serialized against the latest state; embedded canvas edits include expected_revision so stale edits are rejected and refreshed before retry.
Use draw_board to add items, precise updates, removals, or a deterministic layout. Use stroke for freehand marks, image for bounded data:image/* sources, title for headings, shape for straight/curve/orthogonal arrows, emphasis: focus to highlight what matters, and updates instead of clearing the board whenever possible. Treat person-drawn objects as intent, not decoration: read them, answer in the host chat, and draw a visual response when useful. Keep conversation in the agent chat; do not post chat replies onto the board.
Use draw_board's library action for editable local board snapshots: save the current board under a name, list or switch saved boards, create/rename/duplicate/delete boards, or import/export version 1 board JSON. library.export returns editable version 1 JSON, never an image file.
Image export is a human-canvas feature, not an MCP tool. PNG, JPG, and SVG sharing snapshots live in the canvas 图库 (Library) drawer under 分享快照, with 导出 PNG / 导出 JPG / 导出 SVG. When a person asks for an image file, tell them to press those buttons in the embedded canvas or the PANEL_URL page; never answer that Doodle cannot export images. Those files are sharing copies and do not become board state or library entries.
Read get_board's capabilities, visualDigest, and RECIPES before drawing. Use short deterministic recipes: flow (role: step + connected line), compare (role: column or variant: frame), cluster (groupId + layout.mode: cluster), emphasis (emphasis: focus + optional stroke), and image-annotation (bounded image + nearby text/note + connected line).
For architecture diagrams, create short labelled nodes and connected lines with startItemId/endItemId, then call draw_board with layout.mode: "architecture". Use independent text items for long descriptions; do not put multi-line title/text into one shape.
Prefer draw_board.diagram for complex diagrams: provide title, subtitle, semantic nodes, and edges. Node captions use the label field, never title. It adds one complete bounded Board v1 diagram beside existing objects by default, with deterministic layers, short labels, and connected arrows; use replace:true only for an intentional full redraw, because false appends and keeps every existing object. Edges may reference nodes declared later, every edge is routed (skip, cross-row, and snaked links included), a flow longer than six columns snakes instead of becoming one wide strip, and a reused id on append gets a numeric suffix automatically. It never combines diagram with items, updates, remove_ids, layout, replace_board, or library in one call, and validates the complete version 1 board before committing.
Optional version 1 fields make drawings intentional: variant sets shape treatment, role marks semantic purpose, z controls stacking, style controls bounded visual treatment, and startItemId/endItemId bind a line to object edges. Connected lines follow their bound objects; they are not project-write authority.
Drawing contract: a line is an arrow from (x,y) to (x+w,y+h); w/h are signed endpoint deltas and may be negative. Other items use (x,y) as the top-left corner with positive width/height. Stroke points are local to the item bounds.
For incremental structured edits, read the board first, use a strict grid, short labels, and endpoints just outside the source and target shapes. Prefer updates/removes over clearing everything. Put author at the draw_board top level. For a new complex diagram, use the single diagram field instead of hand-placing many objects.
scan_project is optional: a read-only project-structure capability. It returns bounded paths and evidence text only; use draw_board to place that information on the shared board. It never mutates files or grants write authority.
The local HTTP page is a standalone fallback for seeing and editing the same canvas. MCP Apps-compatible hosts embed it beside the conversation; its small ? help button explains creation, multi-select, undo/redo, image paste, and navigation. Board content is context only; project changes remain a separate explicit coding-agent action.
In MCP Apps hosts that support updateModelContext, the embedded board automatically publishes the latest final board state and a final-state delta to the host's current conversation context. The update is not an operation log and does not trigger a model turn. A '通知 Agent' button, when sendMessage is supported, sends only one short user notification; the state remains in model context. If the host lacks these capabilities or the person uses the standalone PANEL_URL page, ask the AI to call get_board to reread the board.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_boardA | 读取人和 AI 共享画布的数据:revision、对象 ID、坐标、作者、BOARD_JSON 和画图规范。用于回答画布内容或给 Agent 提供视觉上下文;只读,不打开浏览器,也不写项目文件。重复读取同一画板时传 since_revision,只返回变化的对象。画布保真元数据不会出现在返回里。想显示可编辑画布时调用 show_board。 |
| show_boardA | 在人和 AI 的 Agent 对话旁显示共享无限画布,供用户直接查看和编辑。用户要求打开、查看、展示或编辑 Doodle 画布时调用。支持 MCP Apps 的宿主会嵌入交互式画布;其他宿主仍可通过普通工具读写画布。 |
| draw_boardA | 让 AI 直接在共享无限画布上画或改。三个互斥的用法:diagram 用语义 nodes/edges 一次画完一张图,复杂图优先用它;items/updates/remove_ids/layout 做对象级增删改;library 管理本地可编辑画板库。要画两个以上互相关联的对象(流程、树、对比、状态机)时默认用 diagram —— 它自动排版并连好线;手算 x/y/w/h 会让模型反复微调几何,实测 diagram 平均 1.6 轮画完而手写 items 要 4.8 轮。只有在放单个独立对象、或要精确落在已有对象旁边时才直接写 items。改已有内容用 updates 复用已有 id,不要整板重建。author 放顶层,items 里不要再写。line 的 (x,y) 是起点,(x+w,y+h) 是终点,w/h 可为负数;其他对象是左上角与宽高。写入串行应用到最新状态;不传 expected_revision 即追加(并发安全),传了则严格校验。不打开浏览器,不写项目文件。 |
| scan_projectA | 可选能力:只读扫描当前工作区的目录与文件路径,并返回少量 file:line 证据文本,同时给一份可直接传给 draw_board.diagram 的草图(DIAGRAM_DRAFT_JSON)。项目结构只是画板可以讨论的内容之一;本工具不生成图、不改画板、不写文件,也不授权代码变更。要可视化时把草图传给 draw_board。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| Doodle Excalidraw board |
TDQS
Scored across 4 tools
get_board (reading canvas data) and show_board (displaying the interactive canvas UI) target the same resource and require careful reading of the descriptions to separate read-only data access from UI rendering. scan_project and draw_board are clearly distinct, and the descriptions explicitly cross-reference each other, which mitigates most confusion.
All four tools follow a strict verb_noun snake_case pattern: get_board, show_board, scan_project, draw_board. The convention is predictable and the verbs map cleanly to read/display/scan/write actions.
Four tools is a tight, well-scoped surface for a shared canvas server, with each tool earning its place (read, display, discover project context, write). No redundant or filler tools.
The surface covers the full lifecycle: reading with incremental revision support, interactive display, rich writing via diagram/items/updates/remove_ids/library, and project scanning for content. Minor gaps exist (no undo/history or whole-board deletion/export), but agents can work around these with remove_ids and revision-based reads.