loading…
Search for a command to run...
loading…
Bidirectional Markdown ↔ Word (.docx) converter. Read Word documents directly into Claude as Markdown, or save Claude's output as a properly formatted .docx wit
Bidirectional Markdown ↔ Word (.docx) converter. Read Word documents directly into Claude as Markdown, or save Claude's output as a properly formatted .docx with heading styles (Title, Heading 1–9), bold, italic, tables, lists, code blocks, and images. No cloud upload — runs entirely on your machine using python.
A Python tool for bidirectional conversion between Markdown (.md) and Microsoft Word (.docx). Designed to make it easy to move content between Word documents and AI tools like Claude, ChatGPT, and GitHub Copilot.
.md → .docx with correct heading hierarchy (Title, Heading 1–9).docx → .md as clean GitHub Flavored Markdown (GFM)See MarkdownSyntax.md for the full element mapping and notes on what is preserved, approximated, or dropped.
pip install markdown-it-py python-docx
git clone https://github.com/cjwpenner/md-docx-converter.git
cd md-docx-converter
pip install markdown-it-py python-docx
pip install pywin32
python create_shortcut.py
This creates an MD-DOCX Converter shortcut on your Windows desktop. pywin32 is only needed to create the shortcut — it is not required to run the converter itself.
Double-click MD-DOCX Converter on your desktop. A console window opens and prompts:
MD ↔ DOCX Converter
--------------------
Enter file path:
Paste or type the full path to your .md or .docx file and press Enter. The converted file is saved in the same directory with the extension swapped.
You can also run directly from the command line:
python md_docx_converter/converter.py
The heading level mapping is context-dependent:
# in the document, it becomes a Word Title. All other headings shift down by one level. If there are multiple # headings, they all become Heading 1 with no Title.#. All headings shift up accordingly. If there is no Title, Heading 1 becomes #.Word formatting that has no Markdown equivalent is approximated as bold:
| Word formatting | Markdown output |
|---|---|
| Underline | **bold** |
| Highlight | **bold** |
| Small caps | **bold** |
| Font colour | Stripped (text kept) |
{filename}_images/ folder next to the output .md file.[image not found: path].This tool integrates with Claude Code as either a plugin (recommended — gets everything in two commands) or a standalone MCP server (for manual setup or Claude Desktop).
The plugin bundles the MCP server configuration and a /convert skill. Run these two commands inside Claude Code:
/plugin marketplace add cjwpenner/md-docx-converter
/plugin install md-docx-converter@md-docx-converter
That is it — no further configuration needed. After running /reload-plugins, Claude gains the conversion tools and you can invoke the skill directly:
/md-docx-converter:convert path/to/file.md
/md-docx-converter:convert path/to/report.docx
Or just ask naturally: "Convert this to a Word document" and Claude will use the tools automatically.
Use this if you want just the MCP tools without the plugin, or if you are configuring Claude Desktop rather than Claude Code.
Install the package:
pip install mcp-md-docx
Claude Code — register the MCP server:
claude mcp add md-docx-converter --transport stdio -- uvx mcp-md-docx
Claude Desktop — add to %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"md-docx-converter": {
"type": "stdio",
"command": "uvx",
"args": ["mcp-md-docx"]
}
}
}
| Tool | What it does |
|---|---|
read_docx |
Read a .docx file — returns full Markdown text to the AI |
write_docx |
Create a .docx from Markdown text the AI has written |
convert_md_file_to_docx |
Convert a .md file on disk to .docx |
convert_docx_file_to_md |
Convert a .docx file on disk to .md |
Once configured, you can say things like:
report.docx and summarise it"notes.docx into a table"md_docx_converter/
├── converter.py # CLI entry point
├── md_to_docx.py # Markdown → Word conversion
├── docx_to_md.py # Word → Markdown conversion
├── heading_mapper.py # Heading hierarchy pre-scan logic
├── image_handler.py # Image extraction and embedding
└── launch.pyw # Desktop shortcut launcher
mcp_md_docx/
├── server.py # MCP server (four tools)
└── __main__.py # Entry point for python -m mcp_md_docx
create_shortcut.py # One-time shortcut setup script
pyproject.toml # PyPI packaging config
This project is licensed under the GNU General Public License v3.0 (GPLv3). You are free to use, modify, and distribute this software, provided that any derivative works are also distributed under the same licence.
See LICENSE for the full licence text.
This project depends on the following open source libraries, all MIT-licensed:
| Library | Purpose | Licence |
|---|---|---|
| mcp | Model Context Protocol server framework | MIT |
| markdown-it-py | GitHub Flavored Markdown parser | MIT |
| python-docx | Read and write Word .docx files |
MIT |
Full licence texts are reproduced in THIRD_PARTY_NOTICES.md.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"md-docx-converter": {
"command": "npx",
"args": []
}
}
}PRs, issues, code search, CI status
Database, auth and storage
Reference / test server with prompts, resources, and tools.
Secure file operations with configurable access controls.