gemini-design-mcp 3.1.0 → 3.2.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 CHANGED
@@ -7,7 +7,7 @@ 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.1.0",
10
+ version: "3.2.0",
11
11
  });
12
12
  // =============================================================================
13
13
  // TOOL 1: CREATE_FRONTEND
@@ -19,20 +19,17 @@ server.tool("create_frontend", `Create a NEW, complete frontend file with PREMIU
19
19
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
20
20
 
21
21
  This tool is for creating NEW files that need HIGH-QUALITY DESIGN.
22
- Gemini excels at visual design, layout, and premium UI aesthetics.
23
22
 
24
23
  ✅ 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
24
+ • "Create a pricing page" → New file with designed UI
25
+ • "Create a dashboard" New file with designed UI
26
+ • "Create a landing page" New file with designed UI
27
+ • "Create a user profile component" → New file with designed UI
30
28
 
31
29
  ❌ DO NOT USE THIS TOOL FOR:
32
30
  • Creating utility functions → You can do this yourself
33
- • Creating simple TypeScript types → You can do this yourself
31
+ • Creating TypeScript types → You can do this yourself
34
32
  • Creating config files → You can do this yourself
35
- • Creating files that don't need design → You can do this yourself
36
33
 
37
34
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
38
35
  ⚠️ CRITICAL: MANDATORY FLOW BEFORE CALLING
@@ -40,62 +37,32 @@ Gemini excels at visual design, layout, and premium UI aesthetics.
40
37
 
41
38
  STEP 1: CHECK PROJECT STATE
42
39
  ─────────────────────────────
43
- A) EMPTY REPO (no package.json, no framework):
44
- → DO NOT call any tool yet
40
+ A) EMPTY REPO (no package.json):
45
41
  → Ask user: "What tech stack do you want?"
46
- → Help them initialize the project first
42
+ → Help them initialize first
47
43
 
48
- B) PROJECT EXISTS but NO frontend files/design yet:
44
+ B) PROJECT EXISTS but NO frontend files yet:
49
45
  → Proceed to Step 2 (Vibe Selection) - MANDATORY
50
46
 
51
47
  C) PROJECT EXISTS with existing frontend code:
52
- → Analyze existing files to understand design system
53
- Pass relevant files as context parameter
54
- → Skip vibe selection (use existing design)
48
+ → Analyze existing files, pass as context
49
+ Skip vibe selection
55
50
 
56
51
  STEP 2: VIBE SELECTION (Required for new designs)
57
52
  ──────────────────────────────────────────────────
58
- If the project has no existing design system, you MUST run vibe selection:
53
+ Generate 5 vibe options with RICH descriptions (2-3 sentences each):
59
54
 
60
- 1. Generate 5 vibe options with RICH, EVOCATIVE descriptions (2-3 sentences each):
61
-
62
- 🏛️ "Pristine Museum"
63
- An ultra-clean, 'white-cube' aesthetic focused on vast negative space and
64
- absolute stillness. Content displayed like art in a modern gallery.
65
- Minimal chrome, maximum breathing room, typography as sculpture.
66
-
67
- ⚡ "Technical Precision"
68
- A layout-driven vibe emphasizing the grid and intentional structure.
69
- Sharp edges, monospace accents, blueprint energy. Feels slightly
70
- 'under construction' in a cool, architectural way.
71
-
72
- 🌊 "Fluid & Organic"
73
- Soft curves, flowing gradients, and natural movement throughout.
74
- Like water or silk, everything feels smooth and interconnected.
75
- Calming yet sophisticated, with gentle animations.
76
-
77
- 🔥 "Bold & Unapologetic"
78
- High contrast, oversized typography, dramatic color blocks.
79
- Demands attention and makes a statement. Not for the faint of heart.
80
- Strong visual hierarchy, impactful first impressions.
81
-
82
- 🌙 "Dark Luxe"
83
- Deep, rich darks with subtle metallic or jewel-tone accents.
84
- Premium feel, like a high-end app at night. Sophisticated shadows,
85
- glowing highlights, and refined micro-interactions.
86
-
87
- 2. Present vibes to user, wait for selection
88
- 3. Call this tool with designSystem.vibe filled
55
+ 🏛️ "Pristine Museum" - Ultra-clean, white-cube aesthetic...
56
+ ⚡ "Technical Precision" - Grid-focused, architectural...
57
+ 🌊 "Fluid & Organic" - Soft curves, flowing gradients...
58
+ 🔥 "Bold & Unapologetic" - High contrast, oversized typography...
59
+ 🌙 "Dark Luxe" - Deep darks, metallic accents...
89
60
 
90
61
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
91
62
  📤 OUTPUT
92
63
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
93
64
 
94
- Returns a COMPLETE file with:
95
- - All necessary imports
96
- - Premium, polished UI design
97
- - Proper exports
98
- - Ready to save directly to filePath`, createFrontendSchema, createFrontend);
65
+ Returns a COMPLETE file ready to save.`, createFrontendSchema, createFrontend);
99
66
  // =============================================================================
100
67
  // TOOL 2: MODIFY_FRONTEND
101
68
  // =============================================================================
@@ -106,140 +73,147 @@ server.tool("modify_frontend", `Redesign a SINGLE UI element. Returns ONLY the c
106
73
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
107
74
 
