MCP.so
Sign In
Servers

Safe Docx

@UseJunior

Edit Word (.docx) documents with tracked changes, redlines, and formatting preservation. Built for AI coding agents. Surgical text replacement, comments, footnotes, and document comparison — all local, no cloud upload. MIT licensed.

Overview

What is Safe Docx?

Safe Docx is an open-source TypeScript stack for surgical editing of existing Microsoft Word .docx files. It is optimized for coding-agent workflows that need deterministic, formatting‑preserving edits on existing documents, where a human still must review changes.

How to use Safe Docx?

Install and run via npx -y @usejunior/safe-docx. For MCP clients (Claude Code, Claude Desktop, Gemini CLI, or any stdio‑based MCP client), configure the MCP server with command npx and args ["-y", "@usejunior/safe-docx"]. The server provides typed MCP tools that agents call automatically — no manual integration code needed.

Key features of Safe Docx

  • Deterministic, formatting‑preserving text replacement and paragraph insertion
  • Tracked‑changes outputs for human review
  • Comment and footnote workflows
  • Revision extraction as structured JSON
  • TypeScript runtime — no .NET, Python, or LibreOffice required
  • Auditable behavior with test evidence and traceability artifacts

Use cases of Safe Docx

  • Editing an NDA to change governing law and outputting both a clean and tracked‑changes copy
  • Multistep contract translation pipelines in law firms
  • Automated contract markup review (e.g., 22M+ tokens processed by a 150‑lawyer firm)
  • Brownfield .docx editing in HR, procurement, finance, sales ops, and legal workflows
  • Generating comparison documents and revision artifacts from existing Word files

FAQ from Safe Docx

What document types has Safe Docx been tested on?

In‑repo fixtures include mutual NDAs (Common Paper‑ and Bonterms‑style), Letters of Intent, and ILPA limited partnership agreement redline files.

Does Safe Docx require .NET, Python, or LibreOffice in normal runtime usage?

No. Supported runtime usage is JavaScript/TypeScript with jszip and @xmldom/xmldom.

Does Safe Docx preserve formatting during edits?

That is a core design goal. The tool surface uses surgical operations like replace_text and insert_paragraph that preserve document structure and formatting as much as possible.

Can Safe Docx generate contracts from scratch?

Not the primary focus. For from‑scratch generation, use packages such as docx. Safe Docx is optimized for editing existing documents.

Where does document data live and how is it transported?

Safe Docx runs entirely on your local machine. No document content is sent to external servers. MCP transport is stdio.

Tags

More from Files & Storage