About aigroup-mdtoword-mcp
aigroup-mdtoword-mcp is an MCP server for turning Markdown into styled Word documents. It is intended for document workflows that need tables, formulas, images, Mermaid diagrams, and reusable templates, and also provides HTTP deployment options.
Key features
- 01Markdown-to-DOCX conversion
- 02Formatting for headings, tables, and code
- 03Inline and block formula support
- 04Local and remote image embedding
- 05Mermaid diagram rendering
- 06Headers, footers, and page numbering
Use cases
- 01Generate styled Word reports from Markdown
- 02Convert CSV or JSON data into Markdown tables
- 03Create documents with formulas, images, or Mermaid diagrams
MCP support
The MCP server exposes tools to convert Markdown to DOCX and tabular CSV or JSON data to Markdown, along with templates, style guides, and metrics resources. It can be configured in Claude Desktop and other compatible clients.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
4Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| filename | string | Yes | Output Word document filename; must end with .docx |
| markdown | string | No | Markdown-formatted text content (choose either this or inputPath) |
| template | object | No | Template configuration. Use a preset template to quickly apply a professional style, or combine it with styleConfig |
| template.type | enum | Yes | Template type: preset = preset templatepreset |
| template.presetId | string | Yes | Preset template ID. Available values: academic (academic paper), business (business report), customer-analysis (customer analysis—default), technical (technical document), minimal (minimalist style), enhanced-features (enhanced features example) |
| inputPath | string | No | Path to the Markdown file (choose either this or markdown) |
| outputPath | string | No | Output directory; defaults to the current working directory |
| styleConfig | object | No | Style configuration object. Supports the theme system (theme), watermark (watermark), headers and footers (headerFooter), automatic table of contents (tableOfContents), table styles (tableStyles), image styles (imageStyles), and more. Can be combined with template to override the template's default styles |
| styleConfig.theme | object | No | |
| styleConfig.theme.name | string | No | Theme name |
| styleConfig.theme.fonts | object | No | |
| styleConfig.theme.fonts.body | string | No | Body font |
| styleConfig.theme.fonts.code | string | No | Code font |
| styleConfig.theme.fonts.heading | string | No | Heading font |
| styleConfig.theme.colors | object | No | |
| styleConfig.theme.colors.text | string | No | Text color (6-digit hexadecimal) |
| styleConfig.theme.colors.primary | string | No | Primary color (6-digit hexadecimal) |
| styleConfig.theme.colors.secondary | string | No | Secondary color (6-digit hexadecimal) |
| styleConfig.theme.spacing | object | No | |
| styleConfig.theme.spacing.large | number | No | Large spacing (twips) |
| styleConfig.theme.spacing.small | number | No | Small spacing (twips) |
| styleConfig.theme.spacing.medium | number | No | Medium spacing (twips) |
| styleConfig.document | object | No | |
| styleConfig.document.defaultFont | string | No | Default font |
| styleConfig.document.defaultSize | number | No | Default font size (half-points) |
| styleConfig.watermark | object | No | |
| styleConfig.watermark.font | string | No | Watermark font |
| styleConfig.watermark.size | number | No | Watermark font size |
| styleConfig.watermark.text | string | Yes | Watermark text |
| styleConfig.watermark.color | string | No | Watermark color (6-digit hexadecimal) |
| styleConfig.watermark.opacity | number | No | Opacity (0-1) |
| styleConfig.watermark.rotation | number | No | Rotation angle (-90 to 90) |
| styleConfig.imageStyles | object | No | |
| styleConfig.imageStyles.default | object | No | |
| styleConfig.imageStyles.default.border | object | No | |
| styleConfig.imageStyles.default.maxWidth | number | No | Maximum width (twips) |
| styleConfig.imageStyles.default.alignment | enum | No | Alignmentleft | center | right |
| styleConfig.imageStyles.default.maxHeight | number | No | Maximum height (twips) |
| styleConfig.imageStyles.default.maintainAspectRatio | boolean | No | Maintain aspect ratio |
| styleConfig.tableStyles | object | No | |
| styleConfig.tableStyles.default | object | No | |
| styleConfig.tableStyles.default.stripedRows | object | No | |
| styleConfig.tableStyles.default.columnWidths | array | No | Column width array (twips) |
| styleConfig.tableStyles.default.cellAlignment | object | No | |
| styleConfig.headerFooter | object | No | Header and footer configuration. Supports features such as displaying page numbers and total pages, a different first page, and different odd and even pages. Page number formats can be combined flexibly, such as "第 1 页 / 共 5 页" and "Page 1 of 5". |
| styleConfig.headerFooter.footer | object | No | Default footer configuration (applies to all pages or odd pages). Supports flexible combinations of page number formats |
| styleConfig.headerFooter.footer.content | string | No | Footer content text (text before the page number, such as "第 ") |
| styleConfig.headerFooter.footer.alignment | enum | No | Footer alignmentleft | center | right | both |
| styleConfig.headerFooter.footer.showPageNumber | boolean | No | Whether to display the current page number. When set to true, the page number is displayed in the footer |
| styleConfig.headerFooter.footer.showTotalPages | boolean | No | Whether to display the total number of pages. When set to true, the total number of pages in the document is displayed |
| styleConfig.headerFooter.footer.pageNumberFormat | string | No | Text after the page number (text immediately following the page number, such as " 页"). Example: content="第 " + page number + pageNumberFormat=" 页" = "第 1 页" |
| styleConfig.headerFooter.footer.totalPagesFormat | string | No | Connecting text before the total page count (e.g., “ / 共 ”, “ of ”). Example: the full format is “第 1 页 / 共 5 页” |
| styleConfig.headerFooter.header | object | No | Default header configuration (applies to all pages or odd-numbered pages) |
| styleConfig.headerFooter.header.content | string | No | Header content text |
| styleConfig.headerFooter.header.alignment | enum | No | Header alignment: left (left-aligned), center (centered), right (right-aligned), both (justified)left | center | right | both |
| styleConfig.headerFooter.evenPageFooter | object | No | Footer for even-numbered pages only (requires setting differentOddEven to true) |
| styleConfig.headerFooter.evenPageFooter.content | string | No | Footer content for even-numbered pages |
| styleConfig.headerFooter.evenPageFooter.alignment | enum | No | Footer alignment for even-numbered pagesleft | center | right | both |
| styleConfig.headerFooter.evenPageFooter.showPageNumber | boolean | No | Whether to show page numbers on even-numbered pages |
| styleConfig.headerFooter.evenPageFooter.showTotalPages | boolean | No | Whether to show the total page count on even-numbered pages |
| styleConfig.headerFooter.evenPageFooter.pageNumberFormat | string | No | Page number format for even-numbered pages |
| styleConfig.headerFooter.evenPageFooter.totalPagesFormat | string | No | Total page count format for even-numbered pages |
| styleConfig.headerFooter.evenPageHeader | object | No | Header for even-numbered pages only (requires setting differentOddEven to true). Used to display different content on odd and even pages when printing double-sided |
| styleConfig.headerFooter.evenPageHeader.content | string | No | Header content for even-numbered pages |
| styleConfig.headerFooter.evenPageHeader.alignment | enum | No | Header alignment for even-numbered pagesleft | center | right | both |
| styleConfig.headerFooter.firstPageFooter | object | No | Footer for the first page only (requires setting differentFirstPage to true). Commonly used to hide page numbers on cover pages |
| styleConfig.headerFooter.firstPageFooter.content | string | No | Footer content for the first page |
| styleConfig.headerFooter.firstPageFooter.alignment | enum | No | Footer alignment for the first pageleft | center | right | both |
| styleConfig.headerFooter.firstPageFooter.showPageNumber | boolean | No | Whether to show the page number on the first page |
| styleConfig.headerFooter.firstPageFooter.showTotalPages | boolean | No | Whether to show the total page count on the first page |
| styleConfig.headerFooter.firstPageFooter.pageNumberFormat | string | No | Page number format for the first page |
| styleConfig.headerFooter.firstPageFooter.totalPagesFormat | string | No | Total page count format for the first page |
| styleConfig.headerFooter.firstPageHeader | object | No | Header specific to the first page (set differentFirstPage to true). Commonly used to hide the header or display special content on the cover page |
| styleConfig.headerFooter.firstPageHeader.content | string | No | First-page header content |
| styleConfig.headerFooter.firstPageHeader.alignment | enum | No | First-page header alignmentleft | center | right | both |
| styleConfig.headerFooter.pageNumberStart | number | No | Starting page number. Defaults to 1; set to another number, such as 5, to start numbering from page 5 |
| styleConfig.headerFooter.differentOddEven | boolean | No | Whether odd and even pages differ. When set to true, even pages use evenPageHeader and evenPageFooter, for duplex printing |
| styleConfig.headerFooter.differentFirstPage | boolean | No | Whether the first page differs. When set to true, the first page uses firstPageHeader and firstPageFooter, commonly for cover pages |
| styleConfig.headerFooter.pageNumberFormatType | enum | No | Page number format: decimal (Arabic numerals 1,2,3), upperRoman (uppercase Roman numerals I,II,III), lowerRoman (lowercase Roman numerals i,ii,iii), upperLetter (uppercase letters A,B,C), lowerLetter (lowercase letters a,b,c)decimal | upperRoman | lowerRoman | upperLetter | lowerLetter |
| styleConfig.headingStyles | object | No | Heading style configuration |
| styleConfig.paragraphStyles | object | No | Paragraph style configuration |
| styleConfig.tableOfContents | object | No | |
| styleConfig.tableOfContents.title | string | No | Table of contents title |
| styleConfig.tableOfContents.levels | array | No | Heading levels to include |
| styleConfig.tableOfContents.enabled | boolean | No | Whether to enable the table of contents |
| styleConfig.tableOfContents.tabLeader | enum | No | Page number leaderdot | hyphen | underscore | none |
| styleConfig.tableOfContents.showPageNumbers | boolean | No | Whether to show page numbers |
Details
From the project READMEAI Group Markdown to Word MCP Server
Professional Markdown-to-Word conversion over MCP, with advanced styling, tables, formulas, images, Mermaid rendering, and HTTP deployment support.
Overview
aigroup-mdtoword-mcp is an MCP server for generating professional .docx documents from Markdown content.
It is designed for:
- converting Markdown into structured Word documents
- applying reusable templates and styling presets
- rendering tables, formulas, images, and Mermaid diagrams
- exposing both MCP and simplified HTTP endpoints
- integrating with Claude Desktop and other MCP-compatible clients
Highlights
- Markdown to DOCX conversion with document styling and layout control
- Advanced formatting for headings, tables, lists, code blocks, and blockquotes
- Math support for inline and block formulas
- Image embedding for local and remote assets
- Mermaid rendering with safe fallback to code blocks
- Header / footer / page numbering / watermark support
- Template, resource, and prompt support for guided usage
- HTTP deployment options including Cloudflare Worker workflows
Quick Start
Requirements
- Node.js >= 18
- npm >= 8
Run with npx
npx -y aigroup-mdtoword-mcp
Install locally
git clone https://github.com/jackdark425/aigroup-mdtoword-mcp.git
cd aigroup-mdtoword-mcp
npm install
npm run build
npm start
MCP Client Configuration
Claude Desktop / compatible MCP clients
{
"mcpServers": {
"markdown-to-word": {
"command": "npx",
"args": ["-y", "aigroup-mdtoword-mcp"]
}
}
}
Local build output
{
"mcpServers": {
"markdown-to-word": {
"command": "node",
"args": ["/path/to/aigroup-mdtoword-mcp/dist/index.js"]
}
}
}
Tools
markdown_to_docx
Converts Markdown content or a Markdown file into a .docx document.
Typical inputs include:
markdowninputPathfilenameoutputPathstyleConfig
table_data_to_markdown
Converts CSV or JSON tabular data into formatted Markdown tables.
Typical inputs include:
dataformatstylehasHeader
Resources
Templates
template://customer-analysistemplate://academictemplate://businesstemplate://technicaltemplate://minimal
Style Guides
style-guide://quick-startstyle-guide://advancedstyle-guide://templates
Metrics
metrics://conversion-statsmetrics://memory-usage
Styling Capabilities
The styling system supports:
- document-level fonts, colors, and page layout
- heading and paragraph styles
- table presets and formatting
- image sizing and placement
- code block styling
- headers, footers, page numbers, and watermarks
Included table styles cover common business, academic, financial, technical, and minimal report layouts.
Example
# Project Report
## Executive Summary
This is a sample report with **bold text** and *italic text*.
- Feature 1: Complete Markdown support
- Feature 2: Advanced styling system
- Feature 3: Professional document layout
| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Data 1 | Data 2 | Data 3 |
| Data 4 | Data 5 | Data 6 |
Mathematical formula: $E = mc^2$
```mermaid
flowchart TD
A[Start] --> B{Check input}
B -->|Valid| C[Generate DOCX]
B -->|Invalid| D[Return error]
```
Deployment
HTTP server
npm run server:http
Cloudflare Worker
npm install -g wrangler
wrangler login
wrangler deploy
Related endpoints typically include:
/health/mcp/convert/.well-known/ai-plugin.json/openapi.yaml/openapi.json
See detailed guidance in docs/DEPLOYMENT_INSTRUCTIONS.md.
Project Structure
src/
├── index.ts
├── converter/
├── template/
├── types/
└── utils/
Development
npm run build
npm test
Additional test commands:
npm run test:mathnpm run test:imagesnpm run test:pagesnpm run test:mermaid
License & Usage
This project is released under the MIT License.
In practical terms, MIT allows you to:
- use this project in personal, internal, academic, or commercial scenarios
- copy, modify, merge, publish, and distribute the code
- build proprietary or open-source products on top of it
- ship derivative works as long as the required copyright and license notice is preserved
Please keep in mind:
- you must retain the original copyright notice and MIT license text in copies or substantial portions of the software
- the software is provided "AS IS", without warranty of any kind
- if you package this project into hosted services, desktop tools, plugins, or internal workflows, you are responsible for your own compliance, security review, and downstream usage constraints
See the full text in LICENSE.
Acknowledgments
Core Dependencies & Ecosystem
-
Model Context Protocol SDK
- Repository: https://github.com/modelcontextprotocol/servers
- Role: MCP server protocol integration
-
docx by Dolan Miu
- Repository: https://github.com/dolanmiu/docx
- Role: core Word document generation engine
Community Inspiration
- Inspired by the broader MCP community and ecosystem
Support
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.