# docx-forge [Health: Active]

**Category:** 🏢 Workplace & Productivity  
**Repository:** https://github.com/mdfifty50-boop/docx-forge-mcp  
**GitHub Stars:** 0  
**npm Downloads (last month):** 133  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/docx-forge

## Description
Professional document generation from structured data

## Tools
Capabilities this server exposes over MCP:

- **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

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

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

## Documentation

## What docx-forge MCP server does

The docx-forge MCP server gives AI workflows a set of operations for creating and managing Microsoft Word `.docx` files programmatically. It can turn a title and markdown content into a document, inspect an existing file, append structured content, substitute template values, insert tables, combine files, estimate document statistics, and convert a document to PDF.

The implementation uses the `docx` package for document creation and `mammoth` for reading and text extraction. Microsoft Word or another Office installation is not required for normal `.docx` operations. This makes the server suitable for automated workflows that need files saved to explicit paths rather than interactive desktop editing.

## How it works

Agents call MCP tools with file paths and operation-specific values. `create_document` accepts a title, markdown content, and an output path. Markdown support includes heading levels, bold and italic text, bullet and numbered lists, horizontal dividers, and paragraph breaks. Later calls can operate on the resulting file.

For example, a workflow can create a document containing placeholder values, use `replace_text` to fill those values, add a table or section, and then request document statistics. Multiple chapter files can be passed to `merge_documents` to produce a combined output. `read_document` returns extracted text, paragraphs, headings, and metadata, including word count and file size information.

## Setup and configuration

The docx-forge MCP server requires Node.js 18 or newer. For Claude Desktop, add an MCP entry that runs `npx docx-forge-mcp`; Cursor uses the same command in its `.cursor/mcp.json` configuration. A global installation is also available through `npm install -g docx-forge-mcp`, followed by the `docx-forge-mcp` command.

The development workflow uses `npm install`, `npm test`, and `npm start`, with the server started over stdio. No environment variables are specified in the provided setup instructions. The package can also be obtained from npm or run from a cloned repository.

## Tools and capabilities

The main tools exposed by the docx-forge MCP server are:

- `create_document`: Build a new `.docx` from a title and markdown body.
- `read_document`: Extract text, headings, paragraphs, and metadata.
- `add_section`: Append a heading and body to an existing file, with a selected heading level.
- `replace_text`: Find and replace text, including template placeholders.
- `add_table`: Add a table with bold header cells and supplied rows.
- `merge_documents`: Combine several `.docx` files into one output file.
- `export_to_pdf`: Convert a `.docx` using LibreOffice or pandoc.
- `get_document_stats`: Return word count, estimated pages, section count, and table count.

A `docx-forge://usage-guide` resource is also listed for workflow guidance and examples.

## Limitations and notes

PDF export depends on a system converter. The tool checks for LibreOffice first and pandoc second; if neither is installed, it reports failure and installation guidance. The original `.docx` remains preserved during export. LibreOffice is described as providing the best fidelity, while pandoc is an alternative.

The server is focused on `.docx` creation and manipulation through the listed tools. File paths therefore need to be accessible to the process running the docx-forge MCP server.

_Full upstream README: https://allmcps.com/mcp/docx-forge/readme_

