npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ai-diagrams-mcp

v1.2.1

Published

MCP server for rendering Mermaid diagrams with interactive zoom/pan viewer

Readme

ai-diagrams-mcp

An MCP (Model Context Protocol) server that renders Mermaid diagrams to an interactive HTML viewer with zoom/pan capabilities. Zero configuration required.

Features

  • Interactive Viewer - Pan and zoom diagrams with pinch gestures or buttons
  • Multiple Diagrams - Render multiple diagrams in a single view
  • Mermaid Themes - Support for default, dark, forest, and neutral themes
  • Light/Dark Mode - Automatic system preference detection with manual toggle
  • Shareable Links - Upload diagrams and get public HTTPS links (no account required)
  • Cross-Platform - Works on macOS, Linux, and Windows

Quick Start

npx -y ai-diagrams-mcp@latest

Or install globally:

npm install -g ai-diagrams-mcp

Configuration by AI Tool

~/.claude.json or project .mcp.json

{
  "mcpServers": {
    "ai-diagrams": {
      "command": "npx",
      "args": ["-y", "ai-diagrams-mcp@latest"]
    }
  }
}

Or via CLI: claude mcp add ai-diagrams -- npx -y ai-diagrams-mcp@latest

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "ai-diagrams": {
      "command": "npx",
      "args": ["-y", "ai-diagrams-mcp@latest"]
    }
  }
}

~/.cursor/mcp.json or Settings → Features → MCP

{
  "mcpServers": {
    "ai-diagrams": {
      "command": "npx",
      "args": ["-y", "ai-diagrams-mcp@latest"]
    }
  }
}

.vscode/mcp.json in workspace or via Command Palette: MCP: Add Server

{
  "servers": {
    "ai-diagrams": {
      "command": "npx",
      "args": ["-y", "ai-diagrams-mcp@latest"]
    }
  }
}

Click MCP Servers icon → Configure → Edit MCP Settings

{
  "mcpServers": {
    "ai-diagrams": {
      "command": "npx",
      "args": ["-y", "ai-diagrams-mcp@latest"]
    }
  }
}

~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "ai-diagrams": {
      "command": "npx",
      "args": ["-y", "ai-diagrams-mcp@latest"]
    }
  }
}

Settings → Open Settings (JSON)

{
  "context_servers": {
    "ai-diagrams": {
      "command": {
        "path": "npx",
        "args": ["-y", "ai-diagrams-mcp@latest"]
      }
    }
  }
}

~/.codex/config.toml

[mcp_servers.ai-diagrams]
command = "npx"
args = ["-y", "ai-diagrams-mcp@latest"]

Or via CLI: codex mcp add ai-diagrams -- npx -y ai-diagrams-mcp@latest

Settings → Tools → MCP Server

{
  "mcpServers": {
    "ai-diagrams": {
      "command": "npx",
      "args": ["-y", "ai-diagrams-mcp@latest"]
    }
  }
}

Usage

Once configured, ask your AI assistant to render diagrams:

"Create a flowchart showing the user authentication process"

"Draw a sequence diagram for the API request flow"

"Generate an ER diagram for a blog database"

The render_diagram tool accepts:

  • diagrams - Array of { title?: string, code: string } objects
  • theme - Optional: 'default' | 'dark' | 'forest' | 'neutral'
  • share - Optional: true to upload and get a public shareable link
  • shareExpiry - Optional: '1h' | '12h' | '24h' | '72h' (default: '1h')

Example

// Tool call - local only
{
  "diagrams": [
    {
      "title": "Authentication Flow",
      "code": "graph TD\n  A[User] -->|Login| B[Auth Server]\n  B -->|Token| A"
    }
  ],
  "theme": "dark"
}

// Tool call - with shareable link
{
  "diagrams": [
    {
      "title": "Authentication Flow",
      "code": "graph TD\n  A[User] -->|Login| B[Auth Server]\n  B -->|Token| A"
    }
  ],
  "share": true
}

Supported Diagram Types

Mermaid supports many diagram types including:

  • Flowcharts
  • Sequence Diagrams
  • Class Diagrams
  • State Diagrams
  • Entity Relationship Diagrams
  • Gantt Charts
  • Pie Charts
  • Mind Maps
  • Timeline
  • Git Graphs
  • Quadrant Charts

See Mermaid documentation for full syntax reference.

Viewer Features

  • Zoom Controls - Use +/- buttons or pinch gesture on trackpad
  • Pan - Click and drag to move around
  • Reset - Return to original view
  • Theme Toggle - Switch between light, dark, and system modes

Sharing

Generate temporary public links to share diagrams with colleagues:

{
  "diagrams": [...],
  "share": true,
  "shareExpiry": "24h"  // Options: 1h, 12h, 24h, 72h
}
  • No account required
  • Full interactive viewer with zoom/pan
  • Links expire automatically (default: 1h)

Output Files

Each render creates two files in the temp directory:

  • mermaid-viewer-{uuid}.html - Interactive viewer (opened in browser)
  • mermaid-source-{uuid}.json - Diagram source for reference/iteration

The source file makes it easy to adjust and re-render diagrams.

Development

# Install dependencies
npm install
cd viewer && npm install && cd ..

# Build everything
npm run build

# Run tests
npm test

# Start the server
npm start

Tech Stack

  • Runtime: Node.js 22+
  • Frontend: Vue 3 + Tailwind CSS 4 + Vite
  • Diagrams: Mermaid.js v11 (via CDN)
  • Zoom/Pan: @panzoom/panzoom
  • MCP SDK: @modelcontextprotocol/sdk

Resources

License

MIT


Made by LaserFocused OÜ