🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@cylixlee/mdocx

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cylixlee/mdocx

Convert Markdown file to DOCX format

latest
Source
npmnpm
Version
0.2.7
Version published
Maintainers
1
Created
Source

MDOCX

中文 MCP version downloads license

Markdown to DOCX converter and MCP server. Generates high-quality DOCX that requires no manual reformatting.

demo

Features

  • KaTeX math — inline $...$ and block $$...$$, ```math fenced blocks
  • Auto-embed images — HTTP, local, SVG with PNG fallback
  • Footnotes[^label] syntax
  • Three-line tables — academic paper style
  • Task lists — checkboxes
  • Code blocks — styled borders and background
  • CJK typography presets — SimSun + Times New Roman, Heiti headings, first-line indent
  • MCP Server — generate DOCX directly from AI tools (OpenCode, Claude Desktop, Cursor, etc.)

Quick Start

npx @cylixlee/mdocx --input paper.md --output paper.docx

Presets: --preset academic (default) or --preset minimal

Config file: --config style.json, see examples/sample-config.json

Installation

npm install -g @cylixlee/mdocx
# or
pnpm add -g @cylixlee/mdocx

CLI Usage

mdocx --input paper.md
mdocx --input paper.md --output paper.docx
mdocx --input paper.md --preset minimal
mdocx --input paper.md --config style.json
mdocx --version
mdocx --help
OptionDescription
-i, --input <file>Input .md file (required)
-o, --output <file>Output .docx file (defaults to .docx extension)
-p, --preset <name>Style preset: academic or minimal (default academic)
-c, --config <file>JSON config file (may include preset, style, math, etc.)
-v, --versionOutput version number

Presets: academic (default), minimal

Config file: see examples/sample-config.json for a full reference. --preset overrides the preset in a config file.

MCP mode: mdocx mcp starts an MCP server (stdio transport) for AI tools.

MCP Server

Generate DOCX directly from AI tools.

OpenCode

Edit opencode.json:

{
  "mcp": {
    "mdocx": {
      "type": "local",
      "command": ["npx", "-y", "@cylixlee/mdocx", "mcp"],
      "enabled": true
    }
  }
}

Claude Desktop

Edit claude_desktop_config.json:

{
  "mcpServers": {
    "mdocx": {
      "command": "npx",
      "args": ["-y", "@cylixlee/mdocx", "mcp"]
    }
  }
}

Tool: convert_markdown_to_docx

ParameterTypeRequiredDescription
inputPathstringInput .md file path
outputPathstringOutput .docx path (defaults to .docx extension)
preset"academic" | "minimal"Style preset
configstringJSON config file path

Presets

Academic (default) — Times New Roman + SimSun, 12pt, 1.5× line spacing, Heiti headings, first-line indent, three-line tables.

Minimal — Calibri, 11pt, 1.15× line spacing, colored inline elements, Consolas code font.

Customization: --config with a JSON file deep-merges over the preset.

Credits

Forked from markdown-docx · Built with marked, KaTeX, docx · CLI via commander · MCP via @modelcontextprotocol/sdk

This project is independently developed based on markdown-docx by Vace. I take full responsibility for the maintenance of this derivative work. Please do not report issues from this project to the original author; all issues should be submitted to this repository.

Keywords

markdown

FAQs

Package last updated on 16 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts