Sponsored by Deepsite.site

docx-mcp

Created By
SecurityRonin2 hours ago
MCP server for reading and editing Word (.docx) documents with track changes, comments, footnotes, and structural validation. The only cross-platform MCP server combining tracked changes, threaded comments, and footnotes with OOXML-level structural validation.
Overview

docx-mcp

PyPI Python License: MIT CI Coverage Sponsor

docx-mcp MCP server

MCP server for reading and editing Word (.docx) documents with track changes, comments, footnotes, and structural validation.

The only cross-platform MCP server that combines track changes, comments, and footnotes in a single package — with OOXML-level structural validation that no other server offers.

Features

CapabilityDescription
Track changesInsert/delete text with proper w:ins/w:del markup — shows as revisions in Word
CommentsAdd comments, reply to threads, read existing comments
FootnotesAdd footnotes, list all footnotes, validate cross-references
ParaId validationCheck uniqueness across all document parts (headers, footers, footnotes)
Watermark removalDetect and remove VML watermarks (e.g., DRAFT) from headers
Structural auditValidate footnotes, paraIds, heading levels, bookmarks, relationships, images
Text searchSearch across body, footnotes, and comments — plain text or regex
Heading extractionGet the full heading structure with levels and paragraph IDs

Installation

# With pip
pip install docx-mcp-server

# With uvx (recommended for MCP)
uvx docx-mcp-server

Configuration

Claude Desktop / Claude Code

Add to your MCP settings:

{
  "mcpServers": {
    "docx-mcp": {
      "command": "uvx",
      "args": ["docx-mcp-server"]
    }
  }
}

Cursor / Windsurf / VS Code

Add to your MCP configuration file:

{
  "mcpServers": {
    "docx-mcp": {
      "command": "uvx",
      "args": ["docx-mcp-server"]
    }
  }
}

With pip install

{
  "mcpServers": {
    "docx-mcp": {
      "command": "docx-mcp"
    }
  }
}

Available Tools

Document Lifecycle

ToolDescription
open_documentOpen a .docx file for reading and editing
close_documentClose the current document and clean up
get_document_infoGet overview stats (paragraphs, headings, footnotes, comments)
save_documentSave changes back to .docx (can overwrite or save to new path)

Reading

ToolDescription
get_headingsGet heading structure with levels, text, styles, and paraIds
search_textSearch across body, footnotes, and comments (text or regex)
get_paragraphGet full text and style of a paragraph by paraId

Track Changes

ToolDescription
insert_textInsert text with tracked-change markup (w:ins)
delete_textMark text as deleted with tracked-change markup (w:del)

Comments

ToolDescription
get_commentsList all comments with ID, author, date, and text
add_commentAdd a comment anchored to a paragraph
reply_to_commentReply to an existing comment (threaded)

Footnotes

ToolDescription
get_footnotesList all footnotes with ID and text
add_footnoteAdd a footnote with superscript reference
validate_footnotesCross-reference IDs between document body and footnotes.xml

Validation & Audit

ToolDescription
validate_paraidsCheck paraId uniqueness and range validity across all parts
remove_watermarkRemove VML watermarks from document headers
audit_documentComprehensive structural audit (footnotes, paraIds, headings, bookmarks, relationships, images, artifacts)

Example Workflow

1. open_document("/path/to/contract.docx")
2. get_headings()                          → see document structure
3. search_text("30 days")                  → find the clause
4. delete_text(para_id, "30 days")         → tracked deletion
5. insert_text(para_id, "60 days")         → tracked insertion
6. add_comment(para_id, "Extended per client request")
7. audit_document()                        → verify structural integrity
8. save_document("/path/to/contract_revised.docx")

The resulting document opens in Microsoft Word with proper revision marks — deletions shown as red strikethrough, insertions as green underline, comments in the sidebar.

How It Works

A .docx file is a ZIP archive of XML files. This server:

  1. Unpacks the archive to a temporary directory
  2. Parses all XML parts with lxml and caches them in memory
  3. Edits the cached DOM trees directly (no intermediate abstraction layer)
  4. Repacks modified XML back into a valid .docx archive

This approach gives full control over OOXML markup — essential for track changes (w:ins/w:del), comments (w:comment + range markers), and structural validation that higher-level libraries like python-docx don't expose.

Requirements

  • Python 3.10+
  • lxml

License

MIT

Server Config

{
  "mcpServers": {
    "docx-mcp": {
      "command": "uvx",
      "args": [
        "docx-mcp-server"
      ]
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Serper MCP ServerA Serper MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Amap Maps高德地图官方 MCP Server
Tavily Mcp
CursorThe AI Code Editor
Playwright McpPlaywright MCP server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
ChatWiseThe second fastest AI chatbot™
DeepChatYour AI Partner on Desktop
WindsurfThe new purpose-built IDE to harness magic