I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

sirène-MCP-serveur
Un serveur de protocole de contexte de modèle (MCP) qui convertit les diagrammes de sirène en images PNG
3 years
Works with Finder
1
Github Watches
5
Github Forks
34
Github Stars
Mermaid MCP Server
A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images. This server allows AI assistants and other applications to generate visual diagrams from textual descriptions using the Mermaid markdown syntax.
Features
- Converts Mermaid diagram code to PNG images
- Supports multiple diagram themes (default, forest, dark, neutral)
- Customizable background colors
- Uses Puppeteer for high-quality headless browser rendering
- Implements the MCP protocol for seamless integration with AI assistants
- Flexible output options: return images directly or save to disk
- Error handling with detailed error messages
How It Works
The server uses Puppeteer to launch a headless browser, render the Mermaid diagram to SVG, and capture a screenshot of the rendered diagram. The process involves:
- Launching a headless browser instance
- Creating an HTML template with the Mermaid code
- Loading the Mermaid.js library
- Rendering the diagram to SVG
- Taking a screenshot of the rendered SVG as PNG
- Either returning the image directly or saving it to disk
Build
npx tsc
Usage
Use with Claude desktop
"mcpServers": {
"mermaid": {
"command": "npx",
"args": [
"-y @peng-shawn/mermaid-mcp-server"
]
}
}
Use with Cursor and Cline
env CONTENT_IMAGE_SUPPORTED=false npx -y @peng-shawn/mermaid-mcp-server
You can find a list of mermaid diagrams under ./diagrams
, they are created using Cursor agent with prompt: "generate mermaid diagrams and save them in a separate diagrams folder explaining how renderMermaidPng work"
Run with inspector
Run the server with inspector for testing and debugging:
npx @modelcontextprotocol/inspector node dist/index.js
The server will start and listen on stdio for MCP protocol messages.
Learn more about inspector here.
Installing via Smithery
To install Mermaid Diagram Generator for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @peng-shawn/mermaid-mcp-server --client claude
Docker and Smithery Environments
When running in Docker containers (including via Smithery), you may need to handle Chrome dependencies:
-
The server now attempts to use Puppeteer's bundled browser by default
-
If you encounter browser-related errors, you have two options:
Option 1: During Docker image build:
- Set
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
when installing Puppeteer - Install Chrome/Chromium in your Docker container
- Set
PUPPETEER_EXECUTABLE_PATH
at runtime to point to the Chrome installation
Option 2: Use Puppeteer's bundled Chrome:
- Ensure your Docker container has the necessary dependencies for Chrome
- No need to set
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD
- The code will use the bundled browser automatically
- Set
For Smithery users, the latest version should work without additional configuration.
API
The server exposes a single tool:
-
generate
: Converts Mermaid diagram code to a PNG image- Parameters:
-
code
: The Mermaid diagram code to render -
theme
: (optional) Theme for the diagram. Options: "default", "forest", "dark", "neutral" -
backgroundColor
: (optional) Background color for the diagram, e.g. 'white', 'transparent', '#F0F0F0' -
name
: Name for the generated file (required when CONTENT_IMAGE_SUPPORTED=false) -
folder
: Absolute path to save the image to (required when CONTENT_IMAGE_SUPPORTED=false)
-
- Parameters:
The behavior of the generate
tool depends on the CONTENT_IMAGE_SUPPORTED
environment variable:
- When
CONTENT_IMAGE_SUPPORTED=true
(default): The tool returns the image directly in the response - When
CONTENT_IMAGE_SUPPORTED=false
: The tool saves the image to the specified folder and returns the file path
Environment Variables
-
CONTENT_IMAGE_SUPPORTED
: Controls whether images are returned directly in the response or saved to disk-
true
(default): Images are returned directly in the response -
false
: Images are saved to disk, requiringname
andfolder
parameters
-
Examples
Basic Usage
// Generate a flowchart with default settings
{
"code": "flowchart TD\n A[Start] --> B{Is it?}\n B -->|Yes| C[OK]\n B -->|No| D[End]"
}
With Theme and Background Color
// Generate a sequence diagram with forest theme and light gray background
{
"code": "sequenceDiagram\n Alice->>John: Hello John, how are you?\n John-->>Alice: Great!",
"theme": "forest",
"backgroundColor": "#F0F0F0"
}
Saving to Disk (when CONTENT_IMAGE_SUPPORTED=false)
// Generate a class diagram and save it to disk
{
"code": "classDiagram\n Class01 <|-- AveryLongClass\n Class03 *-- Class04\n Class05 o-- Class06",
"theme": "dark",
"name": "class_diagram",
"folder": "/path/to/diagrams"
}
FAQ
Doesn't Claude desktop already support mermaid via canvas?
Yes, but it doesn't support the theme
and backgroundColor
options. Plus, having a dedicated server makes it easier to create mermaid diagrams with different MCP clients.
Why do I need to specify CONTENT_IMAGE_SUPPORTED=false when using with Cursor?
Cursor doesn't support inline images in responses yet.
Publishing
This project uses GitHub Actions to automate the publishing process to npm.
Method 1: Using the Release Script (Recommended)
- Make sure all your changes are committed and pushed
- Run the release script with either a specific version number or a semantic version increment:
# Using a specific version number npm run release 0.1.4 # Using semantic version increments npm run release patch # Increments the patch version (e.g., 0.1.3 → 0.1.4) npm run release minor # Increments the minor version (e.g., 0.1.3 → 0.2.0) npm run release major # Increments the major version (e.g., 0.1.3 → 1.0.0)
- The script will:
- Validate the version format or semantic increment
- Check if you're on the main branch
- Detect and warn about version mismatches between files
- Update all version references consistently (package.json, package-lock.json, and index.ts)
- Create a single commit with all version changes
- Create and push a git tag
- The GitHub workflow will then automatically build and publish to npm
Method 2: Manual Process
- Update your code and commit the changes
- Create and push a new tag with the version number:
git tag v0.1.4 # Use the appropriate version number git push origin v0.1.4
- The GitHub workflow will automatically:
- Build the project
- Publish to npm with the version from the tag
Note: You need to set up the NPM_TOKEN
secret in your GitHub repository settings. To do this:
- Generate an npm access token with publish permissions
- Go to your GitHub repository → Settings → Secrets and variables → Actions
- Create a new repository secret named
NPM_TOKEN
with your npm token as the value
Badges
License
MIT
相关推荐
Confidential guide on numerology and astrology, based of GG33 Public information
A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.
Therapist adept at identifying core issues and offering practical advice with images.
Oede knorrepot die vasthoudt an de goeie ouwe tied van 't boerenleven
A world class elite tech co-founder entrepreneur, expert in software development, entrepreneurship, marketing, coaching style leadership and aligned with ambition for excellence, global market penetration and worldy perspectives.
A medical specialist offering assistance grounded in clinical guidelines. Disclaimer: This is intended for research and is NOT safe for clinical use!
Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.
Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX
Une passerelle API unifiée pour intégrer plusieurs API d'explorateur de blockchain de type étherscan avec la prise en charge du protocole de contexte modèle (MCP) pour les assistants d'IA.
MCP Server pour récupérer le contenu de la page Web à l'aide du navigateur sans tête du dramwright.
Miroir dehttps: //github.com/suhail-ak-s/mcp-typeseense-server
Un bot de chat IA pour les petites et moyennes équipes, soutenant des modèles tels que Deepseek, Open AI, Claude et Gemini. 专为中小团队设计的 Ai 聊天应用 , 支持 Deepseek 、 Open Ai 、 Claude 、 Gemini 等模型。
Reviews

user_NMzrYdIu
As a dedicated user of mcp-calendar-server by GG3T, I am thoroughly impressed with its seamless integration and robust features. Scheduling and managing events has never been easier thanks to its intuitive interface. The server's reliability and performance are top-notch, making it an indispensable tool for efficient time management. Highly recommend checking it out at https://mcp.so/server/mcp-calendar-server/GG3T!