docx-forge-mcp
Click on "Deploy 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-forge-mcp Create a contract from a template and export to PDF."
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-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.
Related MCP server: MCP-OPENAPI-DOCX
Tools
Tool | Description |
| Create a new |
| Extract text, headings, paragraphs, and metadata from a |
| Append a new section (heading + body) to an existing |
| Find and replace text — ideal for template variable substitution |
| Insert a formatted table with bold headers into a |
| Combine multiple |
| Convert |
| 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-mcpUsage 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 |
| H1 heading |
| H2 heading |
| Bold text |
| Italic text |
| Bullet list 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 libreofficepandoc —
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 |
| 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
Available Tools
9 toolsadd_sectionA
Append a new section (heading + body content) to the end of an existing .docx document. The document is updated in place.
Inputs: filePath (required), heading (required), content (required), headingLevel.
add_tableA
Insert a formatted table into an existing .docx document. The table is appended at the end of the document with bold header row and standard cell borders.
Inputs: filePath (required), headers (required), rows (required).
create_documentA
Create a new .docx Word document from markdown or plain text content. Supports headings (#, ##, ###), bold (text), italic (text), bullet lists (- item), numbered lists (1. item), and blank lines between paragraphs.
Inputs: title (required), content (required), outputPath (required), author.
export_to_pdfA
Convert a .docx file to PDF. Attempts conversion via LibreOffice (best fidelity) then pandoc. Returns success status and the method used. Requires LibreOffice or pandoc to be installed on the system.
Inputs: filePath (required), outputPath (required).
get_document_statsA
Get statistics for a .docx document: word count, character count, estimated page count (at 250 words/page), number of sections (headings), and number of tables.
Inputs: filePath (required).
health_checkA
Returns server health, uptime, version, and call stats
Inputs: no named parameters.
merge_documentsA
Combine multiple .docx files into a single document. Each source document is separated by a horizontal divider. Useful for assembling reports, consolidating contracts, or combining chapter files.
Inputs: filePaths (required), outputPath (required).
read_documentA
Extract all text, paragraph list, headings, and file metadata from an existing .docx file. Returns structured data suitable for further processing or display.
Inputs: filePath (required).
replace_textA
Find and replace text in an existing .docx document. Useful for template substitution — e.g., replacing {{CLIENT_NAME}} with an actual name, or updating dates and contract values.
Inputs: filePath (required), find (required), replace (required), replaceAll.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool targets a distinct operation on docx files: create, read, update text, add sections/tables, merge, export, stats, and health. No two tools overlap in purpose.
All tools follow a clear verb_noun pattern (e.g., create_document, read_document, add_table). The naming is predictable and consistent, with only health_check as a minor noun_noun exception but still clear.
9 tools cover a well-scoped set of functionality for docx manipulation without being sparse or overwhelming. Each tool earns its place.
The surface covers core CRUD (create, read, update via replace_text and appending sections/tables) plus merge and export. Missing delete/remove operations and the ability to insert at arbitrary positions, but these are minor gaps for typical template workflows.
Maintenance
Related MCP Connectors
Convert, create and edit Word, PowerPoint, Excel and PDF documents from any AI agent.
Use your own Word templates to convert Markdown → DOCX/PDF/HTML from any MCP-compatible AI.
Document-to-Markdown MCP server — convert PDF, Office and HTML into LLM-ready Markdown.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables programmatic interaction with Microsoft Word documents on Windows via COM Interop, allowing operations like document creation, text manipulation, formatting, and table management.16MIT
- AlicenseNot gradedqualityDmaintenanceEnterprise-grade document editing and management server that enables AI-powered operations on Microsoft Word DOCX files, including creating, editing, formatting, and exporting documents through both MCP protocol and RESTful API.3MIT
- FlicenseBqualityDmaintenanceMCP server for Office document automation, enabling AI assistants to create, read, and clone Word/Excel/PPT templates while preserving formatting.41-
- AlicenseCqualityDmaintenanceA 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.100MIT