Docx Forge

io.github.mdfifty50-boop由 GitHub 账号 mdfifty50-boop 发布v0.1.1更新于 Oct 24, 2026

Professional document generation from structured data

已验证STDIO仅桌面效率与工作流文件与存储

概览

AI 生成的概览

本地 MCP 服务器,让助手无需安装 Microsoft Office 即可创建、编辑、读取、合并并导出 Word .docx 文档。

可以做什么
  • 根据标题和 Markdown 内容创建文档,并追加带标题与正文的章节
  • 读取已有 .docx 文件,提取文本、标题、段落和元数据
  • 查找替换文本以填充模板变量,并插入带粗体表头的格式化表格
  • 合并多个 .docx 文件,并统计字数、页数估算、章节数和表格数
  • 通过 LibreOffice 或 pandoc 将 .docx 导出为 PDF
适用场景
适合需要让助手以 Word 文件形式产出合同、报告、提案或合规文档,或需要编辑、检查现有 .docx 文件,而不想安装 Word 或手动排版的场景。
运行要求
以 stdio 在本地运行,通常通过 npx docx-forge-mcp 或全局 npm 安装启动。需要 Node.js 18 或更高版本。无需安装 Office,也不需要任何凭据。PDF 导出还需系统安装 LibreOffice 或 pandoc。
安装前请注意
相关工具会在助手给出的路径上写入、修改和合并文件,应指向预期位置并保留备份。PDF 导出依赖外部转换器,若两者都未安装会返回 success 为 false;源 .docx 文件会保留。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Docx Forge,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

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.

[npm] [License: MIT] [MCP Compatible]


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

ToolDescription
create_documentCreate a new .docx from a title and markdown content
read_documentExtract text, headings, paragraphs, and metadata from a .docx
add_sectionAppend a new section (heading + body) to an existing .docx
replace_textFind and replace text — ideal for template variable substitution
add_tableInsert a formatted table with bold headers into a .docx
merge_documentsCombine multiple .docx files into one
export_to_pdfConvert .docx to PDF via LibreOffice or pandoc
get_document_statsGet word count, page estimate, section count, table count

Install

Claude Desktop

Add to your claude_desktop_config.json:

json
{  "mcpServers": {    "docx-forge": {      "command": "npx",      "args": ["docx-forge-mcp"]    }  }}

Cursor

Add to your .cursor/mcp.json:

json
{  "mcpServers": {    "docx-forge": {      "command": "npx",      "args": ["docx-forge-mcp"]    }  }}

Manual (Node.js)

bash
npm install -g docx-forge-mcpdocx-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:

MarkdownResult
# Heading 1H1 heading
## Heading 2H2 heading
**bold text**Bold text
*italic text*Italic text
- itemBullet list item
1. itemNumbered list item
---Horizontal divider
Blank lineParagraph break

PDF Export

export_to_pdf requires a system-level converter. It tries in order:

  1. LibreOffice (best fidelity) — sudo apt-get install libreoffice
  2. 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

URIDescription
docx-forge://usage-guideStep-by-step guide with workflow examples

Dependencies


Requirements

  • Node.js >= 18.0.0
  • No Microsoft Word or Office installation required
  • PDF export requires LibreOffice or pandoc (optional)

Development

bash
git clone https://github.com/mdfifty50-boop/docx-forge-mcpcd docx-forge-mcpnpm installnpm test        # Run test suitenpm start       # Start MCP server (stdio)

License

MIT — see LICENSE


Related MCP Servers

来源:README.md,提交 848734f

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分