Files
wordcraft/crates/mcp
Bra1nZandBra1nZ 2707ac403f mcp: let open_document take a password (#1796)
The engine has read passwords since the support landed — file.open pulls
`password` out of its parameters and hands it to open_path_in. The UI asks
and retries, the CLI has --password. The MCP tool never passed it on, so an
agent driving the server or the app could not open a protected document by
any route.

Advertise it in the schema, keep it optional, forward it.

Without a password the parameter goes over as null, not "": file.open reads
an empty string as "no password given", so collapsing the two would open a
protected document with an empty password instead of failing.

Three tests. The first I wrote expecting file.open as the backend method
and it failed — exec wraps everything as engine.execute with the command
under params. The test was wrong about the code.

13 lib + 5 integration tests, clippy -D warnings and fmt clean.

Co-authored-by: Bra1nZ <bra1nz@astraoffice.com>
2026-10-18 09:37:17 -04:00
..