npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cylixlee/mdocx

v0.2.7

Published

Convert Markdown file to DOCX format

Readme

MDOCX

English MCP version downloads license

将 Markdown 转换为 Word 文档的 MCP 服务。致力于生成无需手动二次排版的、高质量的 DOCX 文件。

demo

特性

  • KaTeX 数学公式 — 行内 $...$ 与块级 $$...$$,支持 ```math 围栏代码块
  • 图片自动内嵌 — HTTP、本地文件、SVG(含 PNG 回退)
  • 脚注[^label] 语法
  • 三线表 — 学术论文风格
  • 任务列表 — 复选框
  • 代码块 — 带边框与背景样式
  • 中文排版预设 — 宋体 + Times New Roman,标题黑体,首行缩进
  • MCP Server — 在 OpenCode、Claude Desktop、Cursor 等 AI 工具内直接生成 DOCX

快速开始

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

预设:--preset academic(默认)或 --preset minimal

配置文件:--config style.json,参考 examples/sample-config.json

安装

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

CLI 用法

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

| 选项 | 说明 | | --------------------- | ---------------------------------------------------- | | -i, --input <file> | 输入 Markdown 文件(必填) | | -o, --output <file> | 输出 .docx 文件(默认替换扩展名为 .docx) | | -p, --preset <name> | 样式预设:academicminimal(默认 academic) | | -c, --config <file> | JSON 配置文件(可含 preset, style, math 等字段) | | -v, --version | 输出版本号 |

预设:academic(默认),minimal

配置文件:参考 examples/sample-config.json 获取完整配置参考。--preset 会覆盖配置文件中的 preset 字段。

MCP 模式:mdocx mcp 启动 MCP server(stdio transport),供 AI 工具调用。

MCP Server

在 AI 工具中直接生成 DOCX。

OpenCode

编辑 opencode.json

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

Claude Desktop

编辑 claude_desktop_config.json

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

工具:convert_markdown_to_docx

| 参数 | 类型 | 必填 | 说明 | | ------------ | --------------------------- | ---- | ----------------------------------------- | | inputPath | string | ✓ | 输入 Markdown 文件路径 | | outputPath | string | | 输出 .docx 路径(默认替换扩展名为 .docx) | | preset | "academic" | "minimal" | | 样式预设 | | config | string | | JSON 配置文件路径 |

预设样式

Academic(默认)— Times New Roman + 宋体,小四 12pt,1.5 倍行距,标题黑体,首行缩进,三线表。

Minimal — Calibri,11pt,1.15 倍行距,彩色行内元素,Consolas 代码字体。

自定义:--config 指定 JSON 文件,选项会深度合并到预设之上。

致谢

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

本项目基于 markdown-docx(作者 Vace)进行独立开发。本人对本衍生项目的维护负全部责任。请勿向原作者报告本项目的任何问题,所有 issue 请提交至此仓库。