108
75
  This tool makes exactly ONE design modification at a time.
109
-
110
- If you need multiple design changes, call this tool MULTIPLE TIMES IN PARALLEL.
111
-
112
- Example - User: "Redesign the sidebar and the header"
113
- → Call 1: modify_frontend (sidebar redesign)
114
- → Call 2: modify_frontend (header redesign)
115
- → Run both calls IN PARALLEL
116
-
117
- NEVER bundle multiple modifications into one call!
76
+ If you need multiple changes, call this tool MULTIPLE TIMES IN PARALLEL.
118
77
 
119
78
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
120
- 🎯 THIS TOOL IS FOR DESIGN CHANGES, NOT CODE LOGIC
79
+ 🎯 WHEN TO USE THIS TOOL
121
80
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
122
81
 
123
- Gemini is a DESIGN specialist. Use this tool when the visual design needs work.
124
-
125
- ✅ USE THIS TOOL FOR (design changes):
126
- • "The sidebar looks ugly, redesign it" → Full visual redesign
127
- • "Make this button look more premium" → Design quality upgrade
128
- • "This card looks dated, refresh it" → Visual refresh
129
- • "Redesign the header with better layout" → Layout + design
130
-
131
- ❌ DO NOT USE THIS TOOL FOR (you can do these yourself):
132
- • "Make the sidebar collapsible" → Logic change, just add useState
133
- • "Change the background to blue" → Just change the class
134
- • "Add a loading spinner" → Simple code addition
135
- • "Add onClick handler" → Just code, no design
136
- • "Center this div" → Just flex + items-center
137
-
138
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
139
- 💡 DECISION GUIDE: Should I use this tool?
140
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
82
+ Use this to REDESIGN existing UI elements that need better design.
141
83
 
142
- Ask yourself: "Does this require VISUAL DESIGN expertise?"
84
+ USE THIS TOOL FOR:
85
+ • "The sidebar looks ugly, redesign it"
86
+ • "Make this card look more premium"
87
+ • "This header looks dated, refresh it"
88
+ • "The buttons look boring, make them better"
143
89
 
144
- | User says... | Use this tool? | Why |
145
- |---------------------------------------|----------------|------------------------------|
146
- | "Redesign the sidebar" | YES | Visual design needed |
147
- | "Make it look more premium" | YES | Design quality improvement |
148
- | "The UI looks bad, fix it" | YES | Design expertise needed |
149
- | "Make the sidebar collapsible" | ❌ NO | Just logic (useState) |
150
- | "Change background color" | ❌ NO | One class change |
151
- | "Add a button" | ❌ NO | Simple code addition |
152
- | "Add hover effects" | ❌ NO | Just add hover: classes |
90
+ DO NOT USE THIS TOOL FOR:
91
+ • "Make the sidebar collapsible" → Just logic (useState), do it yourself
92
+ "Change background to blue" Just change the class yourself
93
+ "Add onClick handler" Just code, do it yourself
94
+ "Center this div" Just add flex classes yourself
153
95
 
154
96
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
155
97
  📤 OUTPUT FORMAT
156
98
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
157
99
 
158
- Returns a find/replace block (NOT the full file):
159
-
160
100
  // NEW IMPORTS NEEDED: (if any)
161
101
  import { X } from "y";
162
102
 
163
103
  // FIND THIS CODE:
164
- <exact existing code to find>
104
+ <exact existing code>
165
105
 
166
106
  // REPLACE WITH:
167
- <new redesigned code>
168
-
169
- You (the agent) are responsible for:
170
- - Applying the find/replace to the file
171
- - Merging any new imports`, modifyFrontendSchema, modifyFrontend);
107
+ <new redesigned code>`, modifyFrontendSchema, modifyFrontend);
172
108
  // =============================================================================
173
109
  // TOOL 3: SNIPPET_FRONTEND
174
110
  // =============================================================================
