gemini-design-mcp 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +103 -112
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -7,26 +7,32 @@ import { snippetFrontendSchema, snippetFrontend } from "./tools/snippet-frontend
|
|
|
7
7
|
// Create MCP server
|
|
8
8
|
const server = new McpServer({
|
|
9
9
|
name: "gemini-design-mcp",
|
|
10
|
-
version: "3.0.
|
|
10
|
+
version: "3.0.1",
|
|
11
11
|
});
|
|
12
12
|
// =============================================================================
|
|
13
13
|
// TOOL 1: CREATE_FRONTEND
|
|
14
14
|
// =============================================================================
|
|
15
|
-
server.tool("create_frontend", `Create a NEW, complete frontend file
|
|
15
|
+
server.tool("create_frontend", `Create a NEW, complete frontend file with PREMIUM DESIGN quality.
|
|
16
16
|
|
|
17
17
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
18
18
|
🎯 WHEN TO USE THIS TOOL
|
|
19
19
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
✅ "Create a new UserProfile component"
|
|
24
|
-
✅ "Create the main dashboard layout"
|
|
25
|
-
✅ "Create a settings page"
|
|
21
|
+
This tool is for creating NEW files that need HIGH-QUALITY DESIGN.
|
|
22
|
+
Gemini excels at visual design, layout, and premium UI aesthetics.
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
✅ USE THIS TOOL FOR:
|
|
25
|
+
• "Create a pricing page with 3 tiers" → Complex layout + design decisions
|
|
26
|
+
• "Create a dashboard with charts and stats" → Premium UI needed
|
|
27
|
+
• "Create a landing page for a SaaS" → Visual impact matters
|
|
28
|
+
• "Create a settings page" → Full page design
|
|
29
|
+
• "Create a user profile component" → Polished UI component
|
|
30
|
+
|
|
31
|
+
❌ DO NOT USE THIS TOOL FOR:
|
|
32
|
+
• Creating utility functions → You can do this yourself
|
|
33
|
+
• Creating simple TypeScript types → You can do this yourself
|
|
34
|
+
• Creating config files → You can do this yourself
|
|
35
|
+
• Creating files that don't need design → You can do this yourself
|
|
30
36
|
|
|
31
37
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
32
38
|
⚠️ CRITICAL: MANDATORY FLOW BEFORE CALLING
|
|
@@ -34,13 +40,10 @@ DO NOT use this tool for:
|
|
|
34
40
|
|
|
35
41
|
STEP 1: CHECK PROJECT STATE
|
|
36
42
|
─────────────────────────────
|
|
37
|
-
Before calling this tool, you MUST check the project state:
|
|
38
|
-
|
|
39
43
|
A) EMPTY REPO (no package.json, no framework):
|
|
40
44
|
→ DO NOT call any tool yet
|
|
41
|
-
→ Ask user: "What tech stack do you want?
|
|
45
|
+
→ Ask user: "What tech stack do you want?"
|
|
42
46
|
→ Help them initialize the project first
|
|
43
|
-
→ Only proceed after framework is installed
|
|
44
47
|
|
|
45
48
|
B) PROJECT EXISTS but NO frontend files/design yet:
|
|
46
49
|
→ Proceed to Step 2 (Vibe Selection) - MANDATORY
|
|
@@ -48,18 +51,17 @@ B) PROJECT EXISTS but NO frontend files/design yet:
|
|
|
48
51
|
C) PROJECT EXISTS with existing frontend code:
|
|
49
52
|
→ Analyze existing files to understand design system
|
|
50
53
|
→ Pass relevant files as context parameter
|
|
51
|
-
→ Skip vibe selection (use existing design
|
|
54
|
+
→ Skip vibe selection (use existing design)
|
|
52
55
|
|
|
53
56
|
STEP 2: VIBE SELECTION (Required for new designs)
|
|
54
57
|
──────────────────────────────────────────────────
|
|
55
58
|
If the project has no existing design system, you MUST run vibe selection:
|
|
56
59
|
|
|
57
|
-
1. Generate 5 vibe options with RICH, EVOCATIVE descriptions (2-3 sentences each)
|
|
58
|
-
Each vibe should paint a vivid picture of the aesthetic. Examples:
|
|
60
|
+
1. Generate 5 vibe options with RICH, EVOCATIVE descriptions (2-3 sentences each):
|
|
59
61
|
|
|
60
62
|
🏛️ "Pristine Museum"
|
|
61
63
|
An ultra-clean, 'white-cube' aesthetic focused on vast negative space and
|
|
62
|
-
absolute stillness. Content
|
|
64
|
+
absolute stillness. Content displayed like art in a modern gallery.
|
|
63
65
|
Minimal chrome, maximum breathing room, typography as sculpture.
|
|
64
66
|
|
|
65
67
|
⚡ "Technical Precision"
|
|
@@ -74,7 +76,7 @@ If the project has no existing design system, you MUST run vibe selection:
|
|
|
74
76
|
|
|
75
77
|
🔥 "Bold & Unapologetic"
|
|
76
78
|
High contrast, oversized typography, dramatic color blocks.
|
|
77
|
-
|
|
79
|
+
Demands attention and makes a statement. Not for the faint of heart.
|
|
78
80
|
Strong visual hierarchy, impactful first impressions.
|
|
79
81
|
|
|
80
82
|
🌙 "Dark Luxe"
|
|
@@ -83,170 +85,159 @@ If the project has no existing design system, you MUST run vibe selection:
|
|
|
83
85
|
glowing highlights, and refined micro-interactions.
|
|
84
86
|
|
|
85
87
|
2. Present vibes to user, wait for selection
|
|
86
|
-
|
|
87
88
|
3. Call this tool with designSystem.vibe filled
|
|
88
89
|
|
|
89
|
-
STEP 3: GATHER CONTEXT
|
|
90
|
-
───────────────────────
|
|
91
|
-
If the project has existing code:
|
|
92
|
-
- Read relevant files (components, styles, theme config)
|
|
93
|
-
- Pass them as the context parameter
|
|
94
|
-
- This ensures Gemini matches the existing design system
|
|
95
|
-
|
|
96
90
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
97
91
|
📤 OUTPUT
|
|
98
92
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
99
93
|
|
|
100
94
|
Returns a COMPLETE file with:
|
|
101
|
-
- All necessary imports
|
|
102
|
-
-
|
|
103
|
-
-
|
|
95
|
+
- All necessary imports
|
|
96
|
+
- Premium, polished UI design
|
|
97
|
+
- Proper exports
|
|
104
98
|
- Ready to save directly to filePath`, createFrontendSchema, createFrontend);
|
|
105
99
|
// =============================================================================
|
|
106
100
|
// TOOL 2: MODIFY_FRONTEND
|
|
107
101
|
// =============================================================================
|
|
108
|
-
server.tool("modify_frontend", `
|
|
102
|
+
server.tool("modify_frontend", `Redesign or significantly improve the VISUAL DESIGN of an existing file.
|
|
109
103
|
|
|
110
104
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
111
|
-
🎯
|
|
105
|
+
🎯 THIS TOOL IS FOR DESIGN CHANGES, NOT CODE LOGIC
|
|
112
106
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
113
107
|
|
|
114
|
-
Use this tool when
|
|
115
|
-
✅ "Add a delete button to this card component"
|
|
116
|
-
✅ "Change the color scheme from blue to purple"
|
|
117
|
-
✅ "Add loading and error states"
|
|
118
|
-
✅ "Make this sidebar collapsible"
|
|
119
|
-
✅ "Add dark mode support to this component"
|
|
120
|
-
✅ "Refactor this component to use a different state pattern"
|
|
108
|
+
Gemini is a DESIGN specialist. Use this tool when the visual design needs work.
|
|
121
109
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
110
|
+
✅ USE THIS TOOL FOR (design changes):
|
|
111
|
+
• "The sidebar looks ugly, redesign it" → Full visual redesign
|
|
112
|
+
• "Make this page look more premium/modern" → Design quality upgrade
|
|
113
|
+
• "This component looks dated, refresh the design" → Visual refresh
|
|
114
|
+
• "Redesign the header with a better layout" → Layout + design
|
|
115
|
+
• "The cards look boring, make them more visually appealing" → Design improvement
|
|
116
|
+
|
|
117
|
+
❌ DO NOT USE THIS TOOL FOR (you can do these yourself):
|
|
118
|
+
• "Make the sidebar collapsible" → Logic change, just add useState + animation
|
|
119
|
+
• "Change the background to blue" → Just change bg-zinc-900 to bg-blue-900
|
|
120
|
+
• "Add a loading spinner" → Simple code addition
|
|
121
|
+
• "Add onClick handler" → Just code, no design needed
|
|
122
|
+
• "Fix the TypeScript error" → Not a design task
|
|
123
|
+
• "Add dark mode toggle" → Logic, not design
|
|
124
|
+
• "Make it responsive" → You can add breakpoints yourself
|
|
125
125
|
|
|
126
126
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
127
|
-
|
|
127
|
+
💡 DECISION GUIDE: Should I use this tool?
|
|
128
128
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
129
129
|
|
|
130
|
-
|
|
131
|
-
You MUST read the file's current content before calling this tool.
|
|
132
|
-
Pass the complete file content as existingCode parameter.
|
|
133
|
-
|
|
134
|
-
2. UNDERSTAND THE MODIFICATION
|
|
135
|
-
Be specific about what to change. Vague requests = vague results.
|
|
136
|
-
Good: "Add a red delete button in the top-right corner of each card"
|
|
137
|
-
Bad: "Make it better"
|
|
130
|
+
Ask yourself: "Does this require VISUAL DESIGN expertise?"
|
|
138
131
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
132
|
+
| User says... | Use this tool? | Why |
|
|
133
|
+
|---------------------------------------|----------------|------------------------------|
|
|
134
|
+
| "Redesign the sidebar" | ✅ YES | Visual design needed |
|
|
135
|
+
| "Make it look more premium" | ✅ YES | Design quality improvement |
|
|
136
|
+
| "The UI looks bad, fix it" | ✅ YES | Design expertise needed |
|
|
137
|
+
| "Make the sidebar collapsible" | ❌ NO | Just logic (useState) |
|
|
138
|
+
| "Change background color" | ❌ NO | One class change |
|
|
139
|
+
| "Add a button" | ❌ NO | Simple code addition |
|
|
140
|
+
| "Add hover effects" | ❌ NO | Just add hover: classes |
|
|
141
|
+
| "Center this div" | ❌ NO | Just flex + items-center |
|
|
142
142
|
|
|
143
143
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
144
|
-
|
|
144
|
+
⚠️ REQUIRED BEFORE CALLING
|
|
145
145
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
146
146
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
- Return the COMPLETE modified file
|
|
147
|
+
1. READ THE EXISTING FILE FIRST
|
|
148
|
+
Pass the complete file content as existingCode parameter.
|
|
149
|
+
|
|
150
|
+
2. BE SPECIFIC ABOUT THE DESIGN PROBLEM
|
|
151
|
+
Good: "The sidebar looks outdated, redesign with modern aesthetics, better spacing"
|
|
152
|
+
Bad: "Fix the sidebar"
|
|
154
153
|
|
|
155
154
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
156
155
|
📤 OUTPUT
|
|
157
156
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
158
157
|
|
|
159
158
|
Returns the COMPLETE modified file:
|
|
160
|
-
- Ready to replace the original file
|
|
161
|
-
-
|
|
162
|
-
-
|
|
163
|
-
- Modification applied with premium quality`, modifyFrontendSchema, modifyFrontend);
|
|
159
|
+
- Ready to replace the original file
|
|
160
|
+
- Design improvements applied
|
|
161
|
+
- All functionality preserved`, modifyFrontendSchema, modifyFrontend);
|
|
164
162
|
// =============================================================================
|
|
165
163
|
// TOOL 3: SNIPPET_FRONTEND
|
|
166
164
|
// =============================================================================
|
|
167
|
-
server.tool("snippet_frontend", `Generate a
|
|
165
|
+
server.tool("snippet_frontend", `Generate a NEW UI component/section to INSERT into an existing file.
|
|
168
166
|
|
|
169
167
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
170
|
-
🎯
|
|
168
|
+
🎯 THIS TOOL IS FOR ADDING NEW DESIGNED UI ELEMENTS
|
|
171
169
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
172
170
|
|
|
173
|
-
Use this
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
171
|
+
Use this when you need to ADD a new UI element that requires design quality.
|
|
172
|
+
|
|
173
|
+
✅ USE THIS TOOL FOR (new designed UI to insert):
|
|
174
|
+
• "Add a sidebar to this dashboard" → New designed component to insert
|
|
175
|
+
• "Add a stats section with charts" → Complex UI element
|
|
176
|
+
• "Add a pricing table" → Designed component
|
|
177
|
+
• "Add a testimonials carousel" → Needs visual design
|
|
178
|
+
• "Add a feature comparison grid" → Complex layout + design
|
|
179
179
|
|
|
180
|
-
DO NOT
|
|
181
|
-
|
|
182
|
-
|
|
180
|
+
❌ DO NOT USE THIS TOOL FOR (you can do these yourself):
|
|
181
|
+
• "Add a button" → Too simple, just write the button
|
|
182
|
+
• "Add a loading spinner" → Simple, do it yourself
|
|
183
|
+
• "Add an onClick handler" → Just code, no design
|
|
184
|
+
• "Add a useState hook" → Logic, not design
|
|
185
|
+
• "Add an import statement" → Just code
|
|
183
186
|
|
|
184
187
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
185
|
-
💡
|
|
188
|
+
💡 DECISION GUIDE: snippet_frontend vs modify_frontend
|
|
186
189
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
187
190
|
|
|
188
|
-
|
|
|
189
|
-
|
|
190
|
-
|
|
|
191
|
-
|
|
|
192
|
-
|
|
|
191
|
+
| Situation | Tool |
|
|
192
|
+
|----------------------------------------------|-------------------|
|
|
193
|
+
| Adding NEW UI element to a file | snippet_frontend |
|
|
194
|
+
| Redesigning EXISTING UI in a file | modify_frontend |
|
|
195
|
+
| Creating a NEW file entirely | create_frontend |
|
|
193
196
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
1. User: "Add a sidebar to my dashboard"
|
|
199
|
-
2. You read Dashboard.tsx
|
|
200
|
-
3. You call snippet_frontend with insertion context
|
|
201
|
-
4. Gemini returns just the sidebar code
|
|
202
|
-
5. You insert it at the right location in Dashboard.tsx
|
|
197
|
+
Example:
|
|
198
|
+
- Dashboard.tsx exists with header + main content
|
|
199
|
+
- User: "Add a sidebar" → snippet_frontend (adding NEW element)
|
|
200
|
+
- User: "Redesign the header" → modify_frontend (changing EXISTING element)
|
|
203
201
|
|
|
204
202
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
205
203
|
⚠️ REQUIRED: INSERTION CONTEXT
|
|
206
204
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
207
205
|
|
|
208
|
-
The insertionContext parameter
|
|
209
|
-
- WHERE the snippet will be inserted
|
|
210
|
-
- WHAT code surrounds it
|
|
211
|
-
- WHAT patterns to match
|
|
206
|
+
The insertionContext parameter tells Gemini WHERE and HOW to match the design:
|
|
212
207
|
|
|
213
|
-
Good
|
|
214
|
-
"Inside
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
208
|
+
Good example:
|
|
209
|
+
"Inside Dashboard component's return, after <Header />.
|
|
210
|
+
Uses Tailwind with dark theme (bg-zinc-900, text-zinc-100).
|
|
211
|
+
Existing components use rounded-xl, p-6 padding, shadow-lg.
|
|
212
|
+
State managed with useState."
|
|
218
213
|
|
|
219
|
-
Bad
|
|
220
|
-
"In the dashboard
|
|
214
|
+
Bad example:
|
|
215
|
+
"In the dashboard"
|
|
221
216
|
|
|
222
217
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
223
218
|
📤 OUTPUT FORMAT
|
|
224
219
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
225
220
|
|
|
226
|
-
Returns
|
|
221
|
+
Returns snippet with optional new imports:
|
|
227
222
|
|
|
228
223
|
// NEW IMPORTS NEEDED:
|
|
229
224
|
import { useState } from "react";
|
|
230
|
-
import { Dialog } from "@headlessui/react";
|
|
231
225
|
|
|
232
226
|
// SNIPPET:
|
|
233
227
|
<Sidebar className="...">
|
|
234
228
|
...
|
|
235
229
|
</Sidebar>
|
|
236
230
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
- Merging new imports with existing imports
|
|
241
|
-
- Inserting the snippet at the correct location
|
|
242
|
-
- Ensuring the file still compiles after insertion`, snippetFrontendSchema, snippetFrontend);
|
|
231
|
+
You are responsible for:
|
|
232
|
+
- Merging new imports with existing ones
|
|
233
|
+
- Inserting the snippet at the correct location`, snippetFrontendSchema, snippetFrontend);
|
|
243
234
|
// =============================================================================
|
|
244
235
|
// START SERVER
|
|
245
236
|
// =============================================================================
|
|
246
237
|
async function main() {
|
|
247
238
|
const transport = new StdioServerTransport();
|
|
248
239
|
await server.connect(transport);
|
|
249
|
-
console.error("gemini-design-mcp v3.0.
|
|
240
|
+
console.error("gemini-design-mcp v3.0.1 running on stdio");
|
|
250
241
|
}
|
|
251
242
|
main().catch((error) => {
|
|
252
243
|
console.error("Fatal error:", error);
|