docx-editor-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@docx-editor-mcpcreate a new document named 'meeting notes.docx' with heading 'Agenda'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
DOCX Editor MCP Server
A powerful Model Context Protocol (MCP) server for creating, editing, and extracting data from Microsoft Word documents (.docx). Designed for seamless integration with AI assistants like Claude Desktop, Kilocode, and other MCP-compatible clients.
📋 Table of Contents
Related MCP server: Word Document MCP Server
✨ Features
Document Creation & Management
Create new documents with pre-configured professional styles (Times New Roman, 14pt, justified alignment, 1.15 line spacing)
Load existing templates for modification
Save documents to any specified path
Content Editing
Add headings with automatic styling (centered, Times New Roman, 16pt)
Add paragraphs with customizable alignment (LEFT, CENTER, RIGHT, JUSTIFY)
Insert formatted text with bold, italic, custom font sizes, and language attributes
Create bullet and numbered lists with automatic formatting
Document Analysis & Extraction
Extract all document parameters as structured JSON including:
Core properties (author, title, subject, keywords, created/modified dates)
Custom properties (user-defined metadata)
Document variables (for mail merge and automation)
Section properties (margins, page size, orientation)
Style definitions (fonts, colors, spacing, indentation)
Numbering and list definitions
Headers and footers content
Table structures
Template Generation
Apply extracted parameters to create new documents with identical formatting
Set core properties programmatically (author, title, subject, etc.)
Set custom properties for document metadata
Document Structure Analysis
Get comprehensive document structure summaries
List all headings with levels and text
Count paragraphs and tables
Preview document content
📦 Installation
Prerequisites
Python 3.10 or higher
pip package manager
Quick Start
Clone the repository:
git clone https://github.com/yourusername/docx-editor-mcp.git cd docx-editor-mcpInstall dependencies:
pip install -r requirements.txtVerify installation:
python -c "from docx import Document; from mcp.server.fastmcp import FastMCP; print('Installation successful!')"
⚙️ Configuration
Understanding MCP Servers
Important: MCP servers communicate via stdio using JSON-RPC protocol. They are NOT meant to be run directly from the command line for interactive use. Instead, they must be launched by an MCP client.
Claude Desktop Configuration
Add the following to your Claude Desktop configuration file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"docx-editor": {
"command": "python",
"args": ["C:\\path\\to\\docx-editor-mcp\\server.py"]
}
}
}Kilocode / VS Code Configuration
Add to your VS Code settings or Kilocode configuration:
{
"mcp.servers": {
"docx-editor": {
"command": "python",
"args": ["/path/to/docx-editor-mcp/server.py"]
}
}
}🔧 Available Tools
Document Creation & Management
Tool | Description |
Creates a new document with default professional styles | |
Saves the current document to specified path | |
Loads an existing document for modification |
Content Addition
Tool | Description |
Adds a heading (Level 1-6) with default styling | |
Adds a heading with custom font size | |
Adds a paragraph with alignment options | |
| Appends styled text to a paragraph |
Adds bullet or numbered list item | |
| Inserts a header relative to existing text |
| Inserts a paragraph relative to existing text |
| Inserts a list relative to existing text |
| Formats a specific character range in a paragraph |
Replaces text globally across the document | |
Deletes a paragraph by index | |
| Creates a custom paragraph style |
Table Manipulation
Tool | Description |
Creates a new table | |
Adds a new row to a table | |
Adds a new column to a table | |
| Sets cell text and basic formatting |
| Merges a rectangular range of cells |
| Sets cell background color and alignment |
Applies custom borders to a table | |
Deletes a specific row | |
Deletes a specific column |
Parameter Extraction
Tool | Description |
Extract ALL document parameters as JSON | |
Extract metadata (author, title, dates, etc.) | |
Extract user-defined custom properties | |
Extract document variables for automation | |
Extract margins, page size, orientation | |
Extract style definitions | |
Get headings, paragraphs, tables summary |
Template Generation
Tool | Description |
Create document from JSON parameters | |
Set metadata property | |
Set custom property |
📖 Usage Examples
Creating a New Document
Ask your AI assistant:
Create a new Word document called "report.docx" with:
- A heading "Annual Report 2024"
- A paragraph about company performance
- A bullet list with key achievementsThe server will execute:
create_document("report.docx")
add_heading("Annual Report 2024", level=1)
add_paragraph("The company has shown remarkable growth this year...")
add_list_item("Revenue increased by 25%", style="List Bullet")
add_list_item("Expanded to 3 new markets", style="List Bullet")
save_document()Extracting Document Parameters
Extract all parameters from "template.docx" and show me the styles used.Returns structured JSON:
{
"core_properties": {
"author": "John Doe",
"title": "Company Template",
"created": "2024-01-15T10:30:00"
},
"sections": [{
"margins": {
"top_mm": 15,
"bottom_mm": 15,
"left_mm": 20,
"right_mm": 20
},
"orientation": "portrait"
}],
"styles": {
"paragraph_styles": {
"Normal": {
"font": {"name": "Times New Roman", "size_pt": 14},
"paragraph_format": {"alignment": "JUSTIFY", "line_spacing": 1.15}
}
}
}
}Cloning a Document Template
Extract parameters from "template.docx" and create a new document "new_report.docx" with the same formatting.params = extract_document_parameters("template.docx")
apply_template_parameters(params, "new_report.docx")
# Now add your content...
add_heading("New Report", level=1)
add_paragraph("Your content here...")
save_document()Analyzing Document Structure
Load "document.docx" and show me its structure.Returns:
{
"headings": [
{"index": 0, "level": "Heading 1", "text": "Introduction"},
{"index": 5, "level": "Heading 2", "text": "Methodology"}
],
"paragraphs": [
{"index": 1, "style": "Normal", "text_preview": "This document describes..."},
{"index": 2, "style": "Normal", "text_preview": "The following sections..."}
],
"tables_count": 2
}🛠 Technology Stack
Component | Technology |
Language | Python 3.10+ |
Protocol | Model Context Protocol (MCP) |
MCP Framework | FastMCP |
Document Engine | python-docx |
Communication | JSON-RPC over stdio |
Dependencies
mcp>=1.0.0
python-docx>=0.8.11Default Document Styles
New documents are created with professional default styling:
Element | Style |
Normal Text | Times New Roman, 14pt, Justified, 1.15 line spacing |
Heading 1 | Times New Roman, 16pt, Centered, No bold |
Heading 2 | Times New Roman, 16pt, Centered, No bold |
Margins | Top/Bottom: 15mm, Left/Right: 20mm |
First Line Indent | 12.7mm (1.27 cm) |
🤝 Contributing
Contributions are welcome! Here's how you can help:
Getting Started
Fork the repository
Clone your fork:
git clone https://github.com/yourusername/docx-editor-mcp.gitCreate a feature branch:
git checkout -b feature/amazing-featureMake your changes and commit:
git commit -m "Add amazing feature"Push to your branch:
git push origin feature/amazing-featureOpen a Pull Request
Contribution Guidelines
Follow PEP 8 style guidelines
Add docstrings to all new functions
Update documentation for any new features
Test your changes thoroughly before submitting
Feature Requests & Bug Reports
Open an issue for bug reports or feature requests
Provide detailed descriptions and reproduction steps for bugs
Include examples for feature requests
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- -licenseBquality-maintenanceEnables 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.Last updated32
- AlicenseBqualityDmaintenanceEnables AI assistants to create and manipulate Microsoft Word documents programmatically with support for rich text formatting, tables, lists, headings, and find-and-replace operations.Last updated1046MIT
- Alicense-qualityCmaintenanceEnables AI agents to read, edit, and create Microsoft Word documents (.docx) with support for rich text, tables, and images, deployable locally or via SSE.Last updated3MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to directly read, edit, and manipulate Word documents, supporting image and table operations, paragraph editing, and search/replace.Last updated202MIT
Related MCP Connectors
Use your own Word templates to convert Markdown → DOCX/PDF/HTML from any MCP-compatible AI.
AI document editing for agents: draft, edit, export .docx/PDF. 37 MCP tools; agent self-signup.
Generate PDF/DOCX/XLSX/PPTX from templates+JSON. Convert Office/HTML/MD to PDF. Universal templating
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/merzano369/docx-editor-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server