Content
# word_mcp: Word Document MCP Server
## Overview
A model context protocol server for manipulating and processing Word documents
This server provides a range of tools for creating, editing, and converting Word documents, supporting format conversion, complex text query and replacement, document merging, data extraction, document comparison, and document quality assessment.

## Example


## Tools
1. `create_txt_file`
- Create a new TXT file
2. `create_word_document`
- Create a new Word document
3. `read_word_document`
- Read content from a Word document
4. `get_word_document_info`
- Query basic information of a Word document
5. `add_text_to_word_document`
- Add text content to a Word document
6. `set_paragraph_format`
- Set the text format of a specified paragraph in a Word document
7. `set_paragraph_spacing`
- Set the spacing of a specified paragraph in a Word document
8. `insert_image_into_word_document`
- Insert an image into a Word document
9. `insert_table_into_word_document`
- Insert a table into a Word document
10. `edit_table_cell`
- Edit the content of a table cell in a Word document
11. `save_word_as_pdf`
- Save a Word document as PDF format
12. `convert_word_to_format`
- Convert a Word document to a specified format file, supporting formats including ["docx", "pdf", "txt", "html"]
13. `convert_to_word`
- Convert a specified format file to a Word document, supporting formats including ["docx", "pdf", "txt", "html"]
14. `close_word_document`
- Close a Word document, optionally saving changes
15. `edit_paragraph_text`
- Edit the text content of a specified paragraph in a Word document
16. `find_and_replace_text`
- Find and replace text in a Word document
17. `delete_paragraph`
- Delete a specified paragraph in a Word document
18. `insert_table_of_contents`
- Insert a table of contents in a Word document
19. `add_header_and_footer`
- Add a header and footer to a Word document
20. `set_page_layout`
- Set the page layout of a Word document
21. `merge_word_documents`
- Merge multiple Word documents
22. `complex_query_document`
- Complex query of a Word document (not limited to text)
23. `complex_replace_document`
- Complex replacement in a Word document
24. `extract_document_info`
- Auxiliary functions: `save_to_json` `save_to_csv`
- Paragraph extraction: Extract each paragraph from the document and convert it into a structured data format
- Table extraction: Extract tables from the document and convert them into a structured data format
- Image extraction: Extract images from the document and convert them into a structured data format
- Title extraction: Extract titles of all levels from the document
- Text extraction: Extract text content from the document
- Keyword extraction: Extract keywords from the document
25. `compare_documents`
- Document comparison: Compare the content differences between two or more documents, identifying added, deleted, or modified parts
- Consistency check: Check the consistency between multiple documents
26. `assess_document_quality`
- Auxiliary functions: `calculate_readability`,`count_syllables`
- Readability assessment: Assess the readability of the document, identifying complex sentences and paragraphs
- Consistency assessment: Assess the consistency of format and content in the document
## Installation
1. Clone the MCP Server code repository to your local machine:
```bash
git clone https://github.com/M87shaonv/word_mcp.git
cd word_mcp
```
2. Install dependencies
Use pip/pip3 to install the required Python packages:
```bash
pip install -e 项目路径
pip3 install -e 项目路径
```
3. Configure environment variables (optional)
You can configure the following environment variables to customize the server behavior:
| Variable Name | Description | Default Value |
|-----------------|-----------------------|-------|
| `WORD_MCP_PATH` | Default directory for file operations (e.g., location to save documents) | User's desktop |
Linux/Mac
```bash
# Permanently set environment variables
nano ~/.bashrc
# Add the following to the end of the file
export WORD_MCP_PATH="/path/to/output"
# Refresh environment variables
source ~/.bashrc
```
Windows
```bash
# Set system-level environment variables
set WORD_MCP_PATH="C:\path\to\output" /M
```
4. Start the server
Use the following command to start the MCP Server and test if it is running normally:
```bash
# Start the server
python word_mcp.py
# If you encounter module import errors when starting the server, try updating dependencies using the following command:
uv run word_mcp.py
# Use the mcp command to start the server and access it in the browser to test if it is running normally
mcp dev word_mcp.py
```
Note: If you are using a virtual environment, make sure to activate it before starting the server
Use mcp server configuration, add directly to the `cline_mcp_setting.json` file
```bash
#
"wordmcp": {
"command": "uv",
"args": [
"--directory",
"下载的word_mcp项目路径",
"run",
"word_mcp.py"
]
}
```
Connection Info
You Might Also Like
markitdown
Python tool for converting files and office documents to Markdown.
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
awesome-claude-skills
A curated list of awesome Claude Skills, resources, and tools for...
antigravity-awesome-skills
The Ultimate Collection of 130+ Agentic Skills for Claude...
openfang
Open-source Agent Operating System
memU
MemU is a memory framework for LLM and AI agents, organizing multimodal...