Enable Write Tools
Last modified by gabrielc on 2026/07/14 12:31
Content
Steps
- In the wiki's administration, open the "MCP Server" section (Administer Wiki > Other > MCP Server).
- In the tool checkbox tree, check
edit_document,write_document, or both. - Save the configuration.
Changes take effect immediately, no restart needed.
Risks of Write Tools
Content an agent saves has the MCP user as its content author. If that content contains {{groovy}} or {{velocity}} scripts, those scripts execute with the MCP user's rights. If the MCP user has programming rights, a prompt-injected agent that writes a script macro into a page becomes a code-execution vector. See Write Tools Risk.
Mitigations
Apply these mitigations in order of importance:
- Do not grant the MCP user programming or admin rights.
- Keep write tools off unless the use case explicitly needs them. They are off by default.
- Audit every AI save through the
[AI]comment prefix in the document history and the server audit log.
Built-in guardrails
write_documentenforces read-before-overwrite: overwriting an existing document requires the version the agent read first, and the refusal does not reveal the current version. An agent cannot blindly modify a page it never looked at.edit_documentuses exact string matching for find-and-replace. A stale edit fails with "re-read and retry" rather than silently corrupting a page.- Every save is marked with
[AI]in the page history.