Integrates with Microsoft Word documents to enable reading, writing, and editing of text, tables, and images for automat...
Created byApr 23, 2025
MCP Server Office
A Model Context Protocol (MCP) server providing tools to read/write Microsoft Word (docx) files.
Usage
Install with pip:
Then, start the MCP server:
Or using uv, just:
Available Tools
`read_docx`: Read complete contents of a docx file including tables and images.
- Input: `path` (string) - Absolute path to the target file
- Note: Images are converted to [Image] placeholders, and track changes are not shown
`write_docx`: Create a new docx file with given content.
- Input:
- `path` (string) - Absolute path to target file
- `content` (string) - Content to write to the file
- Note: Use double line breaks for new paragraphs, and [Table] tag with | separators for tables
`edit_docx_paragraph`: Make text replacements in specified paragraphs of a docx file.
- Input:
- `path` (string) - Absolute path to 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`: Insert new paragraphs into a docx file.
- Input:
- `path` (string) - Absolute path to 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, insert at the end.