.docx files with full formatting preservation. Install it as an MCP server in seconds and start applying deterministic, reviewable edits to real documents.
Quickstart
Get the MCP server running in under two minutes.
Installation by client
Setup instructions for Claude, Gemini CLI, Cline, and more.
Core workflows
Edit text, insert paragraphs, and save tracked-changes output.
Tool reference
Full reference for all 20+ MCP tools.
Why Safe Docx
AI coding tools are great with code, but weak on brownfield.docx editing. Business and legal workflows still run on Word documents — NDAs, SOWs, financing forms, partnership agreements.
Safe Docx bridges that gap:
- Formatting-preserving edits —
replace_textandinsert_paragraphoperate at the run level, never destroying paragraph structure or inline styles. - Tracked-changes output — every edit session can produce a clean copy and a redlined version for human review.
- Local-first — runs as a local MCP server process; no document content is sent to external servers.
- No Python or .NET — pure TypeScript runtime using
jszip+@xmldom/xmldom. - Google Docs support — the same tool surface works on Google Docs via
google_doc_id.
What it’s optimized for
Editing existing documents
Surgical text replacement and paragraph insertion on real Word files without formatting loss.
Document comparison
Compare original and revised DOCX files to produce a tracked-changes redline.
Comment & footnote workflows
Add, read, and delete comment threads and footnotes as first-class operations.
Multi-agent batch editing
Plan, merge, and apply batches of edits from multiple agents with conflict detection.
Get started
Add to your AI client
Configure your MCP client (Claude Desktop, Claude Code, Gemini CLI, Cline) to use the server. See the installation guide for client-specific instructions.
Start editing documents
Use natural language with your AI agent to read, edit, compare, and save
.docx files. See golden prompts for reliable starting patterns.Safe Docx is optimized for editing existing Word files. For creating new documents from scratch, use a generation-oriented library like
docx.
