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

generative-ui-mcp

v1.0.0

Published

MCP server that teaches AI models to generate interactive visualizations — charts, diagrams, mockups, and more.

Downloads

125

Readme

Generative UI MCP

An MCP server that teaches AI models to generate interactive visualizations — charts, diagrams, mockups, and more.

Inspired by Anthropic's Artifacts and Vercel's Generative UI. This server provides structured design guidelines so AI models produce consistent, streaming-safe, visually polished widgets.

What it does

Instead of stuffing thousands of tokens of design rules into every system prompt, this MCP server lets the model load guidelines on demand — only when it actually needs to generate a visualization.

| Module | What it covers | |--------|---------------| | interactive | HTML controls, forms, sliders, calculators | | chart | Chart.js patterns, canvas setup, interactive data controls | | mockup | UI mockup layouts, component patterns | | art | SVG illustrations, artistic visualizations | | diagram | Flowcharts, timelines, hierarchies, cycle diagrams, matrices |

The model calls load_ui_guidelines with the modules it needs, and gets back comprehensive design specs including:

  • Core design system (philosophy, streaming rules, CSS variables)
  • Color palette (6 ramps with semantic usage rules)
  • Component patterns and code templates
  • SVG setup guides with arrow markers and viewBox calculations
  • 8 diagram types with layout rules and code examples

Quick start

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "generative-ui": {
      "command": "node",
      "args": ["/path/to/Generative-UI-MCP/build/index.js"]
    }
  }
}

Claude Code

claude mcp add generative-ui node /path/to/Generative-UI-MCP/build/index.js

npx (after publishing to npm)

{
  "mcpServers": {
    "generative-ui": {
      "command": "npx",
      "args": ["generative-ui-mcp"]
    }
  }
}

Tool

load_ui_guidelines

Load detailed design guidelines for generating visual widgets.

Parameters:

| Name | Type | Description | |------|------|-------------| | modules | string[] | Modules to load: interactive, chart, mockup, art, diagram |

Example call:

{
  "name": "load_ui_guidelines",
  "arguments": {
    "modules": ["chart", "diagram"]
  }
}

Shared sections (like Core Design System and Color Palette) are automatically deduplicated when loading multiple modules.

Resource

generative-ui://system-prompt

A compact system prompt snippet (~300 tokens) with all hard constraints needed for valid widget output. Hosts can inject this into their system prompt so the model can generate basic widgets even without calling the tool.

Contains: output format, JSON escaping rules, streaming order, CDN allowlist, SVG setup, size limits, and interaction patterns.

How it works

┌─────────────┐    system prompt     ┌─────────────┐
│   AI Host   │ ◄── injects ──────── │  Resource:   │
│ (Claude,    │     ~300 tokens      │ system-prompt│
│  Cursor,    │                      └─────────────┘
│  etc.)      │
│             │    tool call          ┌─────────────┐
│   Model ────│──► load_ui_          │  Guidelines  │
│             │    guidelines         │  Modules     │
│             │ ◄── returns ──────── │  (on demand) │
│             │    detailed specs     └─────────────┘
└─────────────┘

Token savings: The system prompt is ~300 tokens vs ~650+ tokens for full guidelines. Detailed specs are only loaded when the model actually needs to generate a visualization. Most conversations don't involve widgets, so this saves tokens on every request.

Development

npm install
npm run build
npm start

License

MIT