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

@neverprepared/mcp-phantom-diagrams

v1.0.0

Published

MCP server that converts diagram markup to images via a local Kroki instance

Readme

mcp-phantom-diagrams

An MCP server that converts diagram markup text into images using a locally-managed Kroki Docker stack. Supports 28+ diagram types (PlantUML, Mermaid, Graphviz, and more) with SVG, PNG, and JPEG output. Starts the Kroki containers automatically on first use — no manual Docker setup required.

Tools

| Tool | Description | |---|---| | convert_diagram | Render diagram markup to SVG, PNG, or JPEG | | list_diagram_types | List all supported diagram types and their available formats | | get_kroki_status | Check Kroki health, version, companion container status, and cache stats |

convert_diagram parameters

| Parameter | Type | Default | Description | |---|---|---|---| | diagram_type | string | — | Diagram language (e.g. plantuml, mermaid, graphviz) | | source | string | — | Diagram markup source text | | output_format | svg | png | jpeg | svg | Output format | | output_path | string | — | Write output to this path instead of returning inline content | | options | object | — | Diagram-type-specific options sent as Kroki-Diagram-Options-* headers | | query_options | object | — | Options passed as URL query parameters (e.g. { "theme": "dark" }) |

SVG is returned as a text block. PNG/JPEG are returned as base64 image blocks, or written to disk if output_path is set (recommended for large images to avoid token overhead).

Supported diagram types

Built-in (no companion container required): plantuml, graphviz, ditaa, svgbob, umlet, erd, nomnoml, structurizr, bytefield, c4plantuml, d2, dbml, pikchr, symbolator, vega, vegalite, wavedrom

Companion containers (started automatically): mermaid, bpmn, excalidraw, blockdiag, seqdiag, actdiag, nwdiag, packetdiag, rackdiag, diagramsnet

Requirements

  • Node.js 20+
  • Docker with Compose V2 (docker compose command)

Installation

npm install
npm run build

Claude Code configuration

Add to your ~/.claude/claude.json (or project-level .claude/claude.json):

{
  "mcpServers": {
    "phantom-diagrams": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-phantom-diagrams/dist/index.js"]
    }
  }
}

On first start, the server pulls and starts the Kroki Docker images automatically (shared across all Claude profiles via the kroki-shared compose project). Subsequent starts are instant if containers are already running.

Development

npm run dev          # watch mode — recompiles on change
npm run test:unit    # unit tests (no Docker required)
npm run test:integration  # round-trip tests (requires Docker)
SKIP_INTEGRATION=1 npm test  # unit tests only, e.g. in CI

Architecture

src/
  index.ts    — MCP server, tool registration, startup warm-up
  docker.ts   — container health-check and docker compose up (async, single-flight)
  kroki.ts    — HTTP client for Kroki API, DIAGRAM_TYPES map
  cache.ts    — SHA-256 keyed LRU cache (100 entries / 50 MB)
docker-compose.yml  — kroki + companion containers (project: kroki-shared)

The server warms up Kroki before accepting connections so the first tool call is never delayed by container start time. If warm-up fails (Docker not running), it logs a warning and retries on the first tool call.

Rendered results are cached in memory for the lifetime of the server process, keyed on (diagram_type, source, output_format, options, query_options).