# Safe Docx

Local document manipulation server for coding agents handling .docx and .odt files. It performs targeted edits while keeping layout intact.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 46
- Author: UseJunior
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/UseJunior/safe-docx/tree/HEAD/packages/safe-docx
- Updated: 2026-10-22
- HTML: https://affpapa.org/en/nevibecode/mcp/safe-docx

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add safe-docx -- npx -y @usejunior/safe-docx
```

### Codex

**Platform CLI**
```bash
codex mcp add safe-docx -- npx -y @usejunior/safe-docx
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "safe-docx": {
            "command": "npx",
            "args": [
                "-y",
                "@usejunior/safe-docx"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "safe-docx": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@usejunior/safe-docx"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add safe-docx npx -y @usejunior/safe-docx
```

## When to use it
- 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 `.odt` format on the local machine

## Example prompts
- Update the jurisdiction clause in `contract.docx` to Delaware and output a version with tracked edits.
- Search for payment terms in `order.docx` and add a comment to that paragraph.
- Export the modified file `brief.docx` to `.odt`.

## Similar
- [Excel MCP Server](https://affpapa.org/en/nevibecode/mcp/excel-mcp-server.md) — MCP server · ★ 4259
- [kordoc](https://affpapa.org/en/nevibecode/mcp/kordoc.md) — MCP server · ★ 2726
- [Power BI Authoring MCP Server (Local)](https://affpapa.org/en/nevibecode/mcp/power-bi-authoring-mcp-server-local.md) — MCP server · ★ 1247
- [Microsoft 365 MCP Server](https://affpapa.org/en/nevibecode/mcp/microsoft-365-mcp-server.md) — MCP server · ★ 1074
- [anymd](https://affpapa.org/en/nevibecode/mcp/anymd.md) — MCP server · ★ 1051
- [Docling MCP](https://affpapa.org/en/nevibecode/mcp/docling-mcp.md) — MCP server · ★ 777

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
