Files
wordcraft/docs/mcp.md
T
6565a0f0ce Headless: file.setAuthor takes a name; review.trackChanges lists its value param (#90) (#224)
file.setAuthor now documents {"name": string} in the command list, trims the
name, strips control characters, caps it at 255 characters and refuses a blank
name. wordcraft-cli run and headless mcp take --author NAME. review.trackChanges
lists {"value"?: bool} so scripts find the explicit, idempotent form.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-10 09:43:05 -04:00

2.2 KiB

MCP server

WordCraft speaks the Model Context Protocol over stdio, so Claude and other agents can write and edit documents.

wordcraft-cli mcp                          # headless session (no window)
wordcraft --control 7981 &                 # or: drive the running app…
wordcraft-cli mcp --connect 127.0.0.1:7981 # …including clicks, keys and screenshots

Claude Code: claude mcp add wordcraft -- wordcraft-cli mcp.

With --connect, the bridge sends the app's control key, which it reads from WORDCRAFT_CONTROL_KEY or from the key file the app writes at start. It sends the key only to loopback addresses; see Keys.

Tracked changes by an agent

Tracked changes and comments are recorded under the session's user name ("WordCraft User" by default). Name the agent so reviewers can tell its edits from people's: start the headless server with wordcraft-cli mcp --author "Claude (copyedit)", or run file.setAuthor {"name": "Claude (copyedit)"}. Turn tracking on explicitly with review.trackChanges {"value": true}; without value it toggles, which turns tracking off in a document that was saved with it on. wordcraft-cli run takes --author too.

Tools

Tool What it does
list_commands every command (filter with query) — over 270 of them
execute run one command: {command: "insert.table", params: {rows: 3, cols: 4}}
batch run several commands in order
new_document blank, sample, letter, resume, report
open_document / save_document docx, doc (open only), odt, rtf, html, md, tex, txt, json; save also pdf, png
type_text type at the caret (paragraphs: true splits lines into paragraphs)
select_text select the n-th occurrence of some text
get_text / inspect_document read the document back (verify without screenshots)
render_page a page as PNG
parity feature coverage
screenshot, click, key, ui_inspect app only (--connect)

Resources: wordcraft://document (inspect) and wordcraft://commands.

The acceptance test crates/mcp/src/tests.rs writes a formatted document using MCP only.