Skip to content

MCP — external editors

MCP (Model Context Protocol) lets Cursor, VS Code, Windsurf, or Codex read and edit your YarnDraft project while the app is running.

Where is the guide?

Help → MCP setup — step-by-step installation.

Basics

  1. Keep the YarnDraft app open with the project loaded.
  2. The editor’s MCP server connects to the project folder.
  3. Changes appear within ~1 s; on conflict, use the Reload from disk banner.

Environment variables

VariableMeaning
YARNDRAFT_PROJECT_PATHAbsolute path to the project folder
YARNDRAFT_MCP_WRITE=0Read-only mode (optional)

Auto configuration

When you open a file project in the installed desktop app, YarnDraft refreshes its MCP entry for VS Code (.vscode/mcp.json), Cursor (.cursor/mcp.json), Codex, and Windsurf. Restart or refresh the editor's MCP servers after the first setup. If Codex or Windsurf is not installed, YarnDraft leaves the project opening unaffected; use the setup guide later if needed.

Example tools (MCP server)

Read: project summary, flow list, node type reference, entities, variables, files.

Write: add dialogue / task / condition nodes, edges, entities, variables, project files; update an existing node in place (update_node); export the whole project as one JSON file (export_project_json).

Sketches: list_sketches, get_sketch, create_sketch, add_sketch_layer, add_sketch_elements, delete_sketch, and list_sketch_symbols for the built-in symbol names.

add_sketch_elements takes strokes, shapes, labels, colour icons and entity stamps in one call, and appends them to a layer named by name or id. Coordinates are sketch units with y pointing down; there is no fixed canvas size, so pick a range and stay in it. A shape kind or icon name outside the built-in list is refused up front rather than written — an unknown name would fail the project's own validation on load, which would stop the project opening at all.

The app notices these edits the same way it notices any external change to the project folder. If the sketch is open while the server writes, reopen the project to see the result.

TIP

Built-in AI chat can use MCP too if external servers are enabled in Settings (the panel may be hidden in some builds — Help is the main guide).

Detailed HTML guide: bundled with the installed app under Help → User manual.

YarnDraft — lightweight, cross-platform narrative design tool