Gives Claude the ability to create, read, and manipulate Word documents without an Office installation. Wraps the docx and mammoth libraries to expose eight tools: create documents from markdown, extract text and metadata, append sections, find and replace template variables, insert formatted tables, merge multiple files, and export to PDF via LibreOffice or pandoc. Useful when you need agents to generate contracts, compliance reports, or proposals in .docx format, or when you're working with document templates that need programmatic population. The replace_text tool handles variable substitution, so you can build reusable templates with placeholders like {{CLIENT_NAME}} and swap them at runtime. All operations work on the file system, and documents are standard OOXML that open in Word, Google Docs, or any compatible editor.
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.
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.
| 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 |
Add to your claude_desktop_config.json:
{
"mcpServers": {
"docx-forge": {
"command": "npx",
"args": ["docx-forge-mcp"]
}
}
}
Add to your .cursor/mcp.json:
{
"mcpServers": {
"docx-forge": {
"command": "npx",
"args": ["docx-forge-mcp"]
}
}
}
npm install -g docx-forge-mcp
docx-forge-mcp
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")
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_document(filePath="/path/to/existing.docx")
# Returns: { text, paragraphs[], headings[], metadata: { wordCount, fileSizeBytes, ... } }
merge_documents(
filePaths=["/docs/ch1.docx", "/docs/ch2.docx", "/docs/ch3.docx"],
outputPath="/docs/complete-manual.docx"
)
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 |
export_to_pdf requires a system-level converter. It tries in order:
sudo apt-get install libreofficesudo apt-get install pandocIf neither is available, the tool returns success: false with installation instructions. The source .docx file is always preserved.
| URI | Description |
|---|---|
docx-forge://usage-guide | Step-by-step guide with workflow examples |
docx — .docx creation (no Office required)mammoth — .docx reading and text extraction@modelcontextprotocol/sdk — MCP protocolzod — Input validationgit 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)
MIT — see LICENSE
csoai-org/pdf-document-mcp
xt765/mcp-document-converter
io.github.xjtlumedia/markdown-formatter
io.github.ai-aviate/better-notion
suekou/mcp-notion-server
meterlong/mcp-doc