Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

generative-ui-mcp

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generative-ui-mcp

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

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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.

ModuleWhat it covers
interactiveHTML controls, forms, sliders, calculators
chartChart.js patterns, canvas setup, interactive data controls
mockupUI mockup layouts, component patterns
artSVG illustrations, artistic visualizations
diagramFlowcharts, 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:

NameTypeDescription
modulesstring[]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

Keywords

mcp

FAQs

Package last updated on 16 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts