byrness/mermaker
If you are the rightful owner of mermaker and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
Mermaker is an MCP server designed to generate and render Mermaid diagrams using AI.
Mermaker MCP Server
A Model Context Protocol (MCP) server for generating and rendering Mermaid diagrams using AI.
Overview
Mermaker is an MCP server that provides tools to generate Mermaid diagram markdown from natural language prompts and render them as SVG images. It leverages AI to intelligently create well-structured diagrams based on your descriptions.
Features
- AI-Powered Diagram Generation: Generate Mermaid diagrams from natural language descriptions
- Multiple Diagram Types: Supports flowcharts, sequence diagrams, class diagrams, state diagrams, ER diagrams, Gantt charts, pie charts, and more
- Automatic Rendering: Converts Mermaid markdown to SVG images using the Mermaid Ink service
- Best Practices Built-in: Follows Mermaid syntax best practices and avoids common pitfalls
- Professional Theming: Includes monochromatic blue corporate theme
Installation
Requires Python 3.13 or higher.
# Clone the repository
git clone https://github.com/byrness/mermaker.git
cd mermaker
# Install dependencies with uv
uv sync
Usage
Running the MCP Server
uv run mermaker-server.py
Available Tools
1. generate_markdown
Generates Mermaid diagram markdown from a natural language prompt.
Parameters:
user_prompt(str): Description of the diagram you want to create
Example:
"Generate a sequence diagram showing OAuth 2.0 authorization code flow"
2. render
Renders Mermaid source code to an SVG image.
Parameters:
graph_source(str): The Mermaid diagram source code to render
Returns:
- SVG image saved to
./scratch/mermaid.svg - URL to view the rendered diagram
Configuration
Set the output directory using the WORKING_DIR environment variable:
export WORKING_DIR=/path/to/output
python mermaker-server.py
Default: ./scratch
Supported Diagram Types
- Flowcharts (
graph TD/LR): Process flows, decision trees, algorithms - Sequence Diagrams (
sequenceDiagram): API calls, interactions over time - Class Diagrams (
classDiagram): Object-oriented structures, data models - State Diagrams (
stateDiagram-v2): State machines, lifecycle flows - Entity Relationship (
erDiagram): Database schemas - Gantt Charts (
gantt): Project timelines, schedules - Pie Charts (
pie): Proportions, distributions - Git Graphs (
gitGraph): Repository branching strategies - User Journey (
journey): User experience flows - Mindmaps (
mindmap): Hierarchical concepts
Professional Theme
Mermaker includes a built-in monochromatic blues theme suitable for corporate and financial services:
- Dark Blue (#023E8A): Primary elements
- Ocean Blue (#0077B6): Secondary elements, borders
- Soft Cyan (#90E0EF): Highlights, accents
- Pale Blue (#CAF0F8): Light backgrounds
- Light Grey (#E8E8E8): Cluster backgrounds
Examples
Architecture Diagram
graph LR
client[MCP Client]
subgraph cluster["Red Hat OpenShift Cluster"]
subgraph container["Docker Container"]
mcp[FAST MCP Server]
end
subgraph database["Database"]
db[(PostgreSQL Database)]
end
end
oauth[OAuth 2.1 Authorization Server]
client -->|Request with ID| mcp
mcp -->|Validate token| oauth
oauth -->|Token valid| mcp
mcp -->|Query by ID| db
db -->|Return value| mcp
mcp -->|Response| client
OAuth Flow
sequenceDiagram
participant User
participant Client as Client Application
participant AuthServer as Authorization Server
participant ResourceServer as Resource Server
User->>Client: Access protected resource
Client->>AuthServer: Authorization request
AuthServer->>User: Login & consent prompt
User->>AuthServer: Credentials & approval
AuthServer->>Client: Authorization code
Client->>AuthServer: Token request
AuthServer->>Client: Access token
Client->>ResourceServer: API request
ResourceServer->>Client: Protected data
Client->>User: Display resource
Dependencies
Development
Built with FastMCP, a framework for creating Model Context Protocol servers.
License
TBD
Contributing
Contributions welcome! Please feel free to submit a Pull Request.