OG

op7418/generative-ui-mcp

API 开发

本页由 AI 翻译,技术细节请以原文为准。 查看原文

62 stars 8 forks 质量 62 趋势 14

MCP服务器,教授AI模型生成交互式可视化——图表、示意图、模型图等。

概览

一个MCP服务器,教授AI模型生成交互式可视化——图表、图表、模型图等。 灵感来自Anthropic的Artifacts和Vercel的生成式UI。该服务器提供结构化设计指南,使AI模型生成一致、安全、视觉精致的小部件。 这个MCP服务器不再在每个系统提示中塞入成千上万个设计规则标记,而是允许模型——只有在真正需要生成可视化时才允许。 模型调用load_ui_guidelines所需的模块,并返回包括:- 核心设计系统(哲学、流规则、CSS变量)- 色彩调色板(6个带有语义使用规则的斜坡)- 组件模式和代码模板- 带箭头标记和viewBox计算的SVG设置指南 - 8种图表类型,包含布局规则和代码示例 将以下提示复制粘贴到你的AI助手(Claude代码、光标等)中。

概述(AI 翻译)

一个MCP服务器,教授AI模型生成交互式可视化——图表、图表、模型图等。

灵感来自Anthropic的Artifacts和Vercel的生成式UI。该服务器提供结构化设计指南,使AI模型生成一致、安全、视觉精致的小部件。

它的作用

这个MCP服务器不再在每个系统提示中塞入成千上万个设计规则标记,而是允许模型按需加载指南——仅在真正需要生成可视化时。

模块 涵盖内容
interactive HTML控件、表单、滑块、计算器
chart Chart.js图案、画布设置、交互式数据控制
mockup 用户界面模型布局,组件模式
art SVG插图,艺术可视化
diagram 流程图、时间线、层级结构、循环图、矩阵

该模型调用 load_ui_guidelines 及其所需模块,并获得包括:

  • 核心设计系统(哲学、流式规则、CSS变量)
  • 色彩调色板(6个带有语义使用规则的斜坡)
  • 组件模式和代码模板

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 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

Auto-install via AI

Copy and paste the following prompt into your AI assistant (Claude Code, Cursor, etc.) to install automatically:

Install the generative-ui-mcp MCP server. Run npx generative-ui-mcp as a stdio MCP server. The server name should be “generative-ui”.

Claude Code

claude mcp add generative-ui -- npx generative-ui-mcp

Claude Desktop

Add to your claude_desktop_config.json:

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

Cursor / Windsurf

Add to your MCP settings (.cursor/mcp.json or equivalent):

{
  "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.

在 GitHub 查看完整 README

安装

npx generative-ui-mcp
新手?先看 mcpskill.org 教程 →

配置

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