Skip to main content
Glama

🎨 Mermaid Chart MCP

npm version License: MIT Node.js Version TypeScript MCP Compatible

🚀 一个强大的 Model Context Protocol (MCP) 服务器,专为将 Mermaid 图表代码渲染为高质量图片而设计

✨ 特性

  • 🎯 高质量渲染 - 支持 PNG、SVG、PDF 多种格式输出

  • 🎨 多主题支持 - 内置 default、dark、forest、neutral 四种主题

  • ☁️ 云存储集成 - 基于腾讯云服务器 + MinIO 的高性能文件存储服务

  • 🔗 在线预览 - 自动生成在线访问链接,支持即时分享

  • 🛡️ 安全可靠 - 文件自动过期机制,保护隐私安全

  • 高性能 - 使用 Puppeteer + Sharp 优化渲染质量

  • 🔧 易于集成 - 完美兼容各大 AI 编辑器和 MCP 客户端

Related MCP server: DiagramMCP

📦 安装

快速开始(推荐)

使用 @latest 标签获取最新版本:

npx @pickstar-2002/mermaid-chart-mcp@latest

全局安装

npm install -g @pickstar-2002/mermaid-chart-mcp@latest

项目依赖

npm install @pickstar-2002/mermaid-chart-mcp@latest

🚀 使用方法

在 Claude Desktop 中配置

claude_desktop_config.json 中添加以下配置:

{
  "mcpServers": {
    "mermaid-chart": {
      "command": "npx",
      "args": ["@pickstar-2002/mermaid-chart-mcp@latest"]
    }
  }
}

在 Cursor 中配置

.cursorrules 或项目配置中添加:

{
  "mcp": {
    "servers": {
      "mermaid-chart": {
        "command": "npx @pickstar-2002/mermaid-chart-mcp@latest"
      }
    }
  }
}

在 WindSurf 中配置

windsurf_config.json 中配置:

{
  "mcpServers": {
    "mermaid-chart": {
      "command": "npx",
      "args": ["@pickstar-2002/mermaid-chart-mcp@latest"]
    }
  }
}

在 CodeBuddy 中配置

在项目根目录创建 .codebuddy/mcp.json

{
  "servers": {
    "mermaid-chart": {
      "command": "npx",
      "args": ["@pickstar-2002/mermaid-chart-mcp@latest"]
    }
  }
}

🛠️ API 参考

render_mermaid_chart

将 Mermaid 代码渲染为高质量图片文件。

参数

参数名

类型

必需

默认值

描述

mermaidCode

string

-

Mermaid 图表代码

outputPath

string

-

输出文件路径(包含文件名和扩展名)

format

string

png

输出格式:pngsvgpdf

width

number

1200

图片宽度(像素)

height

number

800

图片高度(像素)

backgroundColor

string

white

背景颜色

theme

string

default

主题:defaultdarkforestneutral

uploadToMinio

boolean

false

是否上传到云存储并返回在线链接

minioExpiryDays

number

7

文件有效期(天数),最大30天

示例

// 基础用法
{
  "mermaidCode": "graph TD\n    A[开始] --> B[处理]\n    B --> C[结束]",
  "outputPath": "./output/flowchart.png"
}

// 高级用法 - 启用云存储
{
  "mermaidCode": "sequenceDiagram\n    Alice->>Bob: Hello Bob!\n    Bob-->>Alice: Hello Alice!",
  "outputPath": "./output/sequence.png",
  "format": "png",
  "theme": "dark",
  "width": 1600,
  "height": 1000,
  "uploadToMinio": true,
  "minioExpiryDays": 14
}

🌟 支持的图表类型

  • 📊 流程图 (Flowchart)

  • 🔄 序列图 (Sequence Diagram)

  • 📈 甘特图 (Gantt Chart)

  • 🏗️ 类图 (Class Diagram)

  • 🗂️ 状态图 (State Diagram)

  • 🍰 饼图 (Pie Chart)

  • 🌐 Git 图 (Git Graph)

  • 👥 用户旅程图 (User Journey)

  • 🎯 需求图 (Requirement Diagram)

☁️ 云存储服务

🚀 高性能文件存储

本项目集成了基于腾讯云服务器 + MinIO打造的高性能文件存储服务:

  • 🌐 全球加速 - 基于腾讯云 CDN 的全球节点加速

  • 🔒 安全可靠 - 企业级安全防护,数据加密传输

  • ⚡ 极速访问 - 毫秒级响应,支持高并发访问

  • 📱 即时分享 - 生成在线预览链接,支持跨平台分享

  • 🗂️ 智能管理 - 自动文件过期清理,节省存储空间

  • 💰 成本优化 - 按需使用,无需预付费用

使用云存储

// 启用云存储上传
{
  "mermaidCode": "graph LR\n    A --> B --> C",
  "outputPath": "./chart.png",
  "uploadToMinio": true,
  "minioExpiryDays": 7  // 7天后自动过期
}

返回结果包含:

  • 📁 本地文件路径

  • 🔗 在线访问链接

  • 📊 文件大小信息

  • ⏰ 过期时间详情

🎨 主题预览

主题

描述

适用场景

default

经典白色主题

📄 文档、报告

dark

深色主题

🌙 演示、展示

forest

