mermaid-mcp

📁 zekiwest/mermaid-mcp-skill 📅 1 day ago
2
总安装量
2
周安装量
#68281
全站排名
安装命令
npx skills add https://github.com/zekiwest/mermaid-mcp-skill --skill mermaid-mcp

Agent 安装分布

amp 2
github-copilot 2
codex 2
kimi-cli 2
gemini-cli 2
cursor 2

Skill 文档

Mermaid MCP Skill

This skill provides the ability to generate Mermaid diagrams using the Mermaid MCP server.

What This Skill Does

  • Generates swimlane diagrams for business processes
  • Creates flowcharts for workflows
  • Produces sequence diagrams for API interactions
  • Supports 22+ diagram types

When to Invoke

Invoke this skill when:

  • User asks to create a diagram
  • User mentions “swimlane diagram” or “泳道图”
  • User wants to visualize a process or workflow
  • User needs flowcharts, sequence diagrams, or other Mermaid diagrams

Installation

Prerequisites

  • Node.js 18+
  • npm or yarn

Install Mermaid MCP Server

npm install -g @narasimhaponnada/mermaid-mcp-server

Configure MCP Settings

Add the following to your MCP settings file:

macOS/Linux: ~/.trae/mcp.json

{
  "mcpServers": {
    "mermaid": {
      "command": "node",
      "args": ["/path/to/mermaid-mcp-server/dist/index.js"],
      "env": {}
    }
  }
}

Replace /path/to/ with the actual installation path. To find the path:

npm root -g

The full path would be: {npm-root}/@narasimhaponnada/mermaid-mcp-server/dist/index.js

Available MCP Tools

Tool Description
generateDiagram Generate and render diagrams to SVG files
validateDiagram Validate syntax with detailed error reporting
getDiagramInfo Analyze diagram complexity and metadata
listSupportedTypes List all 22+ supported diagram types
convertDiagram Convert diagrams to different formats
listTemplates Browse 50+ pre-built templates
getTemplate Get specific template code
searchTemplates Search templates by keyword

Usage Examples

Generate a Swimlane Diagram

请生成一个用户购物流程的泳道图

Generate a Flowchart

请创建一个登录流程图

Generate a Sequence Diagram

请生成一个API调用序列图

Supported Diagram Types

  • Flowcharts
  • Sequence diagrams
  • Class diagrams
  • State diagrams
  • ER diagrams
  • Gantt charts
  • Git graphs
  • Mindmaps
  • Timelines
  • And 13+ more types!

Troubleshooting

MCP Server Not Found

If the MCP server is not found, verify:

  1. Node.js is installed (v18+)
  2. The package is installed globally
  3. The path in mcp.json is correct

Diagram Generation Fails

  1. Check the Mermaid syntax
  2. Use validateDiagram tool to identify errors
  3. Refer to Mermaid documentation