Markdown to Word for developers and agents
The converter behind md2word.app is free and open source, published to npm as markdown-to-word. Every way of running it, below, converts on your own machine; the converter uploads nothing. With MCP or WebMCP, the agent sees the Markdown it sends and the file it gets back, as with any file you share with it.
Claude Desktop (one click)
Download markdown-to-word.mcpb and double-click it. Claude Desktop installs the MCP server as an extension, so Claude can turn Markdown into Word documents on your computer. You don’t need Node or a terminal: Claude Desktop includes Node. To install it another way, drag the file into Claude Desktop, or open Settings > Extensions > Advanced settings > Install Extension.
Command line
npx markdown-to-word report.md
npx markdown-to-word report.md -o out/report.docx
cat reply.md | npx markdown-to-word -o reply.docx
A file converts to a .docx next to it with the same name, replacing any file already there. Reading from stdin needs -o, and -o - writes the .docx to stdout. --font-preset chinese-official applies the Chinese official document (公文) style. Install it globally (npm install -g markdown-to-word) to get the shorter md2w command. It needs Node 22.12 or later. See the full CLI reference.
Node library
import { writeFile } from 'node:fs/promises';
import { convertMarkdownToWord } from 'markdown-to-word';
const blob = await convertMarkdownToWord('# Hello\n\nFrom **Markdown**.');
await writeFile('hello.docx', Buffer.from(await blob.arrayBuffer()));
It returns the .docx as a Blob. For the 公文 style, import FONT_PRESETS too and pass { fontPreset: FONT_PRESETS['chinese-official'] }. In the library, remote images are downloaded so they can be embedded. See the API reference.
MCP server for AI agents
npx -y markdown-to-word mcp runs a local Model Context Protocol server on stdio. Add it to Claude Code:
claude mcp add markdown-to-word -- npx -y markdown-to-word mcp
Or to any MCP client:
{
"mcpServers": {
"markdown-to-word": {
"command": "npx",
"args": ["-y", "markdown-to-word", "mcp"]
}
}
}
Its tool, convert_markdown_to_word, takes the Markdown as a string or the path of a .md file, writes the .docx to output_path, and returns its path and size. Because an agent may be acting on instructions it read somewhere, the tool is deliberately limited:
- It reads only Markdown and text files (
.md,.markdown,.mdown,.txt) and writes only.docxfiles. - It never replaces an existing file unless you pass
overwrite: true, and never writes through a symlink. - It makes no network connections, so remote images stay as links. To embed one, have the agent pass it as a
data:URI.
See the MCP reference.
WebMCP in the browser
In a browser with WebMCP, md2word.app registers a convert_markdown_to_docx tool for agents working in the tab. It takes Markdown, shows the result on the page, and returns the .docx as base64. As with pasting, the conversion runs in the tab and nothing is uploaded.
Related MCP server
Open and Async MCP, from the same author, gives an agent async-first writing tools: draft a decision doc, swap a planned meeting for an async alternative, or score a status update. If your team drafts in Markdown and still owes some readers a Word file, this converter covers that step. The book behind it is Open and Async.
claude mcp add open-async -- npx -y @open-and-async/mcp
For crawlers and LLMs
/llms.txtindexes the site, and/llms-full.txthas all of it in one file.- Every English page has a Markdown version: add
.md(for example/developers.md), or request the page withAccept: text/markdown.
Source
The code is on GitHub under the MIT license.
Convert Markdown to Word now. It's free, and nothing is uploaded.