
Mermaid Chart MCP
Enables AI assistants to generate and render Mermaid diagrams (flowcharts, sequence diagrams, etc.) as PNG/SVG images with local file saving and HTTP access URLs. Supports batch processing and intelligent caching for efficient diagram creation.
README
🎨 Mermaid Chart MCP
🚀 A powerful Mermaid chart rendering tool based on MCP (Model Context Protocol) for AI editors
✨ Features
- 🎯 MCP Protocol Support - Seamlessly integrates with AI editors like Cursor, Claude Desktop, WindSurf
- 🎨 Multiple Formats - Export charts as PNG or SVG
- 🌈 Rich Themes - Support for default, dark, forest, and more themes
- 📏 Customizable - Adjust dimensions, background colors, and styling
- ⚡ Batch Processing - Render multiple charts simultaneously
- 🔗 Online Links - Automatically generate shareable online URLs
- 💾 Local Storage - Save charts to your local filesystem
- 📦 Zero Config - Works out of the box, no additional setup required
🚀 Quick Start
Installation
Install the package globally or use it directly with npx:
# Recommended: Use latest version with npx
npx @pickstar-2002/mermaid-chart-mcp@latest
# Or install globally
npm install -g @pickstar-2002/mermaid-chart-mcp@latest
Configuration in AI Editors
Cursor IDE
Add to your settings.json
:
{
"mcp.servers": {
"mermaid-chart": {
"command": "npx",
"args": ["@pickstar-2002/mermaid-chart-mcp@latest"]
}
}
}
Claude Desktop
Add to your claude_desktop_config.json
:
{
"mcpServers": {
"mermaid-chart": {
"command": "npx",
"args": ["@pickstar-2002/mermaid-chart-mcp@latest"]
}
}
}
WindSurf
Add to your MCP configuration:
{
"mcp": {
"servers": {
"mermaid-chart": {
"command": "npx",
"args": ["@pickstar-2002/mermaid-chart-mcp@latest"]
}
}
}
}
📖 Usage
Once configured, you can use the following tools in your AI editor:
🎯 renderMermaid
Render a Mermaid chart and get an online URL:
// Example usage in AI chat
"Please render this flowchart:
graph TD
A[Start] --> B{Decision}
B -->|Yes| C[Action 1]
B -->|No| D[Action 2]
"
💾 saveMermaid
Render and save a chart to your local filesystem:
// The AI will save the chart locally and provide both local path and online URL
"Save this sequence diagram to ./diagrams/ folder:
sequenceDiagram
participant A as Alice
participant B as Bob
A->>B: Hello Bob!
B-->>A: Hello Alice!
"
⚡ batchRenderMermaid
Process multiple charts at once:
// Render multiple charts simultaneously
"Create these three charts:
1. A flowchart showing the login process
2. A sequence diagram for API calls
3. A class diagram for the user model
"
🛠️ API Reference
renderMermaid
Parameter | Type | Required | Description |
---|---|---|---|
mermaidCode |
string | ✅ | Mermaid diagram code |
format |
'png' | 'svg' | ❌ | Output format (default: 'png') |
theme |
string | ❌ | Theme name (default, dark, forest, etc.) |
backgroundColor |
string | ❌ | Background color |
width |
number | ❌ | Image width in pixels |
height |
number | ❌ | Image height in pixels |
saveMermaid
Parameter | Type | Required | Description |
---|---|---|---|
mermaidCode |
string | ✅ | Mermaid diagram code |
localPath |
string | ✅ | Local directory path |
filename |
string | ❌ | Custom filename |
format |
'png' | 'svg' | ❌ | Output format (default: 'png') |
createDir |
boolean | ❌ | Create directory if not exists (default: true) |
theme |
string | ❌ | Theme name |
backgroundColor |
string | ❌ | Background color |
width |
number | ❌ | Image width in pixels |
height |
number | ❌ | Image height in pixels |
batchRenderMermaid
Parameter | Type | Required | Description |
---|---|---|---|
items |
Array | ✅ | Array of chart configurations |
theme |
string | ❌ | Global theme setting |
backgroundColor |
string | ❌ | Global background color |
🎨 Supported Themes
default
- Clean and professionaldark
- Dark mode friendlyforest
- Green nature themebase
- Minimal stylingneutral
- Balanced colors
📋 Supported Chart Types
- 📊 Flowcharts - Process flows and decision trees
- 🔄 Sequence Diagrams - Interaction timelines
- 📈 Gantt Charts - Project timelines
- 🏗️ Class Diagrams - Object-oriented structures
- 🌐 State Diagrams - State machines
- 📋 Entity Relationship - Database schemas
- 🧭 User Journey - User experience flows
- 🥧 Pie Charts - Data visualization
- 📊 Bar Charts - Comparative data
- 🌳 Git Graphs - Version control flows
🔧 Requirements
- Node.js >= 18.0.0
- AI Editor with MCP support (Cursor, Claude Desktop, WindSurf, etc.)
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
📞 Contact
微信: pickstar_loveXX
<div align="center"> Made with ❤️ by <a href="https://github.com/pickstar-2002">pickstar-2002</a> </div>
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.