wordcraft
WordCraft
Operate WordCraft through its structured automation interface. Preserve the user's requested document, styles, and editable content.
Protocol reference
Read the relevant sections of references/control-protocol.md before constructing calls. This is the downloaded upstream protocol, captured on 2026-11-15.
Source: WordCraft control protocol. The documentation is distributed under the bundled MIT license. Relative links inside the snapshot (e.g. mcp.md, recovery.md) resolve against https://github.com/storytold/wordcraft/blob/main/docs/. Discover command ids and parameter docs through engine.commands instead of inventing them.
Select the session and authenticate
Start the app with a control port: wordcraft --control 7981 (or WORDCRAFT_CONTROL_PORT=7981); it listens on 127.0.0.1 only. Every request needs the window's key: a random hex value the app writes to <settings>/control-key.local-<port> (macOS ~/Library/Application Support/WordCraft, Linux $XDG_CONFIG_HOME/wordcraft, Windows %APPDATA%\WordCraft; WORDCRAFT_PROFILE_DIR isolates the profile). Send it as top-level "key" on every request, or once per connection with {"method": "auth", "key": "…"}. A missing or wrong key answers unauthorized and closes the connection; an unauthenticated connection is dropped after 30 s. wordcraft-cli mcp --connect reads the key itself (or WORDCRAFT_CONTROL_KEY) and only sends it to 127.0.0.1; to drive a remote app, forward the port and set the key explicitly. Discover executables and running sessions first; this skill does not install WordCraft or configure MCP servers.
Transport
Send one JSON object per line; each gets one reply line, matched by id; check ok. A failed command leaves the document unchanged. A non-JSON line gets one error reply and closes the connection; lines over 1 MiB are refused the same way. Any method name that is a command id works directly ({"method": "format.bold"}).