MCP serverInstalls cleanly

Edit Word files with tracked changes

Safe Docx MCP server

A local MCP server from UseJunior that reads, edits, compares and comments on Word and OpenDocument files, with clean or tracked-changes copies.

Works with
Claude Code, Codex CLI, Gemini CLI
Good for
Daily work and research

What it does

Safe Docx lets your assistant work inside Word (.docx) and OpenDocument (.odt) files without breaking their layout. It runs on your own computer as an MCP server, a small program your assistant talks to.

It can:

  • read a document, show its outline (headings) and search it
  • make small, targeted edits and leave the rest of the file alone
  • save a clean copy and a tracked-changes (redline) copy of a Word file; by default save writes both
  • add, read and delete comments, and add, change and delete footnotes
  • compare two versions of a document and save the differences as a redline
  • accept all tracked changes, or accept or reject only the AI's own edits
  • convert a Word file to .odt, and export it to Markdown, HTML or plain text

It suits contracts, policies and reports where you need to see exactly what changed. It edits files that already exist; it does not write a new document from scratch.

For .odt files fewer tools work: reading, searching, editing, adding and reading comments, comparing and saving. Tracked-changes copies from save are a Word feature.

Example prompts

  • "Edit NDA.docx. Change the governing law from New York to Delaware. Save a clean copy and a tracked-changes copy. Do not change anything else."
  • "Compare contract-v1.docx and contract-v2.docx, save the redline as contract-redline.docx, then list every change in it."
  • "Add a comment to the paragraph in report.docx that gives the 2025 sales figure, asking for its source."
  • "Show me the outline of policy.docx and find every mention of 'termination'."

How to install

npm install --global @usejunior/safe-docx
claude mcp add safe-docx -- /absolute/path/to/safe-docx

How to use it

After the install, find where the program landed: run command -v safe-docx on macOS or Linux, or where safe-docx on Windows. Put that full path in place of /absolute/path/to/safe-docx in the second line. Then ask: Edit NDA.docx. Change the governing law from New York to Delaware. Save a clean copy and a tracked-changes copy.

Check it works

  1. Run safe-docx --help in your terminal. If it prints help, the install worked.
  2. Run claude mcp list and check that safe-docx shows as Connected, or type /mcp inside Claude Code.
  3. Put a test .docx file in your home folder and ask Claude: "Show me the outline of test.docx." Claude should use the get_document_outline or read_file tool.

Common problems

Other assistants

  • Codex: install the package the same way, then codex mcp add safe-docx -- /absolute/path/to/safe-docx. Codex's MCP docs give the form codex mcp add <server-name> -- <stdio server-command>, and the Safe Docx install guide gives the command (the full path, no arguments, stdio). Check it with codex mcp list — https://developers.openai.com/codex/mcp
  • Gemini CLI: gemini extensions install https://github.com/UseJunior/safe-docx (Gemini CLI extensions gallery). This extension starts the server with npx -y @usejunior/safe-docx, so it downloads the newest version from npm instead of using a global install — https://geminicli.com/extensions/
  • Antigravity CLI (agy): add a safe-docx entry with "command": "/absolute/path/to/safe-docx" to ~/.gemini/config/mcp_config.json, then restart agy (README).
  • Any other MCP app with a JSON config: the same safe-docx entry with the full path and no arguments (installation guide).

What to watch out for

  • It reads and writes real files on your disk. By default the code allows only your home folder and the system temp folder (you can widen this with SAFE_DOCX_ALLOWED_ROOTS), so keep a copy of important documents
  • Word and .odt files stay on your computer: the server itself sends nothing over the network. Your assistant still sees the text it reads, as with any file
  • Google Docs is a separate opt-in: it needs the extra @usejunior/google-docs-core package (the normal install leaves it out) and a Google service-account key in GOOGLE_SERVICE_ACCOUNT_KEY. Then it calls the Google Docs and Drive APIs with full Docs and Drive access and can change the Google Doc
  • npm package 0.25.0 was published 2026-10-09 03:49 UTC (npm clock). A global install stays on that version until you update it; the install guide shows how to pin one. The Gemini CLI extension instead starts the server with npx -y @usejunior/safe-docx, which fetches the newest version from npm
  • Not a visual editor: the README says no browser rendering and no pixel-level pagination guarantees, and .dotx templates must be converted to .docx first

Licence and author

Licence
Apache-2.0
Author
UseJunior
Source code
github.com/UseJunior/safe-docx

How we tested it

We installed it on an empty test computer on 29 Oct 2026. Installed and started in a clean test system. Not yet used in a real AI session.

Test level

The intake sandbox cannot fill in the /absolute/path placeholder, so its own run failed to connect. No documents were edited. Not yet used on real work.

Technical details of the test
Date
29 Oct 2026
Method
Manual sandbox run on 2026-10-29 in the intake's clean container with no account: installed @usejunior/safe-docx 0.25.0 with npm install --global, found the path with command -v safe-docx, added it with "claude mcp add safe-docx -- <path>" and "claude mcp list" showed it as Connected.

Checked again on 29 Oct 2026

Alternatives

FAQ

  • Q: Does it cost money? A: No. It is open source under Apache-2.0 and runs on your machine.
  • Q: Do my documents leave my computer? A: For Word and .odt files the server itself sends nothing over the network. Your assistant still reads the text it pulls out, as with any file it opens. Only the optional Google Docs feature talks to Google.
  • Q: Will it overwrite my original? A: Not by default. save refuses to write over the original file (OVERWRITE_BLOCKED) unless the assistant sets allow_overwrite. Ask for new file names, such as NDA-clean.docx and NDA-redline.docx.
  • Q: Can it create a new document from scratch? A: Not through the MCP server. The bundled skill says from-scratch generation lives in the separate docx-core library.

Sources

  • github.com/UseJunior/safe-docx
  • github.com/UseJunior/safe-docx/blob/main/docs/installation.md
  • github.com/UseJunior/safe-docx/blob/main/packages/docx-mcp/docs/tool-reference.generated.md
  • npmjs.com/package/@usejunior/safe-docx
  • github.com/UseJunior/safe-docx/blob/c4d58c02aa7e96243593671fa51aedcbbdb049e3/packages/docx-mcp/src/tools/path_policy.ts
  • github.com/UseJunior/safe-docx/blob/c4d58c02aa7e96243593671fa51aedcbbdb049e3/packages/google-docs-core/src/auth.ts
  • geminicli.com/extensions/
  • developers.openai.com/codex/mcp