About Md2card Mcp Server
MD2Card MCP Server converts Markdown documents into styled knowledge cards through an MCP interface. It runs via npx or a global install and requires the MD2CARD_API_KEY environment variable. It suits users who want to turn notes or articles into shareable card images.
Key features
- 01Supports 22 visual theme styles
- 02Offers preset card sizes by type
- 03Accepts Markdown text or a file path
- 04Scrapes WeChat Official Account articles into Markdown
Use cases
- 01Turning Markdown notes into Xiaohongshu-style cards
- 02Converting WeChat articles into shareable images
- 03Generating A4 or poster-sized printable content
MCP support
This project is an MCP server that exposes card generation and WeChat article scraping tools to MCP clients, which launch it through their configuration files.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
1Saved tool list · updated 3w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| markdown | string | No | Markdown content |
| markdownFile | string | No | Markdown file path |
| type | string | No | Card type (Xiaohongshu/square/mobile poster/A4 print) |
| width | number | No | Card width |
| height | number | No | Card height |
| theme | enum | No | Card theme (default: Apple Notes) (Apple Notes/spiral notebook/pop art/Byte style/Alibaba orange/art deco/glassmorphism/warm and soft/minimalist premium gray/dreamy gradient/fresh and natural/purple Xiaohongshu/notebook/dark tech/retro typewriter/watercolor art/Chinese traditional/children's fairy tale/business brief/Japanese magazine/minimalist black and white/cyberpunk/Qingye morning light)apple-notes | coil-notebook | pop-art | bytedance | alibaba | art-deco | glassmorphism | warm | minimal | dreamy | nature | xiaohongshu | notebook | darktech | typewriter | watercolor | traditional-chinese | fairytale | business | japanese-magazine | minimalist | cyberpunk | meadow-dawn |
| themeMode | enum | No | Card theme mode (default mode/pink-blue mode/mint mode/purple mode/blue mode/pink mode/yellow mode/light mode/dark mode)default-mode | pink-blue-mode | mint-mode | purple-mode | blue-mode | pink-mode | yellow-mode | light-mode | dark-mode |
| splitMode | string | No | Card splitting mode |
| mdxMode | boolean | No | Whether to enable MDX mode |
| overHiddenMode | boolean | No | Whether to enable hiding content that exceeds the height |
Details
From the project READMEMD2Card MCP 服务器
homepage: https://md2card.cn
MD2Card Markdown 转知识卡片 将 Markdown 文档转换为精美的知识卡片,支持多种风格
安装与使用
方法一:使用 npx(推荐)
直接使用 npx 运行(需要设置 API 密钥环境变量):
# 设置API密钥并运行
MD2CARD_API_KEY="您的API密钥" npx md2card-mcp-server
方法二:全局安装
# 安装
npm install -g md2card-mcp-server
# 运行(需要设置API密钥环境变量)
MD2CARD_API_KEY="您的API密钥" md2card-mcp-server
方法三:本地配置
clone 项目到本地,找到 index.js 路径替换到客户端 mcp 配置文件中
功能特性
- 支持 22 种主题样式:苹果备忘录 波普艺术 艺术装饰 玻璃拟态 温暖柔和 简约高级灰 梦幻渐变 清新自然 紫色小红书 笔记本 暗黑科技 复古打字机 水彩艺术 中国传统 儿童童话 商务简报 日本杂志 极简黑白 赛博朋克
- 智能尺寸适配
- 三种内容拆分模式:默认自动拆分
- 通过 MCP 协议提供标准化接口
- 新功能:支持直接读取 Markdown 文件
- 新功能:支持通过 type 参数直接指定卡片类型/尺寸
- 新功能:支持抓取微信公众号文章并转换为 Markdown 格式
- 新功能:自动提取文章标题、作者、描述和封面图片
使用方法
方法一:提供 Markdown 内容
{
"markdown": "# 标题\n\n内容"
}
方法二:提供 Markdown 文件路径
{
"markdownFile": "/path/to/your/file.md"
}
方法三:指定卡片类型/尺寸
可以通过type参数直接指定卡片类型,支持以下类型:
- 小红书:440x586
- 正方形:500x500
- 手机海报:440x782
- A4 纸打印:595x842
{
"markdown": "# 标题\n\n内容",
"type": "小红书"
}
也可以通过 width 和 height 参数指定:
{
"markdown": "# 标题\n\n内容",
"width": "小红书",
"height": 586
}
方法四:抓取微信公众号文章
使用 wechat_scraper 工具抓取微信公众号文章:
{
"url": "https://mp.weixin.qq.com/s/your-article-id"
}
返回结果包含完整的 Markdown 格式文章,包括:
- 文章标题
- 作者信息
- 文章描述
- 封面图片
- 正文内容
客户端配置
通用 MCP 客户端配置
在 MCP 客户端配置文件中添加以下内容:
{
"md2card-server": {
"command": "npx",
"args": ["md2card-mcp-server@latest"],
"env": {
"MD2CARD_API_KEY": "您的API密钥"
}
}
}
Cursor 客户端配置
在 Cursor 的 MCP 客户端配置文件中添加以下内容:
{
"md2card-server": {
"command": "npx",
"args": ["-y", "md2card-mcp-server@latest"],
"env": {
"MD2CARD_API_KEY": "您的API密钥"
}
}
}
注意:MD2CARD_API_KEY 环境变量是必需的,只有在实际运行时才会检查此环境变量。安装包时不需要此环境变量。
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.