mcp-garendesign
Enables AI-driven frontend component design and code generation from natural language requirements. Supports Vue, React, and Angular with intelligent component decomposition, API design, and complete project generation.
README
š mcp-garendesign - AI-driven component design and code generation toolkit
<div align="center">
<img src="assets/garen.jpeg" alt="God-King Garen - mcp-garendesign project logo" width="400" /> <br> <em>God-King Garen - a symbol of powerful AI design capability</em>
From requirements to code: an intelligent automated pipeline šÆ
</div>
<div align="center">
</div>
š Table of Contents
- šÆ Overview
- š Core Workflow
- š” Key Features
- šļø Architecture
- š Getting Started
- š Usage Guide
šÆ Overview
mcp-garendesign is an AI-driven component design service based on the Model Context Protocol (MCP). It focuses on intelligent design and generation of frontend components, enabling end-to-end automation from user requirements to a complete code project.
š Core Value
- š Productivity: Improve development efficiency by 50%+
- šÆ Quality: Use shared state and a shared component library
- š§ Maintainability: Standardized code structure and API design
- šØ Consistency: Unified design system and component library
š Core Workflow
graph TD
A[š¤ User Requirements] --> B[š Requirement Analysis]
B --> C[š§© Decompose into Components]
C --> D[šØ Component Content & API Design]
D --> E[ā” IDE Code Generation]
E --> F[š Iterative API/Design Validation]
F --> G[š Module Integration Design]
G --> H[š IDE Code Integration]
style A fill:#ff6b6b,stroke:#333,stroke-width:2px
style B fill:#4ecdc4,stroke:#333,stroke-width:2px
style C fill:#45b7d1,stroke:#333,stroke-width:2px
style D fill:#96ceb4,stroke:#333,stroke-width:2px
style E fill:#feca57,stroke:#333,stroke-width:2px
style F fill:#ff9ff3,stroke:#333,stroke-width:2px
style G fill:#54a0ff,stroke:#333,stroke-width:2px
style H fill:#5f27cd,stroke:#333,stroke-width:2px
š Workflow Details
1ļøā£ User Requirements š¤
Users describe their needs in natural language. The system extracts the core requirements.
2ļøā£ Requirement Analysis š
Analyze and structure requirements: functional, non-functional, user stories, and business logic.
3ļøā£ Decomposition š§©
Split into manageable components, determine component types, complexity, and dependencies.
4ļøā£ Component Content & API Design šØ
Design detailed specs for each component: Props, Events, Slots, and styles.
5ļøā£ IDE Code Generation ā”
Generate code from the design: component files, type definitions, styles, tests.
6ļøā£ Iterative Validation š
Monitor generation status, adjust polling intervals, handle timeouts and errors.
7ļøā£ Module Integration š
Integrate components into full pages: layout, data flow, and state management.
8ļøā£ IDE Code Integration š
Produce a complete project: structure, configs, build scripts, deployment.
š” Key Features
šÆ Intelligent Requirement Understanding
- NLP: Understand user intent
- Context awareness: Map to business scenarios
- Requirement validation: Ensure completeness
š§© Smart Component Decomposition
- Complexity analysis: Auto-evaluate component complexity
- Dependency management: Handle component dependencies smartly
- Token optimization: Efficient AI usage
ā” Efficient Code Generation
- Multi-framework: Vue, React, Angular
- Type safety: Full TypeScript support
- Best practices: Industry standards
š Intelligent Monitoring
- Adaptive polling: Auto-adjust frequency
- Error recovery: Retry mechanisms
- Performance: Resource optimization
šØ Design System Integration
- Component libraries: Private library integration
- Design guidelines: Unified standards
- Theming: Multiple themes
šļø Architecture
graph TB
subgraph "Frontend Layer"
A[User Interface]
B[IDE Plugin]
end
subgraph "Service Layer"
C[MCP Server]
D[Requirement Analysis Engine]
E[Component Design Engine]
F[Code Generation Engine]
G[Polling Controller]
end
subgraph "AI Layer"
H[AI Model Integration]
I[Multi-model Support]
J[Streaming]
end
subgraph "Data Layer"
K[Component Knowledge Base]
L[Design Template Library]
M[Configuration Management]
end
A --> C
B --> C
C --> D
C --> E
C --> F
C --> G
D --> H
E --> H
F --> H
G --> H
H --> I
H --> J
D --> K
E --> L
F --> M
š Getting Started
1. Install dependencies
# Clone the repository
git clone https://github.com/lyw405/mcp-garendesign.git
cd mcp-garendesign
# Install dependencies
npm install
# Or use pnpm
pnpm install
2. Configure environment
# Copy configuration files (note filenames)
cp data/config.exmple.json data/config.json
cp data/codegens.example.json data/codegens.json
3. Configure AI providers
Edit data/config.json:
{
"providers": [
{
"provider": "anthropic",
"models": [
{
"model": "claude-3-7-sonnet-latest",
"title": "Claude 3.7 Sonnet",
"baseURL": "https://api.anthropic.com",
"features": [],
"apiKey": "your-api-key"
}
]
}
]
}
Supported AI providers:
- Anthropic Claude:
https://api.anthropic.comor proxies - OpenAI GPT:
https://api.openai.com/v1or proxies - DeepSeek:
https://api.deepseek.comor proxies - Ollama:
http://localhost:11434(local models)
4. Start the service
# Quick start
./scripts/start.sh
# Or run manually
npm run build
npm start
# Development mode
npm run dev
5. Use the workflow
import { WorkflowEngine } from '@mcp-garendesign/core';
const workflow = new WorkflowEngine();
const result = await workflow.process({
requirement: 'Create a user management page',
framework: 'vue',
style: 'modern',
});
š Usage Guide
MCP Tools
design_component
Design frontend components from user requirements.
{
"name": "design_component",
"arguments": {
"prompt": [
{
"type": "text",
"text": "Create a product card component showing product image, name, price, and a buy button"
}
]
}
}
query_component
Query detailed information for a component.
{
"name": "query_component",
"arguments": {
"componentName": "Button"
}
}
Basic Example
import { MCPClient } from '@modelcontextprotocol/sdk/client';
const client = new MCPClient({
name: 'My MCP Client',
version: '1.0.0',
});
// Connect to the service
await client.connect({
type: 'stdio',
command: 'tsx',
args: ['src/mcp-server.ts'],
});
// Design a component
const result = await client.callTool({
name: 'design_component',
arguments: {
prompt: [{ type: 'text', text: 'Create a login form component' }],
},
});
šļø Project Structure
mcp-garendesign/
āāā src/
ā āāā mcp-server.ts # MCP server entry
ā āāā tools/ # MCP tools
ā ā āāā design-component.ts
ā ā āāā query-component.ts
ā āāā core/ # Core logic
ā ā āāā blocks/
ā ā āāā parsers/
ā ā āāā query/
ā ā āāā strategy/
ā āāā shared/ # Shared utils
ā ā āāā config/
ā ā āāā formatters/
ā ā āāā validators/
ā āāā types/ # Type definitions
ā āāā resources/ # MCP resources
āāā data/ # Configuration files
ā āāā codegens.json # Component library config
ā āāā config.json # AI providers config
āāā docs/ # Documentation
ā āāā GAREN_MCP_New_Version_Plan.md # Release plan
āāā scripts/ # Scripts
āāā package.json
š§ Troubleshooting
Common Issues
-
Configuration files not found
# Ensure configuration files exist ls data/config.json ls data/codegens.json -
Invalid API key
# Validate configuration npm run validate -
Service failed to start
# Check dependencies npm install # Rebuild npm run build -
Permission issues
# Make the start script executable chmod +x scripts/start.sh
Debug mode
# Enable debug
export DEBUG=true
export LOG_LEVEL=debug
# Start the service
npm run dev
š ļø Development Guide
Add a new tool
- Create a tool file under
src/tools/ - Register it in
src/mcp-server.ts - Update the tool handlers
Add a new resource
- Add a resource function in
src/resources/index.ts - Register it in
src/mcp-server.ts - Update resource handlers
š License
MIT License
<div align="center">
mcp-garendesign - Make AI a powerful assistant for every engineering team š¤
</div>
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.