MCP server for reading and editing Word (.docx) documents with track changes, comments, footnotes, tables, images, sections, and structural validation
Project description
docx-mcp
MCP server for reading and editing Word (.docx) documents with track changes, comments, footnotes, tables, images, sections, and structural validation.
The only cross-platform MCP server that combines track changes, comments, footnotes, tables, formatting, images, sections, cross-references, document merge, and protection in a single package — with OOXML-level structural validation that no other server offers.
Features
| Capability | Description |
|---|---|
| Track changes | Insert/delete text with proper w:ins/w:del markup — shows as revisions in Word |
| Accept/reject changes | Accept or reject tracked changes (all or by author) |
| Character formatting | Bold, italic, underline, color — with tracked-change markup |
| Comments | Add comments, reply to threads, read existing comments |
| Footnotes & endnotes | Add, list, and validate cross-references for both |
| Tables | Create tables, modify cells, add/delete rows — all with tracked changes |
| Lists | Apply bullet or numbered list formatting to paragraphs |
| Images | List embedded images, insert new images with dimensions |
| Headers/footers | Read and edit header/footer content with tracked changes |
| Styles & properties | Read styles, get/set document properties (title, creator, etc.) |
| Sections & page breaks | Insert page/section breaks, set page size/orientation/margins |
| Cross-references | Add internal hyperlinks between paragraphs with bookmarks |
| Document merge | Merge content from another DOCX with automatic paraId remapping |
| Document protection | Set tracked-changes/read-only/comments protection with SHA-512 passwords |
| Structural audit | Validate footnotes, endnotes, paraIds, headings, bookmarks, tables, images, protection |
| Watermark removal | Detect and remove VML watermarks (e.g., DRAFT) from headers |
Installation
claude mcp add docx-mcp -- uvx docx-mcp-server
That's it. The companion skill — which teaches Claude the OOXML workflow patterns, pitfalls, and audit checklist — auto-installs the first time the server starts and auto-updates on every upgrade.
Other installation methods
With pip:
pip install docx-mcp-server
Manual skill install (only needed if auto-install can't write to ~/.claude/skills/):
docx-mcp install-skill
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"]
}
}
}
OpenClaw
Add to your openclaw.yaml:
mcpServers:
docx-mcp:
command: uvx
args:
- docx-mcp-server
Or via the CLI:
openclaw config set mcpServers.docx-mcp.command "uvx"
openclaw config set mcpServers.docx-mcp.args '["docx-mcp-server"]'
With pip install
{
"mcpServers": {
"docx-mcp": {
"command": "docx-mcp"
}
}
}
Available Tools (43)
Document Lifecycle
| Tool | Description |
|---|---|
open_document |
Open a .docx file for reading and editing |
close_document |
Close the current document and clean up |
get_document_info |
Get overview stats (paragraphs, headings, footnotes, comments) |
save_document |
Save changes back to .docx (can overwrite or save to new path) |
Reading
| Tool | Description |
|---|---|
get_headings |
Get heading structure with levels, text, styles, and paraIds |
search_text |
Search across body, footnotes, and comments (text or regex) |
get_paragraph |
Get full text and style of a paragraph by paraId |
Track Changes
| Tool | Description |
|---|---|
insert_text |
Insert text with tracked-change markup (w:ins) |
delete_text |
Mark text as deleted with tracked-change markup (w:del) |
accept_changes |
Accept tracked changes (all or by author) |
reject_changes |
Reject tracked changes (all or by author) |
set_formatting |
Apply bold/italic/underline/color with tracked-change markup |
Tables
| Tool | Description |
|---|---|
get_tables |
Get all tables with row/column counts and cell content |
add_table |
Insert a new table after a paragraph with tracked insertion |
modify_cell |
Modify a table cell with tracked changes |
add_table_row |
Add a row to a table with tracked insertion |
delete_table_row |
Delete a table row with tracked changes |
Lists
| Tool | Description |
|---|---|
add_list |
Apply bullet or numbered list formatting to paragraphs |
Comments
| Tool | Description |
|---|---|
get_comments |
List all comments with ID, author, date, and text |
add_comment |
Add a comment anchored to a paragraph |
reply_to_comment |
Reply to an existing comment (threaded) |
Footnotes & Endnotes
| Tool | Description |
|---|---|
get_footnotes |
List all footnotes with ID and text |
add_footnote |
Add a footnote with superscript reference |
validate_footnotes |
Cross-reference footnote IDs between body and footnotes.xml |
get_endnotes |
List all endnotes with ID and text |
add_endnote |
Add an endnote with superscript reference |
validate_endnotes |
Cross-reference endnote IDs between body and endnotes.xml |
Headers, Footers & Styles
| Tool | Description |
|---|---|
get_headers_footers |
Get all headers and footers with text content |
edit_header_footer |
Edit header/footer text with tracked changes |
get_styles |
Get all defined styles with ID, name, type, and base style |
Properties & Images
| Tool | Description |
|---|---|
get_properties |
Get core document properties (title, creator, dates, revision) |
set_properties |
Set core document properties (title, creator, subject, description) |
get_images |
Get all embedded images with rId, filename, content type, dimensions |
insert_image |
Insert an image after a paragraph with specified dimensions |
Sections & Cross-References
| Tool | Description |
|---|---|
add_page_break |
Insert a page break after a paragraph |
add_section_break |
Add a section break (nextPage, continuous, evenPage, oddPage) |
set_section_properties |
Set page size, orientation, and margins for a section |
add_cross_reference |
Add a cross-reference link between paragraphs with bookmarks |
Protection & Merge
| Tool | Description |
|---|---|
set_document_protection |
Set document protection (trackedChanges, readOnly, comments, forms) |
merge_documents |
Merge content from another DOCX with paraId remapping |
Validation & Audit
| Tool | Description |
|---|---|
validate_paraids |
Check paraId uniqueness and range validity across all parts |
remove_watermark |
Remove VML watermarks from document headers |
audit_document |
Comprehensive structural audit (footnotes, endnotes, paraIds, headings, bookmarks, tables, relationships, images, protection, 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:
- Unpacks the archive to a temporary directory
- Parses all XML parts with lxml and caches them in memory
- Edits the cached DOM trees directly (no intermediate abstraction layer)
- 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file docx_mcp_server-0.2.2.tar.gz.
File metadata
- Download URL: docx_mcp_server-0.2.2.tar.gz
- Upload date:
- Size: 138.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0be9cf357be833069c5e234c59d2b9ca000a6ece630b6187920ec7f5bae17a64
|
|
| MD5 |
2e3e882b3450f8e331f3356ce791b902
|
|
| BLAKE2b-256 |
a2830e1ff36725717f0a6657d08e77f24af2889b5609ef297d05cbcbbf47e9b6
|
Provenance
The following attestation bundles were made for docx_mcp_server-0.2.2.tar.gz:
Publisher:
release.yml on SecurityRonin/docx-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docx_mcp_server-0.2.2.tar.gz -
Subject digest:
0be9cf357be833069c5e234c59d2b9ca000a6ece630b6187920ec7f5bae17a64 - Sigstore transparency entry: 1157791795
- Sigstore integration time:
-
Permalink:
SecurityRonin/docx-mcp@7a81708bfe346ffaa0e6a01022ff34984c2c676e -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/SecurityRonin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7a81708bfe346ffaa0e6a01022ff34984c2c676e -
Trigger Event:
push
-
Statement type:
File details
Details for the file docx_mcp_server-0.2.2-py3-none-any.whl.
File metadata
- Download URL: docx_mcp_server-0.2.2-py3-none-any.whl
- Upload date:
- Size: 46.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
178f56b2859fd0d3b3dab09ecd6a6df6cf181059447456f1ac2781f03372938c
|
|
| MD5 |
30dae0ae728832a06f99a8cd5966c090
|
|
| BLAKE2b-256 |
ca8290624b49dc442d2ba7b1ecd607a9c6bf36b9ed37bf87994cafa5854889d7
|
Provenance
The following attestation bundles were made for docx_mcp_server-0.2.2-py3-none-any.whl:
Publisher:
release.yml on SecurityRonin/docx-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docx_mcp_server-0.2.2-py3-none-any.whl -
Subject digest:
178f56b2859fd0d3b3dab09ecd6a6df6cf181059447456f1ac2781f03372938c - Sigstore transparency entry: 1157791965
- Sigstore integration time:
-
Permalink:
SecurityRonin/docx-mcp@7a81708bfe346ffaa0e6a01022ff34984c2c676e -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/SecurityRonin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7a81708bfe346ffaa0e6a01022ff34984c2c676e -
Trigger Event:
push
-
Statement type: