Safe Docx — Claude Code MCP server: what it does, how to install
Local document manipulation server for coding agents handling .docx and .odt files. It performs targeted edits while keeping layout intact.
claude mcp add safe-docx -- npx -y @usejunior/safe-docxWhat Safe Docx does
The server runs on your machine over standard I/O, giving agents dedicated tools to inspect and modify office files. Assistants can locate clauses with grep or update phrasing via replace_text without stripping underlying styles. Processing happens locally.
Revision handling lets the model produce both an untouched clean copy and an annotated draft containing revision marks. Beyond text adjustments, it manages footnotes and exports to .odt.
Templates ending in .dotx must be resaved as .docx first, because the server does not parse them directly. The tool avoids visual page rendering, so it cannot ensure exact line-by-line pagination.
What it helps with
- update legal terms in contracts while preserving existing formatting
- generate separate clean and revision-marked versions of a draft
- search sections and retrieve outlines inside Word documents
- insert comments or footnote citations directly via agent prompts
- convert Word files into
.odtformat on the local machine
Example prompts for the agent
- Update the jurisdiction clause in
contract.docxto Delaware and output a version with tracked edits. - Search for payment terms in
order.docxand add a comment to that paragraph. - Export the modified file
brief.docxto.odt.
How to install Safe Docx
Platform CLI
claude mcp add safe-docx -- npx -y @usejunior/safe-docxPlatform CLI
codex mcp add safe-docx -- npx -y @usejunior/safe-docxConfig file
{
"mcpServers": {
"safe-docx": {
"command": "npx",
"args": [
"-y",
"@usejunior/safe-docx"
]
}
}
}Config file
{
"servers": {
"safe-docx": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@usejunior/safe-docx"
]
}
}
}Platform CLI
gemini mcp add safe-docx npx -y @usejunior/safe-docxStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Safe Docx
How do I install Safe Docx in Claude Code?
Run claude mcp add safe-docx -- npx -y @usejunior/safe-docx in your terminal. This registers the server over standard input and output.
What does Safe Docx do?
It provides local tools for assistants to read, search, edit, and export .docx and .odt files. The engine makes isolated text updates without corrupting Word structure.
Does Safe Docx support .dotx templates?
It does not read .dotx files directly. You need to convert template files to standard .docx before passing them to the agent.