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

mermaid-diagram-generator

v0.2.3

Published

Genera imagen del diagrama Mermaid y expone un MCP daemon compatible con VSCode e IntelliJ

Readme

mermaid-diagram-generator (MCP adapter)

Servidor MCP compatible que genera imágenes SVG a partir de diagramas Mermaid (.mmd). Ideal para integración con Copilot, VSCode y herramientas JetBrains.

Versión: 0.2.0 | Licencia: MIT | Autor: jdug | Repositorio: GitHub

Instalación local / Desarrollo

Desde el repositorio:

npm install
npm start
# Servidor MCP disponible en http://localhost:3456

API endpoints

  • GET /.well-known/mcp — Manifiesto MCP con información del servidor y endpoints disponibles
  • POST /generate — Genera diagrama SVG desde Mermaid. Acepta:
    • Texto plano Mermaid (text/plain)
    • JSON: { "source": "...", "filename": "..." } (filename opcional)
  • GET /diagram — Devuelve el SVG generado (image/svg+xml)
    • Parámetro query: ?name= para especificar archivo SVG
  • GET /health — Healthcheck del servidor

Parámetros POST /generate

  • source (obligatorio) — Código Mermaid en string
  • mmd (alternativa) — Código Mermaid en string
  • prompt (opcional) — Descripción adicional del diagrama
  • filename (opcional) — Nombre personalizado para el SVG (sin extensión)

Ejemplos de uso

Con curl - Generar desde Mermaid

curl -X POST http://localhost:3456/generate \
  -H "Content-Type: application/json" \
  -d ''{"source":"graph TD; A-->B;","filename":"diagrama-login"}''

Con curl - Descargar SVG

curl http://localhost:3456/diagram -o diagrama.svg

Desde archivo .mmd

curl -X POST http://localhost:3456/generate --data-binary @mi-diagrama.mmd

Distribución

Publicar en npm

npm login
npm publish --access public

El paquete estará disponible como mermaid-diagram-generator en npm.

Instalar globalmente

npm install -g mermaid-diagram-generator
mermaid-mcp  # Inicia el servidor

Integración con entornos

VSCode / Copilot

  1. Navega a %APPDATA%\Code\User\mcp.json (Windows) o ~/.config/Code/User/mcp.json (Linux/Mac)
  2. Añade la configuración:
{
  "servers": {
    "mermaid-mcp": {
      "url": "http://localhost:3456",
      "type": "http"
    }
  }
}

IntelliJ / JetBrains

Usa el mismo archivo mcp.json si el plugin lo soporta, o configura la URL a través de la UI del plugin.

Flujo de operación

  1. Copilot/Studio descubre el servidor accediendo a GET /.well-known/mcp
  2. El usuario solicita "genera un diagrama de flujo"
  3. Copilot genera el código Mermaid y envía POST /generate con { "source": "..." }
  4. El servidor genera el SVG y lo guarda en el workspace
  5. El cliente descarga el SVG desde GET /diagram o especifica el nombre con ?name=diagrama-login

Cambios recientes (v0.2.0)

  • ✨ Soporte para JSON payload con source, mmd, prompt
  • ✨ Parámetro filename para personalizar nombres de SVG
  • ✨ Endpoint /.well-known/mcp con manifiesto MCP
  • ✨ Query parameter ?name= en GET /diagram
  • ✨ Binary mermaid-mcp registrado en npm
  • 🔧 Refactor de scripts/generate-diagram.js
  • ✅ Mejor manejo de errores

Scripts disponibles

npm start                 # Inicia el servidor MCP
npm run generate-diagram  # Genera un diagrama desde CLI
npm run serve-diagram     # Sirve diagrama en HTTP
npm publish              # Publica en npm (requiere npm login)

Requisitos

  • Node.js >= 14
  • npm

Licencia

MIT