word-automation-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
word-automation-mcp
A feature-rich MCP server for deep Microsoft Word .docx editing on Windows.
This server drives the installed Microsoft Word through COM automation. Word performs the edits. That gives the server native support for bookmarks, REF fields, content controls, dropdown lists, comments, tracked changes, tables, images, headers, footers, and page layout.
It was built after comparing several Word MCP servers. Those servers mostly edit OOXML directly. That approach is useful, but it is weak at Word-native objects such as dropdown content controls and updating fields. This server uses Word itself so those objects stay real Word objects.
Status
Version: 1.1.0
MCP tools: 139
Transport: stdio
Platform: Windows with Microsoft Word installed
Python: 3.10 or newer
MCP SDK: 2.x
A full smoke test ran against a real 14-table employment form. It exercised every major tool group, saved the DOCX, exported a PDF, and reopened the result in Word.
Related MCP server: KitchenSink4Word
Install
python -m pip install -r D:\Sergey\Development\Agent\word-automation-mcp\requirements.txtFor a package install:
python -m pip install -e D:\Sergey\Development\Agent\word-automation-mcpAfter a package install, the server command is:
word-automation-mcpConfigure pi
The user-level pi MCP file is:
C:\Users\serge\.pi\agent\mcp.json
Add this entry:
{
"mcpServers": {
"word": {
"command": "python",
"args": ["D:\\Sergey\\Development\\Agent\\word-automation-mcp\\server.py"],
"description": "Deep Microsoft Word .docx editing through Word COM automation",
"exposure": "direct",
"enabled": true
}
}
}Use exposure: "direct" if you want the model to call the tools directly. Pi's default codemode exposure hides them from normal tool selection.
After editing the file, run /reload in pi. Then check the connection:
pi mcp listThe tools appear as mcp__word__word_<name>.
Basic workflow
Call
word_open_documentwith the full path to a.docxfile.Use the returned
doc_keyin later calls. The default key isactive.Call
word_save_documentorword_save_documentwith a newpath.Call
word_close_document.
The server keeps Word running while the MCP session is active. It closes documents and quits Word when the session ends.
Example:
{"tool": "word_open_document", "arguments": {"path": "D:\\Docs\\Form.docx", "doc_key": "form"}}
{"tool": "word_get_document_info", "arguments": {"doc_key": "form"}}
{"tool": "word_save_document", "arguments": {"doc_key": "form", "path": "D:\\Docs\\Form_edited.docx"}}Anchors
Many editing tools accept an anchor object. This tells the tool where to edit.
Supported forms:
{"type": "start"}
{"type": "end"}
{"type": "text", "text": "First Name", "occurrence": 1, "include": true}
{"type": "paragraph", "index": 15, "include": true}
{"type": "bookmark", "name": "Candidate_First_Name", "include": true}
{"type": "cell", "table": 2, "row": 2, "column": 2}
{"type": "range", "start": 100, "end": 140}
{"type": "header", "section": 1, "index": 1}
{"type": "footer", "section": 1, "index": 1}include controls whether the tool uses the whole found text or only the point before it.
Content-control selectors
Control tools accept:
4— control number 4."4"— the same."tag=driving_category"— by tag."title=Driving licence category"— by title."driving_category"— matches tag or title.
Picture selectors
Picture tools accept:
1— first inline picture if present, otherwise first floating shape."inline:1"— first inline picture."shape:1"— first floating shape.
Colours
Colour parameters accept a hex string such as #1F4E79 or a colour name such as blue, red, green, yellow, white, black, navy, or gray.
Feature groups
Document and inspection
Open, close, save, save-as, and export to PDF.
Read text, paragraphs, outline, styles, fields, bookmarks, comments, revisions, and XML.
Read page setup, sections, headers, footers, images, and custom properties.
Key tools:
word_open_documentword_close_documentword_save_documentword_get_document_infoword_get_textword_find_textword_get_document_xmlword_get_page_setupword_get_section_infoword_get_headers_footersword_get_imagesword_list_bookmarksword_list_fieldsword_list_commentsword_list_revisionsword_get_custom_properties
Bookmarks, fields, and links
Exact-range bookmarks.
Bookmark text retrieval.
Rename and delete bookmarks.
Real updating
REFcross-references.Generic fields.
Field update and field-code display.
Internal and external hyperlinks.
Key tools:
word_insert_bookmarkword_get_bookmark_textword_rename_bookmarkword_insert_cross_referenceword_insert_fieldword_update_fieldsword_delete_fieldword_toggle_field_codesword_insert_internal_linkword_insert_hyperlinkword_list_hyperlinks
Content controls and dropdowns
Insert text, plain text, combo box, dropdown, date, picture, checkbox, group, and rich text controls.
Replace dropdown choice lists.
Select dropdown values.
Set titles, tags, placeholders, and lock states.
Set checkbox state and date display format.
Key tools:
word_insert_dropdownword_set_dropdown_choicesword_set_dropdown_valueword_insert_content_controlword_get_content_controlword_list_content_controlsword_set_content_control_propertiesword_set_content_control_lockword_set_checkbox_stateword_set_date_control_format
Tables
Create, read, and delete tables.
Add and delete rows and columns.
Merge and split cells.
Set cell text and read cell format.
Set styles, borders, widths, alignment, autofit, repeated headers, row height, padding, vertical alignment, shading, and fonts.
Sort tables.
Convert text to tables and tables to text.
Key tools:
word_insert_tableword_get_tableword_list_tablesword_delete_tableword_add_table_rowsword_add_table_columnsword_delete_table_rowword_delete_table_columnword_merge_cellsword_split_cellword_format_tableword_set_table_bordersword_set_table_column_widthword_set_table_widthword_set_table_autofitword_set_table_repeat_headerword_set_cell_shadingword_set_cell_borderword_set_cell_marginsword_set_cell_vertical_alignmentword_get_cell_formatword_sort_tableword_convert_text_to_tableword_convert_table_to_text
Headers and footers
Set and clear text.
Add page numbers, page count, and generic fields.
Format header and footer text.
Set first-page, odd/even, and link-to-previous options.
Read all header and footer stories.
Key tools:
word_set_header_footerword_clear_header_footerword_add_page_numberword_add_header_footer_fieldword_format_header_footerword_set_header_footer_optionsword_get_headers_footers
Pictures and shapes
Insert pictures with size and wrap control.
Read picture details.
Resize, crop, rotate, position, wrap, border, and set transparency.
Replace or delete pictures.
Add and remove text watermarks.
Key tools:
word_insert_pictureword_get_imagesword_get_picture_infoword_set_picture_sizeword_set_picture_wrapword_set_picture_alt_textword_set_picture_borderword_rotate_pictureword_crop_pictureword_set_picture_positionword_set_picture_transparencyword_replace_pictureword_delete_pictureword_add_text_watermarkword_remove_watermark
Formatting
Basic and advanced character formatting.
Paragraph formatting and borders.
Styles and lists.
Page setup, columns, background colour, and language.
Key tools:
word_format_rangeword_format_charactersword_format_paragraphword_set_paragraph_borderword_set_paragraph_shadingword_clear_formattingword_apply_styleword_create_styleword_modify_styleword_delete_styleword_get_style_infoword_apply_list_formatword_set_list_startword_set_page_setupword_set_section_columnsword_set_background_colorword_set_document_language
Comments and tracked changes
Add, list, reply to, resolve, and delete comments.
Turn tracking on and off.
List, accept, and reject revisions.
Key tools:
word_add_commentword_reply_to_commentword_resolve_commentword_delete_commentword_list_commentsword_set_track_changesword_list_revisionsword_accept_revisionword_reject_revisionword_accept_all_revisionsword_reject_all_revisions
Document features
Tables of contents.
Footnotes and endnotes.
Custom properties.
Document protection.
PDF export.
Key tools:
word_insert_tocword_update_tocword_list_tocsword_insert_footnoteword_insert_endnoteword_list_footnotesword_list_endnotesword_set_custom_propertyword_delete_custom_propertyword_protect_documentword_unprotect_documentword_export_pdf
COM escape hatch
These tools reach Word object-model paths that do not have a dedicated tool.
word_get_com_property— read a property, for exampledoc.Tables(10).Rows(1).HeadingFormat.word_set_com_property— set a property.word_call_com_method— call a COM method with JSON arguments.
Use these carefully. They are powerful and can change any part of the document.
Example: redesign a form
{"tool": "word_set_cell_text", "arguments": {"table_index": 2, "row": 2, "column": 2, "text": "Aisha"}}
{"tool": "word_insert_bookmark", "arguments": {"name": "Candidate_First_Name", "anchor": {"type": "cell", "table": 2, "row": 2, "column": 2}}}
{"tool": "word_insert_cross_reference", "arguments": {"bookmark_name": "Candidate_First_Name", "anchor": {"type": "cell", "table": 13, "row": 1, "column": 2}, "prefix": "Applicant: "}}
{"tool": "word_set_dropdown_choices", "arguments": {"control": "4", "choices": ["Choose", "Native", "Fluent", "Intermediate", "Basic"]}}
{"tool": "word_format_table", "arguments": {"table_index": 10, "style": "Table Grid", "borders": true, "repeat_header": true, "header_shading": "#1F4E79", "header_font_color": "#FFFFFF"}}
{"tool": "word_add_page_number", "arguments": {"which": "footer", "format": "page_of_n", "alignment": "center"}}Tests
The repository includes an end-to-end smoke test:
python tests/smoke_test.py --source path\to\input.docx --output-dir path\to\outputIt starts the server over stdio, registers 139 tools, edits a copy of the document, saves a DOCX, exports a PDF, and closes the document.
Known limitations
Microsoft Word must be installed on Windows. This is not a headless OOXML editor.
Word COM automation is single-threaded. The server keeps all COM calls on one thread.
The server is intended for one client session. Do not run two copies against the same document.
Some Word builds reject a few optional operations. In those cases a tool returns
applied: falseinstead of failing the whole call. This affects custom-property writes, comment resolving, and some crop or rotate operations.Text wrapped in a field can remain inside a tracked change until you accept revisions in Word.
Always save to a new path or keep a backup while you test a redesign.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Create Word .docx files from sections or markdown, fill templates, and read text from a .docx.
Convert DOCX documents to and from PDF, TXT, HTML, ODT, JPG and RTF.
Convert, create and edit Word, PowerPoint, Excel and PDF documents from any AI agent.
Automate enterprise-grade documents from templates, merge and 100+ conversions: PDF, Office, HTML.
Related MCP Servers
- AlicenseAqualityBmaintenanceEditing of existing Word (.docx) files with formatting preservation. Supports comments, footnotes, and document comparison.3450Apache 2.0
- AlicenseAqualityBmaintenanceEnables full-featured editing of Word .docx files through natural language, including merge-aware table operations, bulk cell edits, footnotes/endnotes, TOC management, tracked changes, and document comparison.1018AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables controlling Microsoft Word desktop on Windows through COM, with tools for document management, content editing, formatting, tables, layout, references, review, and optional COM/VBA gateway operations.1Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to create, read, edit, format, and manage Microsoft Word .docx documents, including tables, images, headers and footers, styles, exports, page setup, and optional COM automation.MIT