# DOCX Edit Server
A Model Context Protocol (MCP) server that provides DOCX document editing capabilities for Large Language Models (LLMs).
## Features
- **Content Insertion**: Insert headings, paragraphs, images, and tables at specified placeholder positions
- **Document Reading**: Read and extract document outline structure
- **Rich Formatting**: Support for styled headings, formatted text with bold/italic, and image captions
- **Table Support**: Create formatted tables with headers and data rows
- **Image Processing**: Automatic image conversion to PNG format with customizable width
- **Document Comparison**: Track changes between document versions
## Tools Provided
- `docx_insert`: Insert content (headings, paragraphs, images, tables) at specified placeholder positions in DOCX files
- `read_docx`: Read and extract the outline structure of DOCX documents
## Content Types Supported
### Headings
- Levels 1-4 supported
- Customizable font size
- Automatic styling with SimHei font
### Paragraphs
- Support for markdown-style formatting (*italic*, **bold**)
- Automatic text formatting and indentation
### Images
- Automatic PNG conversion
- Customizable width (in inches)
- Optional captions with center alignment
### Tables
- Header row support
- Automatic grid styling
- Center-aligned headers, left-aligned data
- Optional table captions
## Configuration Options
- `--workspace-path`: Set the workspace directory (default: ./workspace)
## Server Configuration
To use this server with MCP clients, add the following configuration to your MCP settings:
For development or when using `uv`:
```json
{
"mcpServers": {
"docx-edit-server": {
"command": "uv",
"args": ["--directory", "directory_of_docx-edit-server", "run", "docx-edit-server", "--workspace-path", "/path/to/your/workspace"],
"env": {}
}
}
}
```
## Usage Examples
### Inserting Content
```python
# Insert a heading and paragraph at placeholder "{{SECTION_1}}"
await docx_insert(
docx_path="/path/to/document.docx",
placeholder="{{SECTION_1}}",
contents=[
{
"type": "heading",
"text": "Introduction",
"level": 1,
"size": 16
},
{
"type": "paragraph",
"text": "This is a **bold** paragraph with *italic* text."
}
]
)
```
### Reading Document Structure
```python
# Read document outline
outline = await read_docx("/path/to/document.docx")
```
## Safety Features
- **File Validation**: Checks for file existence before operations
- **Content Validation**: Validates content structure and types
- **Error Handling**: Comprehensive error reporting with detailed messages
- **Document Backup**: Tracks changes with before/after comparison
## License
MIT License - see LICENSE file for details.
Raw data
{
"_id": null,
"home_page": null,
"name": "iflow-mcp_docx-edit-server",
"maintainer": null,
"docs_url": null,
"requires_python": "==3.12.7",
"maintainer_email": null,
"keywords": "automation, docx, llm, mcp",
"author": "iflow team",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/06/e4/d4b9a770399cffe38222514706dada74b67a76760af2910dcca2d958371c/iflow_mcp_docx_edit_server-0.1.3.tar.gz",
"platform": null,
"description": "# DOCX Edit Server\n\nA Model Context Protocol (MCP) server that provides DOCX document editing capabilities for Large Language Models (LLMs).\n\n## Features\n\n- **Content Insertion**: Insert headings, paragraphs, images, and tables at specified placeholder positions\n- **Document Reading**: Read and extract document outline structure\n- **Rich Formatting**: Support for styled headings, formatted text with bold/italic, and image captions\n- **Table Support**: Create formatted tables with headers and data rows\n- **Image Processing**: Automatic image conversion to PNG format with customizable width\n- **Document Comparison**: Track changes between document versions\n\n## Tools Provided\n\n- `docx_insert`: Insert content (headings, paragraphs, images, tables) at specified placeholder positions in DOCX files\n- `read_docx`: Read and extract the outline structure of DOCX documents\n\n## Content Types Supported\n\n### Headings\n- Levels 1-4 supported\n- Customizable font size\n- Automatic styling with SimHei font\n\n### Paragraphs\n- Support for markdown-style formatting (*italic*, **bold**)\n- Automatic text formatting and indentation\n\n### Images\n- Automatic PNG conversion\n- Customizable width (in inches)\n- Optional captions with center alignment\n\n### Tables\n- Header row support\n- Automatic grid styling\n- Center-aligned headers, left-aligned data\n- Optional table captions\n\n## Configuration Options\n\n- `--workspace-path`: Set the workspace directory (default: ./workspace)\n\n## Server Configuration\n\nTo use this server with MCP clients, add the following configuration to your MCP settings:\n\nFor development or when using `uv`:\n\n```json\n{\n \"mcpServers\": {\n \"docx-edit-server\": {\n \"command\": \"uv\",\n \"args\": [\"--directory\", \"directory_of_docx-edit-server\", \"run\", \"docx-edit-server\", \"--workspace-path\", \"/path/to/your/workspace\"],\n \"env\": {}\n }\n }\n}\n```\n\n## Usage Examples\n\n### Inserting Content\n```python\n# Insert a heading and paragraph at placeholder \"{{SECTION_1}}\"\nawait docx_insert(\n docx_path=\"/path/to/document.docx\",\n placeholder=\"{{SECTION_1}}\",\n contents=[\n {\n \"type\": \"heading\",\n \"text\": \"Introduction\",\n \"level\": 1,\n \"size\": 16\n },\n {\n \"type\": \"paragraph\", \n \"text\": \"This is a **bold** paragraph with *italic* text.\"\n }\n ]\n)\n```\n\n### Reading Document Structure\n```python\n# Read document outline\noutline = await read_docx(\"/path/to/document.docx\")\n```\n\n## Safety Features\n\n- **File Validation**: Checks for file existence before operations\n- **Content Validation**: Validates content structure and types\n- **Error Handling**: Comprehensive error reporting with detailed messages\n- **Document Backup**: Tracks changes with before/after comparison\n\n## License\n\nMIT License - see LICENSE file for details.",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Model Context Protocol server providing docx edit capability",
"version": "0.1.3",
"project_urls": null,
"split_keywords": [
"automation",
" docx",
" llm",
" mcp"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "06a20abb4ed532c5a2b9cbba013a2f5e7cf0317dd4fb63909f3310a8177ed465",
"md5": "32511b324a68cb1281d68f270f8a436c",
"sha256": "db3f8fdb0f65ee7a27e17bd25d03f1f47f5648fa1c8dafc8b3c4671711a0d04d"
},
"downloads": -1,
"filename": "iflow_mcp_docx_edit_server-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "32511b324a68cb1281d68f270f8a436c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "==3.12.7",
"size": 566822,
"upload_time": "2025-09-10T08:45:28",
"upload_time_iso_8601": "2025-09-10T08:45:28.812339Z",
"url": "https://files.pythonhosted.org/packages/06/a2/0abb4ed532c5a2b9cbba013a2f5e7cf0317dd4fb63909f3310a8177ed465/iflow_mcp_docx_edit_server-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "06e4d4b9a770399cffe38222514706dada74b67a76760af2910dcca2d958371c",
"md5": "33af38982b120c1702da78563f821b48",
"sha256": "c8107a09816df3c57fdb7ea63f1e28e90880695704487e2f67fe6ea74bc18d1d"
},
"downloads": -1,
"filename": "iflow_mcp_docx_edit_server-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "33af38982b120c1702da78563f821b48",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "==3.12.7",
"size": 633611,
"upload_time": "2025-09-10T08:45:30",
"upload_time_iso_8601": "2025-09-10T08:45:30.474287Z",
"url": "https://files.pythonhosted.org/packages/06/e4/d4b9a770399cffe38222514706dada74b67a76760af2910dcca2d958371c/iflow_mcp_docx_edit_server-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-10 08:45:30",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "iflow-mcp_docx-edit-server"
}