175
- server.tool("snippet_frontend", `Generate a NEW UI component/section to INSERT into an existing file.
111
+ server.tool("snippet_frontend", `Generate the JSX/HTML for a NEW UI component to INSERT into an existing file.
176
112
 
177
113
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
178
- 🎯 THIS TOOL IS FOR ADDING NEW DESIGNED UI ELEMENTS
114
+ ⚠️ CRITICAL: SEPARATION OF CONCERNS
179
115
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
180
116
 
181
- Use this when you need to ADD a new UI element that requires design quality.
117
+ When adding a new UI feature:
118
+ • YOU (Claude) handle the LOGIC: useState, handlers, data, conditions
119
+ • GEMINI handles the JSX/HTML: the actual UI component with premium design
120
+
121
+ EXAMPLE - User: "Add a search dropdown with results"
182
122
 
183
- USE THIS TOOL FOR (new designed UI to insert):
184
- "Add a sidebar to this dashboard" → New designed component to insert
185
- "Add a stats section with charts" → Complex UI element
186
- "Add a pricing table" → Designed component
187
- • "Add a testimonials carousel" → Needs visual design
188
- • "Add a feature comparison grid" → Complex layout + design
123
+ YOU do this yourself:
124
+ const [searchQuery, setSearchQuery] = useState('');
125
+ const [showDropdown, setShowDropdown] = useState(false);
126
+ const filteredResults = data.filter(...)
189
127
 
190
- DO NOT USE THIS TOOL FOR (you can do these yourself):
191
- "Add a button" → Too simple, just write the button
192
- "Add a loading spinner" → Simple, do it yourself
193
- "Add an onClick handler" → Just code, no design
194
- "Add a useState hook" Logic, not design
195
- "Add an import statement" → Just code
128
+ GEMINI does this (via snippet_frontend):
129
+ <div className="relative">
130
+ <input className="..." />
131
+ {showDropdown && (
132
+ <div className="absolute ..."> // Premium designed dropdown
133
+ {filteredResults.map(item => (
134
+ <div className="..."> // Beautiful result items
135
+ <Icon />
136
+ <span>{item.title}</span>
137
+ </div>
138
+ ))}
139
+ </div>
140
+ )}
141
+ </div>
196
142
 
197
143
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
198
- 💡 DECISION GUIDE: snippet_frontend vs modify_frontend
144
+ 🎯 WHEN TO USE THIS TOOL
199
145
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
200
146
 
201
- | Situation | Tool |
202
- |----------------------------------------------|-------------------|
203
- | Adding NEW UI element to a file | snippet_frontend |
204
- | Redesigning EXISTING UI in a file | modify_frontend |
205
- | Creating a NEW file entirely | create_frontend |
147
+ Use this for ANY new UI component that needs visual design:
206
148
 
207
- Example:
208
- - Dashboard.tsx exists with header + main content
209
- - User: "Add a sidebar" → snippet_frontend (adding NEW element)
210
- - User: "Redesign the header" → modify_frontend (changing EXISTING element)
149
+ ✅ USE THIS TOOL FOR (Gemini designs the JSX):
150
+ "Add a sidebar" You add state, Gemini designs the sidebar JSX
151
+ "Add a search dropdown" → You add useState/filtering, Gemini designs the dropdown JSX
152
+ "Add a modal" → You add open/close state, Gemini designs the modal JSX
153
+ • "Add a notification toast" → You add state, Gemini designs the toast JSX
154
+ • "Add a stats section" → You add data, Gemini designs the stats cards JSX
155
+ • "Add a navigation menu" → You add routing logic, Gemini designs the menu JSX
156
+ • "Add a user avatar dropdown" → You add state, Gemini designs the dropdown JSX
157
+ • "Add a data table" → You add sorting/filtering, Gemini designs the table JSX
158
+
159
+ ❌ DO NOT USE THIS TOOL FOR (too simple, do it yourself):
160
+ • "Add a single button" → Just write <button>
161
+ • "Add an input field" → Just write <input>
162
+ • "Add a simple link" → Just write <a> or <Link>
163
+ • "Add a loading spinner" → Just a simple div with animation
164
+
165
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
166
+ 💡 THE RULE: If it has multiple elements + needs to look good → snippet_frontend
167
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
168
+
169
+ | Component | Use snippet_frontend? | Why |
170
+ |------------------------------|----------------------|----------------------------|
171
+ | Search dropdown with results | ✅ YES | Multiple elements, design |
172
+ | Sidebar with nav items | ✅ YES | Multiple elements, design |
173
+ | Modal with form | ✅ YES | Multiple elements, design |
174
+ | Card grid | ✅ YES | Multiple elements, design |
175
+ | Data table | ✅ YES | Multiple elements, design |
176
+ | Single button | ❌ NO | Too simple |
177
+ | Single input | ❌ NO | Too simple |
178
+ | Loading spinner | ❌ NO | Too simple |
211
179
 
212
180
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
213
181
  ⚠️ REQUIRED: INSERTION CONTEXT
214
182
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
215
183
 
216
- The insertionContext parameter tells Gemini WHERE and HOW to match the design:
184
+ Tell Gemini WHERE and HOW to match the design:
217
185
 
218
- Good example:
219
- "Inside Dashboard component's return, after <Header />.
220
- Uses Tailwind with dark theme (bg-zinc-900, text-zinc-100).
221
- Existing components use rounded-xl, p-6 padding, shadow-lg.
222
- State managed with useState."
186
+ Good: "After the header in Dashboard. Dark theme (bg-zinc-900),
187
+ rounded-xl corners, p-6 padding. The dropdown should show
188
+ search results with icons and subtitles."
223
189
 
224
- Bad example:
225
- "In the dashboard"
190
+ Bad: "In the dashboard"
226
191
 
227
192
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
228
193
  📤 OUTPUT FORMAT
229
194
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
230
195
 
231
- Returns snippet with optional new imports:
232
-
233
196
  // NEW IMPORTS NEEDED:
234
- import { useState } from "react";
197
+ import { Search } from "lucide-react";
235
198
 
236
199
  // SNIPPET:
237
- <Sidebar className="...">
238
- ...
239
- </Sidebar>
240
-
241
- You are responsible for:
242
- - Merging new imports with existing ones
200
+ <div className="relative">
201
+ <Search className="absolute left-3 top-1/2 -translate-y-1/2 text-zinc-400" />
202
+ <input
203
+ value={searchQuery}
204
+ onChange={(e) => setSearchQuery(e.target.value)}
205
+ className="w-full pl-10 pr-4 py-2 bg-zinc-800 rounded-xl ..."
206
+ />
207
+ {showDropdown && (
208
+ <div className="absolute top-full mt-2 w-full bg-zinc-800 rounded-xl shadow-2xl ...">
209
+ {/* Premium designed dropdown content */}
210
+ </div>
211
+ )}
212
+ </div>
213
+
214
+ You (Claude) are responsible for:
215
+ - Adding the logic (useState, handlers) BEFORE calling this tool
216
+ - Merging new imports
243
217
  - Inserting the snippet at the correct location`, snippetFrontendSchema, snippetFrontend);
244
218
  // =============================================================================
245
219
  // START SERVER
@@ -247,7 +221,7 @@ You are responsible for:
247
221
  async function main() {
248
222
  const transport = new StdioServerTransport();
249
223
  await server.connect(transport);
250
- console.error("gemini-design-mcp v3.1.0 running on stdio");
224
+ console.error("gemini-design-mcp v3.2.0 running on stdio");
251
225
  }
252
226
  main().catch((error) => {
253
227
  console.error("Fatal error:", error);
@@ -1,4 +1,4 @@
1
- import { GoogleGenAI } from "@google/genai";
1
+ import { GoogleGenAI, ThinkingLevel } from "@google/genai";
2
2
  const apiKey = process.env.GEMINI_API_KEY;
3
3
  if (!apiKey) {
4
4
  console.error("ERROR: GEMINI_API_KEY environment variable is required");
@@ -6,7 +6,7 @@ if (!apiKey) {
6
6
  process.exit(1);
7
7
  }
8
8
  export const ai = new GoogleGenAI({ apiKey });
9
- // Default model - Gemini 3 Pro Preview (best for design)
9
+ // Default model - Gemini 3 Flash Preview (best for design)
10
10
  export const DEFAULT_MODEL = "gemini-3-flash-preview";
11
11
  export async function generateWithGemini(systemPrompt, userPrompt, model = DEFAULT_MODEL) {
12
12
  try {
@@ -15,6 +15,10 @@ export async function generateWithGemini(systemPrompt, userPrompt, model = DEFAU
15
15
  contents: userPrompt,
16
16
  config: {
17
17
  systemInstruction: systemPrompt,
18
+ temperature: 1,
19
+ thinkingConfig: {
20
+ thinkingLevel: ThinkingLevel.LOW,
21
+ },
18
22
  },
19
23
  });
20
24
  return response.text ?? "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemini-design-mcp",
3
- "version": "3.1.0",
3
+ "version": "3.2.1",
4
4
  "description": "MCP server that uses Gemini 3 Pro for frontend/design code generation",
5
5
  "main": "build/index.js",
6
6
  "bin": {