Skip to content
Back to search

mcp-mermaid

❤️ Generate mermaid diagram and chart with AI MCP dynamically.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/hustcc--mcp-mermaid/badge.svg)](/listings/hustcc--mcp-mermaid)

HTML

<a href="/listings/hustcc--mcp-mermaid"><img src="/api/listings/hustcc--mcp-mermaid/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 189 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # <img src="https://mermaid.js.org/favicon.svg" height="24"/> MCP Mermaid ![](https://badge.mcpx.dev?type=server 'MCP Server') [![build](https://github.com/hustcc/mcp-mermaid/actions/workflows/build.yml/badge.svg)](https://github.com/hustcc/mcp-mermaid/actions/workflows/build.yml) [![npm Version](https://img.shields.io/npm/v/mcp-mermaid.svg)](https://www.npmjs.com/package/mcp-mermaid) [![smithery badge](https://smithery.ai/badge/@hustcc/mcp-mermaid)](https://smithery.ai/server/@hustcc/mcp-mermaid) [![npm License](https://img.shields.io/npm/l/mcp-mermaid.svg)](https://www.npmjs.com/package/mcp-mermaid) [![Trust Score](https://archestra.ai/mcp-catalog/api/badge/quality/hustcc/mcp-mermaid)](https://archestra.ai/mcp-catalog/hustcc__mcp-mermaid)
  2. Generate <img src="https://mermaid.js.org/favicon.svg" height="14"/> [mermaid](https://mermaid.js.org/) diagram and chart with AI MCP dynamically. Also you can use:
  3. - <img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*ZFK8SrovcqgAAAAAAAAAAAAAemJ7AQ/original" height="14"/> [mcp-server-chart](https://github.com/antvis/mcp-server-chart) to generate chart, graph, map.
  4. - <img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*EdkXSojOxqsAAAAAQHAAAAgAemJ7AQ/original" height="14"/> [Infographic](https://github.com/antvis/Infographic) to generate infographic, such as `Timeline`, `Comparison`, `List`, `Process` and so on.
  5. - 🖼️ [figure.ling.pub/gallery](https://figure.ling.pub/gallery) to browse and share AI-generated diagrams and figures created with mcp-mermaid and other tools.
  6. ## ✨ Features
  7. - Fully support all features and syntax of `Mermaid`.
  8. - Support configuration of `backgroundColor` and `theme`, enabling large AI models to output rich style configurations.
  9. - Support exporting to `base64`, `svg`, `mermaid`, `file`, and remote-friendly `svg_url`, `png_url` formats, with validation for `Mermaid` to facilitate the model's multi-round output of correct syntax and graphics. Use `outputType: "file"` to automatically save PNG diagrams to disk for AI agents, or the URL modes to share diagrams through public mermaid.ink links.
  10. <img width="720" alt="mcp-mermaid" src="https://mermaid.js.org/header.png" />
  11. ## 🤖 Usage
  12. To use with `Desktop APP`, such as Claude, VSCode, Cline, Cherry Studio, and so on, add the MCP server config below. On Mac system:
  13. ```json
  14. {
  15. "mcpServers": {
  16. "mcp-mermaid": {
  17. "command": "npx",
  18. "args": [
  19. "-y",
  20. "mcp-mermaid"
  21. ]
  22. }
  23. }
  24. }
  25. ```
  26. On Window system:
  27. ```json
  28. {
  29. "mcpServers": {
  30. "mcp-mermaid": {
  31. "command": "cmd",
  32. "args": [
  33. "/c",
  34. "npx",
  35. "-y",
  36. "mcp-mermaid"
  37. ]
  38. }
  39. }
  40. }
  41. ```
  42. Also, you can use it on aliyun, modelscope, glama.ai, smithery.ai or others with HTTP, SSE Protocol.
  43. **Access Points:**
  44. - SSE: `http://localhost:3033/sse`
  45. - Streamable: `http://localhost:1122/mcp`
  46. **Available Docker Tags:**
  47. - `susuperli/mcp-mermaid:latest` - Latest stable version
  48. - View all available tags at [Docker Hub](https://hub.docker.com/repository/docker/susuperli/mcp-mermaid/tags)
  49. ## 🚰 Run with SSE or Streamable transport
  50. ### Option 1: Global Installation
  51. Install the package globally:
  52. ```bash
  53. npm install -g mcp-mermaid
  54. ```
  55. Run the server with your preferred transport option:
  56. ```bash
  57. # For SSE transport (default endpoint: /sse)
  58. mcp-mermaid -t sse
  59. # For Streamable transport with custom endpoint
  60. mcp-mermaid -t streamable
  61. ```
  62. ### Option 2: Local Development
  63. If you're working with the source code locally:
  64. ```bash
  65. # Clone and setup
  66. git clone https://github.com/hustcc/mcp-mermaid.git
  67. cd mcp-mermaid
  68. npm install
  69. npm run build
  70. # Run with npm scripts
  71. npm run start:sse # SSE transport on port 3033
  72. npm run start:streamable # Streamable transport on port 1122
  73. ```
  74. ### Access Points
  75. Then you can access the server at:
  76. - SSE transport: `http://localhost:3033/sse`
  77. - Streamable transport: `http://localhost:1122/mcp` (local) or `http://localhost:3033/mcp` (global)
  78. ## 🎮 CLI Options
  79. You can also use the following CLI options when running the MCP server. Command options by run cli with `-h`.
  80. ```plain
  81. MCP Mermaid CLI
  82. Options:
  83. --transport, -t Specify the transport protocol: "stdio", "sse", or "streamable" (default: "stdio")
  84. --port, -p Specify the port for SSE or streamable transport (default: 3033)
  85. --endpoint, -e Specify the endpoint for the transport:
  86. - For SSE: default is "/sse"
  87. - For streamable: default is "/mcp"
  88. --help, -h Show this help message
  89. ```
  90. ## 🔨 Development
  91. Install dependencies:
  92. ```bash
  93. npm install
  94. ```
  95. Build the server:
  96. ```bash
  97. npm run build
  98. ```
  99. ### Start the MCP server
  100. **Using MCP Inspector (for debugging):**
  101. ```bash
  102. npm run start
  103. ```
  104. **Using different transport protocols:**
  105. ```bash
  106. # SSE transport (Server-Sent Events)
  107. npm run start:sse
  108. # Streamable HTTP transport
  109. npm run start:streamable
  110. ```
  111. **Direct node commands:**
  112. ```bash
  113. # SSE transport on port 3033
  114. node build/index.js --transport sse --port 3033
  115. # Streamable HTTP transport on port 1122
  116. node build/index.js --transport streamable --port 1122
  117. # STDIO transport (for MCP client integration)
  118. node build/index.js --transport stdio
  119. ```
  120. ## 🐳 Docker Usage
  121. Run MCP Mermaid with Docker:
  122. ```bash
  123. # Pull the image
  124. docker pull susuperli/mcp-mermaid:latest
  125. # Run with SSE transport (default)
  126. docker run -p 3033:3033 susuperli/mcp-mermaid:latest --transport sse
  127. # Run with streamable transport
  128. docker run -p 1122:1122 susuperli/mcp-mermaid:latest --transport streamable --port 1122
  129. ```
  130. ## 📄 License
  131. MIT@[hustcc](https://github.com/hustcc).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.