- Home
- MCP servers
- Mermaid
Mermaid
- python
7
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You can run Mermaid MCP Server to transform Mermaid chart code into high-quality images in multiple formats. By exposing both a standard local process and a network-based endpoint, it lets AI clients request chart rendering efficiently and consistently, enabling seamless integration with MCP-compatible tools and workflows.
How to use
You access the server from your MCP client either through a local STDIO workflow or via a Server-Sent Events (SSE) HTTP endpoint. In STDIO mode, your client starts the server as a local process and communicates through standard input and output. In SSE mode, your client connects to the HTTP SSE endpoint to receive streaming image data as charts are rendered.
How to install
Prerequisites: you need Python 3.12 or newer and a compatible package manager. The server supports installation through a fast package manager and a traditional Python dependency installation.
# Clone the repository
git clone https://github.com/wwwzhouhui/mermaid_mcp_server.git
cd mermaid_mcp_server
# Install dependencies using the recommended package manager
uv sync
# Alternative: install Python dependencies directly
pip install -r requirements.txt
Configuration and runtime initiation
The server can be started in STDIO mode or SSE mode. Use the STDIO mode for local desktop clients and SSE mode for network connections.
# Start STDIO mode (local desktop client)
uv run python main.py
# Start SSE mode (network connection)
uv run python main.py --sse
Configuration details you may need
Environment variables control server behavior, including host, port, and integration with the Mermaid rendering service.
HOST=0.0.0.0
PORT=8003
LOG_LEVEL=INFO
MERMAID_API_BASE_URL=https://mermaid.ink
REQUEST_TIMEOUT=30
DEBUG=false
DEVELOPMENT_MODE=false
Example MCP server configurations
The following examples show how to expose the server as both a local STDIO process and an HTTP SSE endpoint. Use the exact commands and URLs when wiring your MCP clients.
{
"mcpServers": {
"mermaid-mcp-server-png-pdf-jpg-svg": {
"type": "stdio",
"name": "mermaid_mcp_stdio",
"command": "uv",
"args": ["run", "python", "main.py"]
}
}
}
{
"mcpServers": {
"mermaid-mcp-server-png-pdf-jpg-svg": {
"type": "http",
"name": "mermaid_mcp_http",
"url": "http://127.0.0.1:8003/sse",
"args": []
}
}
}
Available tools
convert_mermaid_to_image
Converts Mermaid chart code into images in PNG, JPG, SVG, or PDF with options for format, theme, and size.
validate_mermaid_syntax
Checks Mermaid chart code for syntax validity and errors.
get_supported_options
Returns the supported themes and output formats for the converter.