A Model Context Protocol (MCP) server that enables AI agents to read, edit, and create Microsoft Word documents (.docx). It supports rich text, tables, and images, and provides flexible deployment options (Standalone Executable, Python/UVX, SSE/Remote).
- Document Management: Create new documents or load existing ones.
- Content Reading: Read document structure, paragraphs, tables, and images.
- Rich Editing:
- Add stylized paragraphs (Bold, Italic handled via styles).
- Add Headings (Levels 1-9).
- Insert Images (from local path or Base64).
- Create Tables with custom data.
- Image Extraction: Extract images from docx files to local disk.
- Multi-Mode Support:
- StdIO: Standard integration for local MCP clients (e.g., Claude Desktop).
- SSE: Server-Sent Events support for remote or URL-based connections.
Download the latest release and run the executable directly.
- Get
docx-mcp-server.exefrom the Releases page. - Run in terminal or configure in your MCP client.
⚠️ Note: This package is not currently published to PyPI by the author. To useuvx, you must fork and publish it yourself, or install locally.
If published to PyPI, you could run:
uvx docx-mcp-server# Clone the repository
git clone https://github.com/OkamiFeng/docx-mcp-server.git
cd docx-mcp-server
# Run with uv
uv run docx-mcp-server{
"mcpServers": {
"docx": {
"command": "uvx",
"args": ["docx-mcp-server"]
}
}
}{
"mcpServers": {
"docx": {
"command": "C:/Path/To/docx-mcp-server.exe",
"args": []
}
}
}{
"mcpServers": {
"docx": {
"command": "uv",
"args": ["run", "--directory", "C:/Projects/docx-mcp-server", "docx-mcp-server"]
}
}
}To run the server in HTTP mode (accessible via URL):
# Using Exe
docx-mcp-server.exe --transport sse --port 8000
# Using Python
uv run server.py --transport sse --port 8000SSE Endpoint: http://localhost:8000/sse
| Tool Name | Description |
|---|---|
create_new_document |
Create a fresh empty document. |
load_document |
Load an existing .docx file from a path. |
get_document_structure |
Get a simplified JSON-like view of paragraphs and content counts. |
add_paragraph |
Add text paragraph with optional style. |
add_heading |
Add a heading (Level 1-9). |
add_table |
Insert a table with specified rows, cols, and data. |
add_image |
Insert an image from a file path or Base64 string. |
extract_images |
Extract all images from the loaded document to a folder. |
save_document |
Save changes (overwrite or new path). |
- Clone:
git clone https://github.com/OkamiFeng/docx-mcp-server.git - Install:
uv syncorpip install -r requirements.txt - Build Exe:
pyinstaller --name docx-mcp-server --onefile server.py --icon="icon.png" --collect-all docx
MIT