Md To Word logo

Md To Word

Compiles Markdown into deterministic, template-driven Word documents with native equations, tables, citations, and MCP tools.

Install Md To Word

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "md-to-word": {
      "command": "uvx",
      "args": [
        "md-to-word-docx"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

uvx md-to-word-docx

Process exited before answering initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

md-to-word MCP server turns Markdown manuscripts into deterministic `.docx` files through a Python-based compiler exposed over MCP. Its tools compile and validate documents, load formatting guidance, inspect presets, and derive a `format.txt` specification from an existing Word template. It supports academic papers, theses, technical reports, and formal documents, including native OMML equations, structured tables, citations, sections, headers, and footers. Reach for it when an AI agent needs repeatable Word output instead of generating ad hoc `python-docx` scripts.

Use cases

  • Compile a thesis Markdown draft into a formatted Word document
  • Validate manuscript formatting before generating a `.docx`
  • Extract a formatting contract from a school or journal template
  • Generate reports with editable equations and repeating table headers
  • Apply citation and page-numbering rules to an academic manuscript

Key features

  • Deterministic Markdown-to-`.docx` compilation
  • MCP tools for compilation, validation, guides, and presets
  • Editable OMML equations with numbering and cross-references
  • Template-to-`format.txt` extraction
  • Academic citation and CSL style support
  • Section, table, header, footer, and page-number controls

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

8/8 checks healthy over the last 30d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 16d ago via OSV.dev · md-to-word-docx (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars18Stargazers on the source repository.
Last commit2d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.

How Md To Word works

What md-to-word does

md-to-word converts Markdown into Word documents using a declarative formatting contract. The compiler is designed for manuscripts that need controlled pagination, typography, headings, tables, equations, references, captions, and page structure. Output is intended for academic papers, theses, technical reports, white papers, and other documents with explicit presentation requirements.

The same Python implementation can be used as an MCP server, command-line program, or Python library. The MCP form lets an AI client invoke document-generation and validation operations without embedding Word-generation logic in each prompt or script. The compiler runs locally and does not require an Office, WPS, Pandoc, or model API process.

Formatting can come from a plain-text format.txt contract, an included preset, or a specification inferred from a .docx template. Presets include options for Chinese academic documents, white papers, and Nature-style English papers. A supplied format contract takes precedence when a school, journal, or organization has its own rules.

How it works

An agent can first request the workflow guide, then choose a preset or prepare a format contract. If a reference Word template exists, the template extraction command analyzes properties such as page dimensions, margins, header and footer boundaries, page numbering, paragraph styles, fonts, spacing, indentation, and table borders. Items that need human confirmation are placed in a review list.

The manuscript uses Markdown plus project-specific markers. These markers can represent table-of-contents fields, section breaks, page-number resets, forced page breaks, captions, equation identifiers, and citation data. Standard Markdown tables and image references are also supported. Equations become editable OMML objects rather than raster images or literal source text.

Before export, validation checks the formatting contract, styles, citation syntax, and structural issues such as unclosed mathematical expressions or incomplete table rules. Errors include source line numbers to help an agent correct the manuscript and retry. Post-export checks compare expected content and styles against the generated document.

Setup and configuration

For MCP use, configure a client to launch uvx with the md-to-word-docx[mcp] package and the md-to-word-mcp entry point:

config.json
{
  "mcpServers": {
    "md-to-word": {
      "command": "uvx",
      "args": ["--from", "md-to-word-docx[mcp]", "md-to-word-mcp"]
    }
  }
}

uvx downloads dependencies into an isolated environment on first use. A local Python installation is another option: install the package with its MCP extra and start the module through Python. The local compiler requires Python 3.10 or newer.

For direct command-line use, install md-to-word-docx, initialize an example project if needed, and run the compiler with an explicit Markdown input, output path, and format file. A preset can be selected for preview when no format contract is available. Python applications can call the export function and inspect its success status and error collection.

Tools and capabilities

The MCP interface exposes these operations:

  • compile_markdown compiles Markdown text or a file path into .docx, with optional PDF conversion.
  • validate_manuscript performs preflight checks before generation.
  • get_guide returns the workflow guidance embedded with the package.
  • get_manual returns the full formatting vocabulary and usage reference.
  • extract_format_from_docx creates a draft format.txt from a Word template.
  • list_presets lists available formatting presets.
  • inspect_preset shows the detailed rules for a selected preset.

Document features include editable OMML equations with numbering and cross-references, repeated table headers across pages, multiple table-border styles, captions, image sizing, footnotes, hyperlinks, inline formatting, bibliography files with CSL styles, section-specific page numbering, and generated table-of-contents fields.

Limitations and notes

A preset is suitable for previewing output when no formal specification exists; final delivery should follow the applicable template or formatting rules. Template extraction can produce entries that require confirmation. The compiler depends on the manuscript following its formatting contract, so malformed markers or incomplete syntax should be corrected through validation before export.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Md To Word

md-to-word is an MCP server that connects AI clients to a deterministic Markdown-to-Word compiler. Its main tools compile manuscripts, validate formatting, retrieve guides, inspect presets, list available presets, and extract a format specification from a Word template. It produces `.docx` files for academic, technical, and formal documents.

Install it through a client configuration that launches `uvx` with `md-to-word-docx[mcp]` and `md-to-word-mcp`. `uvx` fetches the package and dependencies into an isolated environment on first use. You can also install the package with pip and start its Python module directly.

Yes, md-to-word is documented for Claude Desktop, Cursor, and Windsurf through an MCP server configuration. These clients can launch the server with the supplied `uvx` command and call its compilation, validation, guide, preset, and template-extraction tools.

Yes, the `extract_format_from_docx` tool and `md-to-word-template` command create a draft `format.txt` from a `.docx` template. They inspect page settings, styles, fonts, spacing, numbering, and table borders, while flagging items that need confirmation.

No, the compiler performs local export within the Python process and does not require Office, WPS, Pandoc, or a model API. Local command-line use requires Python 3.10 or newer; MCP users can use `uvx` to manage the package environment.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMd To Word AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/md-to-word?style=directory)](https://allmcps.com/mcp/md-to-word)
HTML Embed
<a href="https://allmcps.com/mcp/md-to-word"><img src="https://allmcps.com/api/badge/md-to-word?style=directory" alt="Md To Word on AllMCPs" /></a>