MCP Documents
A unified MCP server for document processing that enables creating, editing, and converting Word documents (DOCX), PDFs, Markdown, and images, with support for templates, formatting, and batch operations.
README
MCP Documents
Unified MCP Server for Document Processing
A comprehensive Model Context Protocol (MCP) server that combines the best features from multiple document processing libraries into a single, efficient Python 3.10 compatible engine.
Features
📄 Word Document Operations (DOCX)
- Create/Open/Save - Full document lifecycle management
- Content - Paragraphs, headings, tables, images
- Formatting - Font styles, colors, alignment, spacing
- Tables - Create, edit, merge cells, add/delete rows
- Sections - Page layout, margins, orientation
- Headers/Footers - Add, modify, zone-based headers
- Styles - Built-in and custom styles management
- Search/Replace - Find and replace with preview
🔄 Format Conversion
- DOCX ↔ PDF - Bidirectional conversion
- Markdown → DOCX/PDF - With styling support
- Markdown → PPTX - PowerPoint presentations
- Image formats - PNG, JPG, WebP, GIF, BMP, TIFF
- Excel → CSV - Spreadsheet conversion
- HTML → PDF - Web page to document
🎨 Advanced Features
- Template support - Reference documents for styling
- Pandoc integration - Advanced format conversion
- Base64 I/O - Direct content handling without files
- Batch operations - Multiple edits in one call
Installation
cd MCP-Documents
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
Optional Dependencies
For PDF conversion:
pip install -e ".[pdf]"
For all features:
pip install -e ".[full]"
External Tools
Some features require external tools:
- Pandoc - For advanced format conversion:
sudo apt install pandoc - LibreOffice - For DOCX→PDF on Linux:
sudo apt install libreoffice - wkhtmltopdf - For HTML→PDF:
sudo apt install wkhtmltopdf
Configuration
Claude Desktop / VS Code
Add to your MCP configuration:
{
"mcpServers": {
"mcp-documents": {
"command": "/path/to/MCP-Documents/.venv/bin/python",
"args": ["-m", "mcp_documents.server"]
}
}
}
Usage Examples
Create a Document
"Create a new Word document called report.docx with title 'Q4 Report'"
Add Content
"Add a heading 'Summary' at level 2, then add a paragraph with the quarterly results"
Format Text
"Make the title bold and center-aligned, set font size to 24pt"
Add Tables
"Insert a 3x4 table with sales data, merge the header row"
Convert Formats
"Convert report.docx to PDF"
"Convert this markdown to PowerPoint and save as presentation.pptx"
Available Tools
Document Management
| Tool | Description |
|---|---|
create_document |
Create new Word document |
open_document |
Open existing document |
save_document |
Save current document |
save_as_document |
Save as new file |
get_document_info |
Get document statistics |
Content Operations
| Tool | Description |
|---|---|
add_paragraph |
Add paragraph with formatting |
add_heading |
Add heading (level 1-9) |
add_table |
Create table with data |
add_image |
Insert image |
add_page_break |
Insert page break |
Table Operations
| Tool | Description |
|---|---|
edit_table_cell |
Modify cell content |
add_table_row |
Add row to table |
delete_table_row |
Remove row |
merge_table_cells |
Merge cell range |
Format Conversion
| Tool | Description |
|---|---|
convert_docx_to_pdf |
DOCX → PDF |
convert_pdf_to_docx |
PDF → DOCX |
convert_markdown |
MD → DOCX/PDF/PPTX |
convert_image |
Image format conversion |
Search & Edit
| Tool | Description |
|---|---|
search_text |
Find text in document |
find_and_replace |
Replace text |
delete_paragraph |
Remove paragraph |
Architecture
mcp_documents/
├── __init__.py # Package exports
├── server.py # MCP server entry point
├── core/
│ ├── document.py # Document processor class
│ ├── formatting.py # Text/paragraph formatting
│ └── utils.py # Helper functions
├── tools/
│ ├── document_ops.py # Document CRUD operations
│ ├── content_ops.py # Content manipulation
│ ├── table_ops.py # Table operations
│ ├── style_ops.py # Style management
│ ├── section_ops.py # Section/layout operations
│ ├── header_footer.py # Headers and footers
│ └── conversion.py # Format conversion tools
└── converters/
├── pdf.py # PDF conversion
├── image.py # Image conversion
└── pandoc.py # Pandoc wrapper
License
MIT License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。