MD-DOCX Converter
MD-DOCX Конвертер
Инструмент на Python для двустороннего преобразования между Markdown (.md) и Microsoft Word (.docx). Разработан для упрощения переноса контента между документами Word и ИИ-инструментами, такими как Claude, ChatGPT и GitHub Copilot.
Что он делает
Преобразует
.md→.docxс правильной иерархией заголовков (Название, Заголовок 1–9)Преобразует
.docx→.mdв чистый GitHub Flavored Markdown (GFM)Запускается с простого ярлыка на рабочем столе — не требуется знание командной строки
Обрабатывает заголовки, жирный/курсив/зачеркнутый текст, списки, списки задач, таблицы, цитаты, блоки кода, изображения и гиперссылки
См. MarkdownSyntax.md для получения полной информации о сопоставлении элементов и примечаний о том, что сохраняется, аппроксимируется или отбрасывается.
Related MCP server: MarkltDown MCP Server
Требования
Windows 10/11
Python 3.11+
Следующие пакеты Python (устанавливаются через pip):
pip install markdown-it-py python-docxНастройка
1. Клонируйте репозиторий
git clone https://github.com/cjwpenner/md-docx-converter.git
cd md-docx-converter2. Установите зависимости
pip install markdown-it-py python-docx3. Создайте ярлык на рабочем столе
pip install pywin32
python create_shortcut.pyЭто создаст ярлык MD-DOCX Converter на вашем рабочем столе Windows. pywin32 нужен только для создания ярлыка — он не требуется для запуска самого конвертера.
4. Запустите конвертер
Дважды щелкните MD-DOCX Converter на рабочем столе. Откроется окно консоли с запросом:
MD ↔ DOCX Converter
--------------------
Enter file path:Вставьте или введите полный путь к вашему файлу .md или .docx и нажмите Enter. Преобразованный файл будет сохранен в той же директории с измененным расширением.
Вы также можете запускать его прямо из командной строки:
python md_docx_converter/converter.pyПримечания по конвертации
Иерархия заголовков
Сопоставление уровней заголовков зависит от контекста:
MD → DOCX: Если в документе ровно один
#, он становится Названием (Title) в Word. Все остальные заголовки сдвигаются на один уровень вниз. Если заголовков#несколько, все они становятся Заголовком 1 без Названия.DOCX → MD: Если в документе есть стиль Название (Title), он становится
#. Все заголовки сдвигаются вверх соответствующим образом. Если Названия нет, Заголовок 1 становится#.
Элементы с потерей данных
Форматирование Word, не имеющее эквивалента в Markdown, аппроксимируется как жирный шрифт:
Форматирование Word | Вывод Markdown |
Подчеркивание |
|
Выделение цветом |
|
Капитель |
|
Цвет шрифта | Удаляется (текст сохраняется) |
Изображения
DOCX → MD: Внедренные изображения извлекаются в папку
{filename}_images/рядом с выходным файлом.md.MD → DOCX: Изображения, на которые ссылаются по относительному пути, внедряются повторно. Отсутствующие изображения заменяются на
[image not found: path].
Интеграция с Claude Code
Этот инструмент интегрируется с Claude Code либо как плагин (рекомендуется — все настраивается двумя командами), либо как автономный MCP-сервер (для ручной настройки или Claude Desktop).
Вариант А: Плагин Claude Code (рекомендуется)
Плагин объединяет конфигурацию MCP-сервера и навык /convert. Выполните эти две команды внутри Claude Code:
/plugin marketplace add cjwpenner/md-docx-converter
/plugin install md-docx-converter@md-docx-converterЭто все — дальнейшая настройка не требуется. После выполнения /reload-plugins Claude получит инструменты конвертации, и вы сможете вызывать навык напрямую:
/md-docx-converter:convert path/to/file.md
/md-docx-converter:convert path/to/report.docxИли просто попросите естественным языком: "Convert this to a Word document", и Claude автоматически использует инструменты.
Вариант Б: Только MCP-сервер (ручная настройка)
Используйте этот вариант, если вам нужны только инструменты MCP без плагина или если вы настраиваете Claude Desktop, а не Claude Code.
Установите пакет:
pip install mcp-md-docxClaude Code — зарегистрируйте MCP-сервер:
claude mcp add md-docx-converter --transport stdio -- uvx mcp-md-docxClaude Desktop — добавьте в %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"md-docx-converter": {
"type": "stdio",
"command": "uvx",
"args": ["mcp-md-docx"]
}
}
}Доступные инструменты
Инструмент | Что он делает |
| Чтение файла |
| Создание |
| Преобразование файла |
| Преобразование файла |
После настройки вы можете говорить, например:
"Read
report.docxand summarise it""Turn this into a Word document and save it to my Desktop"
"Convert all the bullet points in
notes.docxinto 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Лицензия
Этот проект лицензирован под GNU General Public License v3.0 (GPLv3). Вы можете свободно использовать, изменять и распространять это программное обеспечение при условии, что любые производные работы также распространяются на тех же условиях лицензии.
См. LICENSE для получения полного текста лицензии.
Сторонние библиотеки
Этот проект зависит от следующих библиотек с открытым исходным кодом, все они лицензированы по MIT:
Библиотека | Назначение | Лицензия |
Фреймворк сервера Model Context Protocol | MIT | |
Парсер GitHub Flavored Markdown | MIT | |
Чтение и запись файлов Word | MIT |
Полные тексты лицензий воспроизведены в THIRD_PARTY_NOTICES.md.
Available Tools
4 toolsconvert_docx_file_to_mdA
Convert a Word (.docx) file to a Markdown (.md) file. The output is saved alongside the input file. Returns the Markdown content.
Inputs: path (required). Returns: result
convert_md_file_to_docxA
Convert a Markdown (.md) file to a Word (.docx) file. The output is saved alongside the input file with the same name and .docx extension.
Inputs: path (required). Returns: result
read_docxA
Read a Word (.docx) document and return its full content as Markdown text. Use this when the user asks you to read, summarise, edit, or work with a Word document.
Inputs: path (required). Returns: result
write_docxA
Convert Markdown text to a Word (.docx) document and save it to disk. Use this when the user asks you to create or save a Word document from text or Markdown content. The output_path should be an absolute path ending in .docx.
Inputs: markdown (required), output_path (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
The tools have significant overlap in purpose, particularly between convert_docx_file_to_md and read_docx (both convert DOCX to Markdown), and between convert_md_file_to_docx and write_docx (both convert Markdown to DOCX). The descriptions attempt to differentiate use cases (file conversion vs. content reading/writing), but an agent could easily misselect between these pairs due to unclear functional boundaries.
The tool names follow a consistent verb_noun pattern with snake_case throughout (e.g., convert_docx_file_to_md, read_docx). The only minor deviation is that some names include 'file' while others do not, but overall the naming is predictable and readable.
With 4 tools, the count is reasonable for a conversion-focused server, but it feels borderline thin given the overlapping functionality. A more streamlined set might have 2-3 tools instead, as the current count includes redundancy that doesn't add clear value to the surface.
For a DOCX-Markdown conversion domain, the tools cover the core bidirectional conversion operations and basic file handling. However, there are minor gaps, such as no tool for editing or manipulating the content in between conversions, which agents might need to work around by combining tools or external processing.
Maintenance
Related MCP Connectors
Convert PDF, Word, Excel, PowerPoint, e-mails and web pages to clean Markdown for LLMs.
Convert PDF, DOCX, XLSX and 25 other formats to clean Markdown for LLMs and RAG. No key or account.
Document to Markdown: convert Word, Excel, PowerPoint and PDF files to Markdown for an LLM.
Turn Markdown and AI answers into Word (.docx) with native equations, or into PDF.
Related MCP Servers
- AlicenseAqualityDmaintenanceConverts Markdown documents to professional Word documents with advanced formatting capabilities including mathematical formulas, custom styling, tables, images, headers/footers, and watermarks.486 npm14MIT
- FlicenseNot gradedqualityDmaintenanceConverts files (PDF, Word, images, etc.) to Markdown within Claude Desktop to reduce token usage.-
- AlicenseAqualityCmaintenanceConverts documents between Markdown, PDF, DOCX, and HTML locally with AI-friendly Markdown output and secure file access.613 npmMIT
- AlicenseAqualityBmaintenanceEnables Claude to create, edit, mail-merge, convert and preview documents by driving a locally installed WordCraft engine headless, covering DOCX, PDF, ODT, RTF, HTML, Markdown and LaTeX. Supports templates, tables, images, comments, tracked changes, merge fields from CSV/XLSX/ODS, page rendering and folder-wide batch processing.11Apache 2.0