glue-code-generator
Maps API JSON to Vue/React components with Zod schemas and live UI previews
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"mcp-glue-code-generator": {
"args": [
"mcp-glue-code-generator@1.0.6"
],
"command": "npx"
}
}
}
可用工具 (5 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
tavily_search 14 个参数 需填 1 项
Search the web for current information on any topic. Use for news, facts, or data beyond your knowledge cutoff. Returns snippets and source URLs.
必填参数:query
tavily_extract 6 个参数 需填 1 项
Extract content from URLs. Returns raw page content in markdown or text format.
必填参数:urls
tavily_crawl 11 个参数 需填 1 项
Crawl a website starting from a URL. Extracts content from pages with configurable depth and breadth.
必填参数:url
tavily_map 8 个参数 需填 1 项
Map a website's structure. Returns a list of URLs found starting from the base URL.
必填参数:url
tavily_research 2 个参数 需填 1 项
Perform comprehensive research on a given topic or question. Use this tool when you need to gather information from multiple sources to answer a question or complete a task. Returns a detailed response based on the research findings.
必填参数:input
服务介绍
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:
- Stage 1 (Factory): Takes "Messy API JSON" + "Design System Component" (Vue or React) → Generates Zod Schema mapping
- Stage 2 (Runtime): Renders a live preview using
mcp-uidirectly in your chat
# 🚀 Quick Start
# Install dependencies
npm install
# Build the server
npm run build
# Start the server
npm start
Server will be running at:
- Health Check: http://localhost:3000/
- MCP Endpoint: http://localhost:3000/mcp
# 🔧 VS Code Integration
# # Option 1: Roo Code / Cline Extension
Add to your VS Code settings (settings.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:
{
"mcpServers": {
"glue-code-generator": {
"command": "node",
"args": ["d:/MCPUIPlugin/build/index.js"]
}
}
}
# 🎮 Demo Walkthrough
# # The "Magic Moment"
- Open your AI chat (VS Code with Roo Code, or Claude Desktop)
- 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>
- Result: The tool generates the Zod schema AND renders the actual card live in chat!
# 🧪 Testing with MCP Inspector
# Quick CLI test
npx @modelcontextprotocol/inspector - -cli http://localhost:3000/mcp - -method tools/list
# Or use the GUI
npx @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:
| Parameter | Type | Description |
|- -- -- -- -- --|- -- -- -|- -- -- -- -- -- --|
| api_json_sample | string | JSON response from backend API |
| vue_component_code | string | Vue 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:
- Create account at smithery.ai
- Submit your server with metadata
- Users can browse and add via:
smithery install glue-code-generator
# # Option 2: npm Package
Publish to npm for npx usage:
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