The Microsoft Word Document Processing MCP Server is a Model Context Protocol (MCP) server designed to provide tools for reading and writing Microsoft Word (docx) files. This server is particularly useful for developers who need to automate document processing tasks, such as extracting content, creating new documents, or editing existing ones programmatically.
To install the server, use pip
:
pip install mcp-server-office
Alternatively, you can use uv
for installation:
uvx mcp-server-office
Start the MCP server by running the following command:
mcp-server-office
The server provides the following tools for working with docx files:
read_docx
path
(string) - Absolute path to the target file. Note: Images are converted to [Image]
placeholders, and track changes are not shown.
write_docx
Creates a new docx file with the given content.
path
(string) - Absolute path to the target file. content
(string) - Content to write to the file. Note: Use double line breaks for new paragraphs and [Table]
tags with |
separators for tables.
edit_docx_paragraph
Makes text replacements in specified paragraphs of a docx file.
path
(string) - Absolute path to the file to edit. edits
(array) - List of dictionaries containing search/replace text and paragraph index. paragraph_index
(number) - 0-based index of the paragraph to edit. search
(string) - Text to find within the specified paragraph. replace
(string) - Text to replace with. Note: Each search string must match exactly once within the specified paragraph.
edit_docx_insert
Inserts new paragraphs into a docx file.
path
(string) - Absolute path to the file to edit. inserts
(array) - List of dictionaries containing text and optional paragraph index. text
(string) - Text to insert as a new paragraph. paragraph_index
(number, optional) - 0-based index of the paragraph before which to insert. If not specified, the text is inserted at the end.mcp[cli]
>= 1.2.0 python-docx
>= 1.1.2 This project is licensed under the MIT License. For more details, see the LICENSE file.
For more information, visit the GitHub repository.