Converts Markdown text into HTML compatible with WeChat official accounts using an external API key.
这是一个基于 MCP (Model Context Protocol) 的 Go 服务器,用于将 Markdown 文本转换为微信公众号格式的 HTML。
内联代码

引用块
git clone https://github.com/geekjourneyx/md2wechat-mcp-server
cd md2wechat-mcp-server
go mod tidy
获取微信 Markdown 编辑器的 API Key 后,设置环境变量:
# Linux/macOS
export MD2WECHAT_API_KEY="wme_your_api_key_here"
# Windows
set MD2WECHAT_API_KEY=wme_your_api_key_here
# 构建
go build -o md2wechat-mcp-server
# 运行
./md2wechat-mcp-server
将 Markdown 文本转换为微信公众号格式的 HTML。
参数:
参数名 | 类型 | 必填 | 描述 |
---|---|---|---|
markdown | string | ✅ | 要转换的 Markdown 文本内容 |
theme | string | ❌ | 主题样式,默认为 "default" |
支持的主题:
default
- 默认微信经典风格bytedance
- 字节范(科技现代风格)chinese
- 中国风(古典雅致风格)apple
- 苹果范(视觉渐变风格)返回结果:
{
"success": true,
"html": "<section>...</section>",
"theme": "default",
"wordCount": 156,
"estimatedReadTime": 1,
"message": "Markdown 转换成功"
}
在 claude_desktop_config.json
中添加:
{
"mcpServers": {
"md2wechat": {
"command": "/path/to/md2wechat-mcp-server",
"env": {
"MD2WECHAT_API_KEY": "wme_your_api_key_here"
}
}
}
}
与 Claude 对话时,可以这样请求:
请帮我将以下 Markdown 文本转换为微信公众号格式:
# 我的文章标题
这是一个**重要**的段落。
## 子标题
- 列表项 1
- 列表项 2
使用中国风主题。
Claude 会调用 convert_markdown
工具,并返回转换后的 HTML 代码。
服务器会处理以下常见错误:
md2wechat-mcp-server/
├── main.go # 主程序文件
├── go.mod # Go 模块依赖
├── README.md # 说明文档
└── api_doc.md # 原始 API 文档
本项目基于 MIT 许可证开源。
如有问题或建议,请提交 Issue 或联系开发团队。
注意: 使用前请确保已正确配置 API Key,并遵守微信 Markdown 编辑器的使用条款。
A comprehensive travel planning server for flight search, accommodation booking, currency exchange, and weather forecasting.
Provides secure access to Atlassian Confluence content and spaces using its REST API.
A server for managing gatherings and sharing expenses.
A simple note-taking server for recording and managing notes with AI models, using AWS DynamoDB for storage.
Interact with Home Assistant to control smart home devices, query states, manage automations, and troubleshoot your smart home setup.
MCP server for easy access to education data through your Canvas LMS instance.
The only platform you need to get paid - all payments in one place, invoicing and accounting reconciliations with Adfin.
a macOS-only MCP server that enables AI agents to capture screenshots of applications, or the entire system.
Dynamic and reflective problem-solving through thought sequences
A multi-agent mesh network designed for completing AI tasks in parallel.