森林绿主题

🌲 自然、环保主题

neutral

中性灰主题

🏢 商务、正式场合

📋 系统要求

  • Node.js >= 18.0.0

  • 操作系统: Windows, macOS, Linux

  • 内存: 建议 >= 2GB

  • 磁盘空间: >= 500MB(用于 Puppeteer 浏览器)

🔧 开发

克隆项目

git clone https://github.com/pickstar-2002/mermaid-chart-mcp.git
cd mermaid-chart-mcp

安装依赖

npm install

开发模式

npm run dev

构建项目

npm run build

运行测试

npm test

🤝 贡献

欢迎贡献代码!请遵循以下步骤:

  1. 🍴 Fork 本项目

  2. 🌿 创建特性分支 (git checkout -b feature/AmazingFeature)

  3. 💾 提交更改 (git commit -m 'Add some AmazingFeature')

  4. 📤 推送到分支 (git push origin feature/AmazingFeature)

  5. 🔄 创建 Pull Request

📄 许可证

本项目基于 MIT License 开源。

🐛 问题反馈

如果您遇到任何问题,请在 GitHub Issues 中提交。

📚 相关链接

🙏 致谢

感谢以下开源项目:


📞 联系方式

如有任何问题或建议,欢迎联系:

微信: pickstar_loveXX


⭐ 如果这个项目对您有帮助,请给个 Star!⭐

Made with ❤️ by pickstar-2002

Available Tools

1 tool
render_mermaid_chartC

将 Mermaid 代码渲染为高质量图片文件

ParametersJSON Schema
NameRequiredDescriptionDefault
mermaidCodeYesMermaid 图表代码
outputPathYes输出文件路径(包含文件名和扩展名)
formatNo输出格式(png, svg, pdf),默认为 pngpng
widthNo图片宽度(像素),默认为 1200
heightNo图片高度(像素),默认为 800
backgroundColorNo背景颜色,默认为 whitewhite
themeNoMermaid 主题,默认为 defaultdefault
uploadToMinioNo是否上传到MinIO存储并返回在线链接,默认为 false
minioExpiryDaysNoMinIO文件有效期(天数),默认7天,最大30天,超过30天按30天计算

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions rendering to an image file but lacks details on permissions, side effects (e.g., file system changes), error handling, or performance aspects. This is inadequate for a tool with 9 parameters and potential system impacts.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and wastes no space, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (9 parameters, no output schema, and no annotations), the description is insufficient. It lacks information on return values, error conditions, and behavioral traits needed for safe and effective use. The agent would be left guessing about outcomes and side effects.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all parameters. The description does not add any parameter-specific information beyond what the schema provides, such as usage examples or constraints. Baseline 3 is appropriate when the schema handles all parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('render') and resource ('Mermaid code to high-quality image file'). It specifies the transformation from code to image, which is specific and unambiguous. However, without sibling tools, we cannot assess differentiation, so it cannot earn a perfect 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or constraints. It states what the tool does but not the context or scenarios for its application, leaving the agent without usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 1 tool updatev1.0.0
    • Changedrender_mermaid_chart2 fields changed
      • addedInput schema / properties / minioExpiryDays
        Added value: +{
        +  "default": 7,
        +  "description": "MinIO文件有效期(天数),默认7天,最大30天,超过30天按30天计算",
        +  "maximum": 30,
        +  "minimum": 1,
        +  "type": "number"
        +}
      • addedInput schema / properties / uploadToMinio
        Added value: +{
        +  "default": false,
        +  "description": "是否上传到MinIO存储并返回在线链接,默认为 false",
        +  "type": "boolean"
        +}
  2. 1 tool update
    • First observedrender_mermaid_chart

TDQS

B3.1/5.0
Disambiguation5/5

With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool has a clear and distinct purpose: rendering Mermaid code to images.

Naming Consistency5/5

Since there is only one tool, naming consistency is inherently perfect. The tool name 'render_mermaid_chart' follows a clear verb_noun pattern, but with no other tools to compare, it stands alone without inconsistency.

Tool Count2/5

A single tool is too few for a server named 'Mermaid Chart MCP', which suggests a broader scope for working with Mermaid charts. Expected operations like parsing, validating, or converting chart types are missing, making the set feel incomplete and thin for the domain.

Completeness2/5

The tool surface is severely incomplete for a Mermaid chart server. While rendering is a core function, there are obvious gaps such as creating, editing, validating, or exporting charts in other formats, which limits agent workflows and causes potential dead ends.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to generate UML diagrams through natural language by rendering PlantUML code into PNG or SVG images. Supports sequence diagrams, class diagrams, use case diagrams, and other UML chart types with Base64-encoded output.
    7
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables the dynamic generation of various software development diagrams, such as flowcharts, sequence diagrams, and architecture diagrams, using Mermaid syntax. It includes tools for diagram validation and provides instructions for exporting results to multiple formats including SVG and PNG.
    -
  • A
    license
    A
    quality
    D
    maintenance
    Converts Markdown files into professional diagrams such as flowcharts, mind maps, and architecture diagrams using Mermaid.js and custom SVG renderers. It enables users to list, render, and export visualizations in multiple formats including SVG, PNG, and PDF.
    3
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pickstar-2002/mermaid-chart-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server