SuperAPI AI Directory

mermaid-mcp

Mermaid diagram generation (flowcharts, sequence, class, ER, architecture and state diagrams) with templates, layout engines and SVG/PNG/PDF export.

Open website

About this tool

Purpose

mermaid-mcp is a Mermaid MCP server that provides Mermaid diagram generation capabilities to AI assistants through the Model Context Protocol (MCP). It enables GitHub Copilot, Claude, and custom LLM applications to create professional diagrams such as architecture diagrams, flowcharts, and sequence diagrams using natural language.

Key Capabilities

  • AI-driven generation: Use GitHub Copilot or Claude to create diagrams through natural language.
  • Production-grade SVG: Output XML-compliant, validated SVG files that can be used directly in various scenarios.
  • 50+ preset templates: Covering architecture patterns, workflows, and data models.
  • Multiple integration methods: Supports VS Code, Claude Desktop, Cursor IDE, CLI, and custom applications.
  • 22+ diagram types: Flowcharts, sequence diagrams, ERDs, state machines, Gantt charts, and more.
  • Fast and reliable: Puppeteer-based browser rendering ensures consistent output.

Supported Diagram Types

  • Process diagrams: Flowcharts, block diagrams
  • Interaction diagrams: Sequence diagrams, user journeys, timelines
  • Structure diagrams: Class diagrams, ER diagrams, C4 diagrams, architecture diagrams
  • Data visualization: Pie charts, XY charts, Sankey diagrams, radar charts, quadrant charts, treemaps
  • Project management: Gantt charts, requirement diagrams, Kanban
  • Specialized diagrams: State diagrams, Git Flow, mind maps, packet diagrams

Usage

Environment Requirements

  • Node.js 18 or later
  • GitHub Copilot (recommended) or Claude Desktop

Configuration with GitHub Copilot

Add the configuration in VS Code settings (Cmd+Shift+P → "Preferences: Open User Settings (JSON)"). The configuration method differs depending on whether it is installed globally via NPM or from source.

Usage with Copilot

Open GitHub Copilot Chat to try generating diagrams.

Integration Methods

  • GitHub Copilot in VS Code: Daily development workflow
  • Claude Desktop: Standalone diagram generation
  • Cursor IDE: AI-first development
  • Direct CLI: Automation and scripting
  • MCP Inspector: Testing and debugging
  • Custom applications: Build your own integration

Use Cases

  • Documentation: Automatically generate architecture diagrams
  • Code review: Include diagrams in pull requests
  • Onboarding: Provide visual guides for new developers
  • Technical proposals: Explain changes visually
  • Incident response: Document incidents with timelines
  • Customer demos: Explain technical concepts visually
  • Training materials: Create consistent learning resources

Example Output

The production-grade SVG files generated by the server (located in examples/architectures/):

  • microservices-architecture.svg (27KB) - Microservices with API Gateway
  • cloud-infrastructure.svg (31KB) - Cloud infrastructure components
  • cicd-pipeline.svg (28KB) - Complete CI/CD workflow
  • data-pipeline.svg (24KB) - ETL data processing pipeline
  • serverless-architecture.svg (31KB) - Event-driven serverless

All SVGs are XML-validated and render perfectly in browsers, documents, and presentations.

Tech Stack

  • Node.js: Server runtime
  • TypeScript: Type-safe development
  • Puppeteer: Browser rendering
  • Mermaid v10: Diagram library (via CDN)
  • MCP SDK: Model Context Protocol implementation

Project Status

  • Production-ready: All core features are implemented and tested
  • Validated: All SVG output complies with the XML specification
  • Well-documented: Comprehensive guides and examples
  • Clean code: 43 core files, no redundancy
  • Battle-tested: Fixed HTML-to-XML tag issues, subgraph syntax, and more

Limitations

The materials do not provide specific information such as fees or pricing. Usage requires a Node.js 18+ environment and GitHub Copilot (recommended) or Claude Desktop.