Glue Code Generator

io.github.Maverick7由 GitHub 账号 Maverick7 发布v1.0.6更新于 Oct 24, 2026

Maps API JSON to Vue/React components with Zod schemas and live UI previews

已验证STDIO仅桌面开发者工具媒体与设计

概览

AI 生成的概览

把示例 API JSON 映射为 Vue 或 React 设计系统组件的 Zod schema,并在对话中渲染实时 UI 预览。

可以做什么
  • 根据示例 API JSON 与设计系统 Vue 组件生成 Zod schema 映射
  • 同时返回映射后的数据预览与生成的 schema 代码
  • 通过 mcp-ui 在对话中渲染实时 HTML 卡片预览
  • 按两阶段工作:先生成 schema,再在运行时渲染预览
适用场景
适合在前端对接后端 API 时使用:让助手起草 API 响应与现有设计系统组件之间的 schema 映射,并在编写集成代码前先看到映射后的卡片效果。
运行要求
以本地 Node.js 进程运行;README 说明需安装依赖、构建并启动服务器,并在客户端配置中指向构建后的入口文件。README 还提到本地 3000 端口的健康检查与 MCP 连接地址。未声明任何账号、API 密钥或环境变量。
安装前请注意
该工具会把 API 响应样本和组件源码作为输入,请勿在提示中粘贴真实客户数据或密钥。README 中的客户端配置示例使用写死的本地文件路径,需替换为你自己的构建位置。生成的 schema 代码与预览在使用前应人工检查。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Glue Code Generator,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

MCP UI Glue Code Generator

🎯 The Grand Slam Demo: Maps messy API JSON to Vue OR React Design System components using Zod schemas, with live UI previews via MCP-UI.

✨ What is this?

This is a Two-Stage System for automating frontend integration:

  1. Stage 1 (Factory): Takes "Messy API JSON" + "Design System Component" (Vue or React) → Generates Zod Schema mapping
  2. Stage 2 (Runtime): Renders a live preview using mcp-ui directly in your chat

🚀 Quick Start

bash
# Install dependenciesnpm install
# Build the servernpm run build
# Start the servernpm start

Server will be running at:

🔧 VS Code Integration

Option 1: Roo Code / Cline Extension

Add to your VS Code settings (settings.json):

json
{  "roo-cline.mcpServers": {    "glue-code-generator": {      "command": "node",      "args": ["d:/MCPUIPlugin/build/index.js"]    }  }}

Option 2: Claude Desktop

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "glue-code-generator": {      "command": "node",      "args": ["d:/MCPUIPlugin/build/index.js"]    }  }}

🎮 Demo Walkthrough

The "Magic Moment"

  1. Open your AI chat (VS Code with Roo Code, or Claude Desktop)
  2. Paste this prompt:
Map this API response to this Vue component:
API Response:{  "cust_id": "USR-12345",  "tx_timestamp": "2025-12-06T10:30:00Z",  "stat_cd": "STATUS_OK",  "amt_val": 1250.50,  "desc_txt": "Monthly subscription payment"}
Vue Component:<template>  <div class="ds-card" :class="variant">    <h3>{{ title }}</h3>    <p class="subtitle">{{ subtitle }}</p>    <span class="amount">{{ formattedAmount }}</span>    <span class="badge" :class="variant">{{ status }}</span>  </div></template>
  1. Result: The tool generates the Zod schema AND renders the actual card live in chat!

🧪 Testing with MCP Inspector

bash
# Quick CLI testnpx @modelcontextprotocol/inspector --cli http://localhost:3000/mcp --method tools/list
# Or use the GUInpx @modelcontextprotocol/inspector# Then connect to http://localhost:3000/mcp with Streamable HTTP

📦 Tool Reference

generate_ui_schema

Maps API JSON to Vue component props.

Inputs:

ParameterTypeDescription
api_json_samplestringJSON response from backend API
vue_component_codestringVue component from Design System

Outputs:

  • Generated Zod schema code
  • Mapped data preview
  • Live HTML card rendered via mcp-ui

🏗️ Architecture

┌─────────────────────────────────────────────────────────┐│                    MCP Client                           ││         (VS Code / Claude Desktop / Goose)              │└────────────────────────┬────────────────────────────────┘                         │ MCP Protocol                         ▼┌─────────────────────────────────────────────────────────┐│             glue-code-generator Server                  ││  ┌─────────────────────────────────────────────────┐   ││  │         generate_ui_schema Tool                  │   ││  │  ┌───────────┐  ┌─────────────┐  ┌───────────┐  │   ││  │  │  Analyze  │→ │  Generate   │→ │  Render   │  │   ││  │  │  API JSON │  │ Zod Schema  │  │ UIResource│  │   ││  │  └───────────┘  └─────────────┘  └───────────┘  │   ││  └─────────────────────────────────────────────────┘   │└─────────────────────────────────────────────────────────┘

🚀 Publishing & Distribution

Option 1: Smithery (MCP Marketplace)

The official way for users to discover and install MCP servers:

  1. Create account at smithery.ai
  2. Submit your server with metadata
  3. Users can browse and add via: smithery install glue-code-generator

Option 2: npm Package

Publish to npm for npx usage:

bash
npm publish# Users run: npx @yourname/glue-code-generator

Option 3: GitHub

Users clone/download and configure manually in their MCP client settings.

Note: VS Code doesn't have a built-in MCP browser yet. Users configure MCP servers in their settings or use extensions like Roo Code/Cline.

📄 License

MIT

来源:README.md,提交 a754dfb

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.6最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。