The Office Word MCP Server enables AI assistants to comprehensively create, manage, and manipulate Microsoft Word documents through a standardized protocol.
Document Management: Create new documents with metadata, copy existing documents, list documents in directories, merge documents, and convert Word files to PDF format.
Content Creation: Add headings, paragraphs, tables, images with scaling, numbered lists, page breaks, footnotes, and endnotes. Insert content before/after specific text or at paragraph indices.
Text and Formatting: Apply bold, italic, underline, font size, color, and custom styles to text. Format tables with borders, shading, and headers. Create custom document styles with comprehensive formatting properties.
Content Manipulation: Delete paragraphs or tables, replace content blocks beneath headers or between anchor texts, modify table cell content, and perform search and replace operations with case sensitivity options.
Document Protection: Add or remove password protection and digital signatures, verify document integrity.
Content Extraction and Analysis: Extract full text content, retrieve specific paragraph text by index, get document outlines or raw XML structure, and find text occurrences with flexible matching options.
Advanced Features: Customize footnote/endnote numbering and formatting, replace paragraph blocks, and access comprehensive document information including structure and metadata.
Implemented as a Python-based MCP server that uses python-docx library for Word document manipulation and provides tools for comprehensive document operations
Office-Word-MCP-Server
This repo is a fork from:
adapted to be deployed as a microservice.
A Model Context Protocol (MCP) server for creating, reading, and manipulating Microsoft Word documents. This server enables AI assistants to work with Word documents through a standardized interface, providing rich document editing capabilities.
Overview
Office-Word-MCP-Server implements the Model Context Protocol to expose Word document operations as tools and resources. It serves as a bridge between AI assistants and Microsoft Word documents, allowing for document creation, content addition, formatting, and analysis.
The server features a modular architecture that separates concerns into core functionality, tools, and utilities, making it highly maintainable and extensible for future enhancements.
Example
Prompt
Output
Features
Document Management
- Create new Word documents with metadata
- Extract text and analyze document structure
- View document properties and statistics
- List available documents in a directory
- Create copies of existing documents
- Merge multiple documents into a single document
- Convert Word documents to PDF format
Content Creation
- Add headings with different levels
- Insert paragraphs with optional styling
- Create tables with custom data
- Add images with proportional scaling
- Insert page breaks
- Add footnotes and endnotes to documents
- Convert footnotes to endnotes
- Customize footnote and endnote styling
Rich Text Formatting
- Format specific text sections (bold, italic, underline)
- Change text color and font properties
- Apply custom styles to text elements
- Search and replace text throughout documents
Table Formatting
- Format tables with borders and styles
- Create header rows with distinct formatting
- Apply cell shading and custom borders
- Structure tables for better readability
Advanced Document Manipulation
- Delete paragraphs
- Create custom document styles
- Apply consistent formatting throughout documents
- Format specific ranges of text with detailed control
Document Protection
- Add password protection to documents
- Implement restricted editing with editable sections
- Add digital signatures to documents
- Verify document authenticity and integrity
Installation
- Clone to your Coolify server:
Installing via Smithery (only original repo, not this one)
To install Office Word Document Server for Claude Desktop automatically via Smithery:
Prerequisites
- Python 3.8 or higher
- pip package manager
Basic Installation (A)
cd Office-Word-MCP-Server
Install dependencies
pip install -r requirements.txt
Usage with Claude for Desktop
Configuration
Method 1: After Local Installation
- After installation, add the server to your Claude for Desktop configuration file:
Method 2: Without Installation (Using uvx)
- You can also configure Claude for Desktop to use the server without local installation by using the uvx package manager:
- Configuration file locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
- Restart Claude for Desktop to load the configuration.
Example Operations
Once configured, you can ask Claude to perform operations like:
- "Create a new document called 'report.docx' with a title page"
- "Add a heading and three paragraphs to my document"
- "Insert a 4x4 table with sales data"
- "Format the word 'important' in paragraph 2 to be bold and red"
- "Search and replace all instances of 'old term' with 'new term'"
- "Create a custom style for section headings"
- "Apply formatting to the table in my document"
API Reference
Document Creation and Properties
Content Addition
Content Extraction
Text Formatting
Table Formatting
Troubleshooting
Common Issues
- Missing Styles
- Some documents may lack required styles for heading and table operations
- The server will attempt to create missing styles or use direct formatting
- For best results, use templates with standard Word styles
- Permission Issues
- Ensure the server has permission to read/write to the document paths
- Use the
copy_document
function to create editable copies of locked documents - Check file ownership and permissions if operations fail
- Image Insertion Problems
- Use absolute paths for image files
- Verify image format compatibility (JPEG, PNG recommended)
- Check image file size and permissions
Debugging
Enable detailed logging by setting the environment variable:
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Model Context Protocol for the protocol specification
- python-docx for Word document manipulation
- FastMCP for the Python MCP implementation
Note: This server interacts with document files on your system. Always verify that requested operations are appropriate before confirming them in Claude for Desktop or other MCP clients.
Updated Fri Aug 22 11:39:21 PM CEST 2025
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
Enables AI assistants to create, read, and manipulate Microsoft Word documents with comprehensive formatting, table creation, content management, and document protection capabilities. Supports advanced operations like merging documents, PDF conversion, and rich text formatting through a standardized interface.
Related MCP Servers
- AsecurityAlicenseAqualityProvides comprehensive document processing, including reading, converting, and manipulating various document formats with advanced text and HTML processing capabilities.Last updated -162815MIT License
- -securityFlicense-qualityA powerful Word document processing service based on FastMCP, enabling AI assistants to create, edit, and manage docx files with full formatting support. Preserves original styles when editing content.Last updated -128
- AsecurityAlicenseAqualityWord document reading and writing MCP implemented in Node.jsLast updated -7387MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that enables AI assistants to create, read, edit, and format Microsoft Word documents through standardized tools and resources.Last updated -54734MIT License