将Mermaid图表转换为PNG或SVG图片的MCP服务(基于FastMCP)
Wellknown found it in public sources; nobody has proven control of it yet. Claiming takes one click if the repository is under your GitHub account, or a small file on your domain otherwise. Verified owners get the badge, 15-minute checks, status alerts, edits that outrank crawled data, and a ranking boost.
Agents can do it too: POST https://wellknown.network/api/v1/claims with {"agent":"mcp-mermaid-converter","method":"well_known_file"} — machine-readable steps at claim.json, guide at /docs/claim.
Everything here was measured by our prober or read from a registry. Nothing is self-reported.
Attributed to the source that supplied each field. Treated as claims, not facts.
# MCP Mermaid Converter [](https://opensource.org/licenses/MIT) [](https://www.python.org/downloads/) 一个基于 [Model Context Protocol (MCP)](https://modelcontextprotocol.io) 和 [FastMCP](https://github.com/jlowin/fastmcp) 的 Mermaid 图表转换服务,可以将 Mermaid 图表文本转换为 PNG 或 SVG 格式的图片。 ## ✨ 特性 - 🎨 支持将 Mermaid 文本直接转换为图片 - 📁 支持从 .mmd 文件读取并转换 - 🖼️ 支持 PNG 和 SVG 两种输出格式 - ⚡ 基于 MCP 协议,可与支持 MCP 的 AI 助手集成 - 🌐 使用 [Kroki.io](https://kroki.io) API 进行高质量图表渲染 - 🔧 简单易用,零配置即可开始使用 ## 📦 安装 ### 使用 uvx(推荐) ```bash uvx mcp-mermaid-converter ``` ### 使用 pip ```bash pip install mcp-mermaid-converter ``` ### 从源码安装 ```bash git clone https://github.com/yourusername/mcp-mermaid-converter.git cd mcp-mermaid-converter pip install -e . ``` ## 🚀 快速开始 ### 作为 MCP 服务器运行 将以下配置添加到你的 MCP 客户端配置文件中(如 Cursor 的 `cursor_mcp_config.json` 或 Claude Desktop 的配置文件): ```json { "mcpServers": { "mcp-mermaid-converter": { "command": "uvx", "args": ["mcp-mermaid-converter"] } } } ``` ### 使用示例 #### 转换 Mermaid 文本 ```python # 通过 MCP 客户端调用 convert_mermaid_text( mermaid_text=""" graph TD A[开始] --> B[处理] B --> C[结束] """, output_file="diagram.png", format="png" ) ``` #### 转换 Mermaid 文件 ```python # 通过 MCP 客户端调用 convert_mermaid_file( input_file="diagram.mmd", output_file="diagram.svg", format="svg" ) ``` ## 🛠️ MCP 工具说明 ### convert_mermaid_text 将 Mermaid 图表文本直接转换为图片格式。 **参数:** - `mermaid_text` (string, 必需): Mermaid 图表的文本内容 - `output_file` (string, 必需): 输出图片文件的路径 - `format` (string, 可选): 输出格式,支持 `png` 或 `svg`,默认为 `png` **返回:** 成功消息,包含输出文件路径和文件大小。 ### convert_mermaid_file 将 Mermaid 图表文件(.mmd)转换为图片格式。 **参数:** - `input_file` (string, 必需): Mermaid 文件的路径(.mmd 文件) - `output_file` (string, 必需): 输出图片文件的路径 - `format` (string, 可选): 输出格式,支持 `png` 或 `svg`,默认为 `png` **返回:** 成功消息,包含输出文件路径和文件大小。 ## 📝 支持的 Mermaid 图表类…
Mapped onto the structured taxonomy from declared text and observed tool names. Confidence shown for derived entries.
Every source is kept verbatim. Field changes are logged as events.