Enable Write Tools

Last modified by gabrielc on 2026/07/14 12:31

Content

Steps

  1. In the wiki's administration, open the "MCP Server" section (Administer Wiki > Other > MCP Server).
  2. In the tool checkbox tree, check edit_document, write_document, or both.
  3. 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:

  1. Do not grant the MCP user programming or admin rights.
  2. Keep write tools off unless the use case explicitly needs them. They are off by default.
  3. Audit every AI save through the [AI] comment prefix in the document history and the server audit log.

Built-in guardrails

  • write_document enforces 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_document uses 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.

Get Connected