DesignCraft: An open-source page and layout design editor written by scratch in pure Rust
MCP: docs name the UI-only commands precisely; app.links works headless (#62)
aiongg79f9d56cef82
diff --git a/crates/mcp/src/tools.rs b/crates/mcp/src/tools.rsindex 9b9869872..754d751f0 100644--- a/crates/mcp/src/tools.rs+++ b/crates/mcp/src/tools.rs@@ -106,7 +106,8 @@ pub fn tool_definitions() -> Vec<Value> {"Run any DesignCraft command by id with JSON params (ids and params from list_commands). Examples: \{\"command\":\"frame.create\",\"params\":{\"rect\":[36,36,576,300],\"content\":\"text\",\"text\":\"Hello\"}} → {id, story}; \{\"command\":\"type.char\",\"params\":{\"size\":24}}; {\"command\":\"edit.undo\"}. Coordinates are points in spread space. \- In the desktop app UI-only commands (view.*, window.*, app.*) work too.",+ In the desktop app the UI-only commands (view.*, window.*, help.*, edit.dynamicSpelling, and app.* except app.links, \+ which works everywhere) work too.",obj(json!({"command": string("Command id, e.g. frame.create"), "params": params_schema()}), &["command"]),false,),diff --git a/docs/mcp.md b/docs/mcp.mdindex 29aeff5f8..f53c56767 100644--- a/docs/mcp.md+++ b/docs/mcp.md@@ -31,7 +31,7 @@ Other MCP clients use the same command line, e.g. in a JSON config:| Engine | In-process `designcraft_engine::Session`, starts with an empty Letter document (`--sample` opens the sample magazine) | The app's session, through its loopback control channel ([control-protocol.md](control-protocol.md)) || Rendering | `designcraft-render` (CPU) | The app's renderer || Window tools (`screenshot`, `click`, `drag`, `menu_list`, `ui_inspect`, `ui_set`, `dialog_*`) | Return an error explaining how to connect | Work |-| UI-only commands (`view.*`, `window.*`, `app.*`) via `execute` | Error | Work |+| UI-only commands via `execute` (`view.*`, `window.*`, `help.*`, `edit.dynamicSpelling`, and `app.*` except `app.links`) | Error | Work |In connected mode every tool maps to a control-channel method (`engine.execute`, `ui.render`, `ui.pointer`, …), sowhat the agent does shows up live in the window. The connection is re-established once if the app restarts.