Skip to main content
Developer Tools

safe-docx

Open-source TypeScript MCP server for surgical editing of existing Microsoft Word .docx files. Built for agent workflows that need deterministic, formatting-preserving document edits.

Quick install:

npx -y @usejunior/safe-docx

What safe-docx does

Formatting-preserving edits

Surgical text replacement and paragraph insertion that preserve document structure, styles, and review semantics.

Document comparison

Compare two versions of a document and produce tracked-changes output for human review.

Comments and footnotes

Add, delete, and update comments and footnotes programmatically while keeping formatting intact.

Revision extraction

Extract tracked changes as structured JSON for analysis, reporting, or downstream processing.

23 MCP tools across 7 categories

Each tool is typed with Zod schemas and designed for agent consumption.

Reading & Inspection (7)

read_file, grep, get_session_status, has_tracked_changes, get_comments, get_footnotes, extract_revisions

Planning & Batch (3)

init_plan, merge_plans, apply_plan

Text Editing (2)

replace_text, insert_paragraph

Comments & Footnotes (5)

add_comment, delete_comment, add_footnote, update_footnote, delete_footnote

Layout & Formatting (1)

format_layout

Tracked Changes (2)

accept_changes, compare_documents

File Operations (2)

save, clear_session

Trust & reliability

990+

Automated tests

100%

OpenSpec traceability

MIT

Open-source license

View full Allure test report →

Install options

Claude Code (zero install)

npx -y @usejunior/safe-docx

MCP config (claude_desktop_config.json)

{
  "mcpServers": {
    "safe-docx": {
      "command": "npx",
      "args": ["-y", "@usejunior/safe-docx"]
    }
  }
}

npm (global)

npm install -g @usejunior/safe-docx

Related developer tools

safe-docx edits existing Word documents. Need to generate new ones from templates?

Open Agreements — legal template filling