docx

v1.1.29
@fre4x/docx Checked 1 day ago Published 1 month ago

DOCX Editor MCP server

An MCP server for creating and reading Microsoft Word (.docx) documents with full Markdown and HTML rendering, input validation, and automatic error recovery. Operates locally with no external APIs required. Add the following to your claude_desktop_config.json: The server supports a MOCK mode which returns mock fixtures without making any real file system changes.

Summary extracted from the README.

@fre4x/docx

An MCP server for creating and reading Microsoft Word (.docx) documents with full Markdown and HTML rendering, input validation, and automatic error recovery. Operates locally with no external APIs required.

Features

  • Rich Document Rendering: Faithfully converts Markdown and HTML into native Word OOXML elements:
    • Headings (H1 to H6) with structured styles
    • Inline formatting (bold, italic, strikethrough, inline code, hyperlinks)
    • Tables with styled headers, custom borders, cell padding, and alignment
    • Ordered and unordered lists (including nested levels)
    • Fenced code blocks with background shading, borders, and monospace font
    • Blockquotes with indent and border styling
  • Automatic Error Recovery & Sanitization:
    • Strips illegal XML 1.0 control characters (\x00-\x08, \x0B-\x0C, \x0E-\x1F) preventing corrupt document errors in Word
    • Auto-closes unclosed Markdown code blocks
    • Repairs broken Markdown tables (auto-inserts missing header separator rows)
    • Auto-creates missing parent directories
    • Auto-appends missing .docx extensions
  • Format Flexibility: Accepts auto, markdown, html, or text formats with intelligent auto-detection.
  • Enhanced Reading: Extracts plain text, HTML, and converted Markdown from existing documents for seamless inspection and round-tripping.

Tools

Tool Description Inputs
create_document Create a Microsoft Word (.docx) document from Markdown, HTML, or text. filepath (string), content (string), title (optional string), format (optional: auto, markdown, html, text)
read_document Read an existing Microsoft Word (.docx) document. filepath (string)

Installation & Configuration

Claude Desktop

Add the following to your claude_desktop_config.json:

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

Mock Mode

The server supports a MOCK mode which returns mock fixtures without making any real file system changes.

MOCK=true npx @fre4x/docx