Get the FREE Ultimate OpenClaw Setup Guide →

mermaid

MCP server from Narasimhaponnada/mermaid-mcp

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio narasimhaponnada-mermaid-mcp mermaid-mcp

How to use

The Mermaid MCP Server provides an MCP interface for AI tools to generate Mermaid diagrams from natural language. It exposes a ready-to-use endpoint that integrates with AI assistants like GitHub Copilot, Claude Desktop, Cursor IDE, and custom applications to produce production-ready SVG diagrams (flowcharts, sequence diagrams, ERDs, state machines, Gantt charts, and more) using over 22 diagram types and 50+ pre-built templates. The server runs under MCP so that clients can send context-rich requests and receive high-quality Mermaid diagrams that are XML-valid and ready for documentation, presentations, or embedding in apps.

To use it with Copilot, install the server (globally or from source) and configure Copilot's MCP servers mapping. If installed globally, set the server command to mermaid-mcp; if building from source, point Copilot to the built dist/index.js via Node. After configuration, you can prompt Copilot with natural language requests like “generate a microservices architecture diagram” or “show a CI/CD pipeline” and the server will render Mermaid-compatible SVGs through the MCP workflow. The setup supports direct CLI usage for automation and can be extended to custom applications via the MCP SDK.

How to install

Prerequisites:

  • Node.js 18+ installed on your system
  • npm (or yarn) for package management
  • Git for cloning the repository (if installing from source)

Option 1: Install from NPM (Recommended)

# Global installation - easiest way to get started
npm install -g @narasimhaponnada/mermaid-mcp-server

# Verify installation
mermaid-mcp --version

Option 2: Install from Source

# Clone the repository
git clone https://github.com/Narasimhonnada/mermaid-mcp.git
cd mermaid-mcp/mermaid-mcp-server

# Install dependencies
npm install

# Build the server
npm run build

# Optional: generate sample diagrams
node generate-svg-samples.js

Configure for Copilot:

  • If installed globally, use command: mermaid-mcp
  • If installed from source, point Copilot to the built entry:
    • command: node
    • args: ["/absolute/path/to/mermaid-mcp-server/dist/index.js"]

Additional notes

Tips and considerations:

  • Ensure Node.js 18+ is active to match the server’s requirements.
  • The server outputs production-ready SVGs that are XML-compliant and suitable for docs and presentations.
  • When using Copilot or Claude, add the MCP server under the github.copilot.mcp.servers mapping in VS Code settings. If you installed from source, provide the absolute path to dist/index.js.
  • The MCP server supports 6 integration methods (Copilot in VS Code, Claude Desktop, Cursor IDE, Direct CLI, MCP Inspector, and custom apps).
  • If you encounter path or permission issues, verify you’re running the correct Node binary and that the dist/index.js file exists after building.
  • For automation, you can script requests via the MCP SDK or CLI after configuring the server in your environment.

Related MCP Servers

Sponsor this space

Reach thousands of developers