docx-forge-mcp
MCP server for Word document (.docx) creation and manipulation — the production-grade document automation tool for AI agents.
README
docx-forge-mcp
MCP server for Word document (.docx) creation and manipulation — the production-grade document automation tool for AI agents.
Generate contracts, reports, proposals, and compliance documents directly from agent workflows. No Word installation required.
Why docx-forge-mcp?
Word documents are the default format for contracts, compliance reports, legal agreements, and business proposals — especially in enterprise and government workflows. This MCP server gives AI agents the ability to produce and manipulate .docx files programmatically, without any Office installation, UI automation, or file format guesswork.
Only 1 competitor exists for Word document manipulation via MCP as of 2026. This server fills that gap with a production-quality, fully-tested implementation.
Tools
| Tool | Description |
|---|---|
create_document |
Create a new .docx from a title and markdown content |
read_document |
Extract text, headings, paragraphs, and metadata from a .docx |
add_section |
Append a new section (heading + body) to an existing .docx |
replace_text |
Find and replace text — ideal for template variable substitution |
add_table |
Insert a formatted table with bold headers into a .docx |
merge_documents |
Combine multiple .docx files into one |
export_to_pdf |
Convert .docx to PDF via LibreOffice or pandoc |
get_document_stats |
Get word count, page estimate, section count, table count |
Install
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"docx-forge": {
"command": "npx",
"args": ["docx-forge-mcp"]
}
}
}
Cursor
Add to your .cursor/mcp.json:
{
"mcpServers": {
"docx-forge": {
"command": "npx",
"args": ["docx-forge-mcp"]
}
}
}
Manual (Node.js)
npm install -g docx-forge-mcp
docx-forge-mcp
Usage Examples
Create a contract from a template
create_document(
title="Service Agreement",
content="# Parties\n\n**Client:** {{CLIENT_NAME}}\n**Provider:** Acme Corp\n\n## Scope of Work\n\n{{SCOPE}}\n\n## Payment\n\n{{PAYMENT_TERMS}}",
outputPath="/tmp/contract.docx"
)
replace_text(filePath="/tmp/contract.docx", find="{{CLIENT_NAME}}", replace="TechCorp Ltd")
replace_text(filePath="/tmp/contract.docx", find="{{SCOPE}}", replace="Software development and consulting services.")
replace_text(filePath="/tmp/contract.docx", find="{{PAYMENT_TERMS}}", replace="Net 30 days. $15,000/month.")
export_to_pdf(filePath="/tmp/contract.docx", outputPath="/tmp/contract.pdf")
Build a structured report
create_document(
title="Q1 2026 Performance Report",
content="## Executive Summary\n\nRevenue grew 34% YoY.",
outputPath="/tmp/report.docx"
)
add_section(
filePath="/tmp/report.docx",
heading="Revenue Breakdown",
content="Product A: $450K\nProduct B: $320K\nServices: $180K",
headingLevel=2
)
add_table(
filePath="/tmp/report.docx",
headers=["Product", "Q1 Revenue", "Growth"],
rows=[["Product A", "$450K", "+41%"], ["Product B", "$320K", "+28%"], ["Services", "$180K", "+19%"]]
)
get_document_stats(filePath="/tmp/report.docx")
Read and inspect an existing document
read_document(filePath="/path/to/existing.docx")
# Returns: { text, paragraphs[], headings[], metadata: { wordCount, fileSizeBytes, ... } }
Merge chapter files into a book
merge_documents(
filePaths=["/docs/ch1.docx", "/docs/ch2.docx", "/docs/ch3.docx"],
outputPath="/docs/complete-manual.docx"
)
Markdown Support
create_document and add_section both accept markdown content:
| Markdown | Result |
|---|---|
# Heading 1 |
H1 heading |
## Heading 2 |
H2 heading |
**bold text** |
Bold text |
*italic text* |
Italic text |
- item |
Bullet list item |
1. item |
Numbered list item |
--- |
Horizontal divider |
| Blank line | Paragraph break |
PDF Export
export_to_pdf requires a system-level converter. It tries in order:
- LibreOffice (best fidelity) —
sudo apt-get install libreoffice - pandoc —
sudo apt-get install pandoc
If neither is available, the tool returns success: false with installation instructions. The source .docx file is always preserved.
Resources
| URI | Description |
|---|---|
docx-forge://usage-guide |
Step-by-step guide with workflow examples |
Dependencies
docx—.docxcreation (no Office required)mammoth—.docxreading and text extraction@modelcontextprotocol/sdk— MCP protocolzod— Input validation
Requirements
- Node.js >= 18.0.0
- No Microsoft Word or Office installation required
- PDF export requires LibreOffice or pandoc (optional)
Development
git clone https://github.com/mdfifty50-boop/docx-forge-mcp
cd docx-forge-mcp
npm install
npm test # Run test suite
npm start # Start MCP server (stdio)
License
MIT — see LICENSE
Related MCP Servers
- agentic-observability-mcp — Trace, cost-track, and monitor agent actions
- agent-guard-mcp — Loop detection and circuit breakers
- compliance-shield-mcp — EU AI Act audit trails
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。