gemini-design-mcp 3.0.1 → 3.2.0

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.0.1",
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,196 +37,183 @@ 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
  // =============================================================================
102
- server.tool("modify_frontend", `Redesign or significantly improve the VISUAL DESIGN of an existing file.
69
+ server.tool("modify_frontend", `Redesign a SINGLE UI element. Returns ONLY the changed code (find/replace format).
103
70
 
104
71
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
105
- 🎯 THIS TOOL IS FOR DESIGN CHANGES, NOT CODE LOGIC
72
+ ⚠️ CRITICAL: ONE MODIFICATION PER CALL
106
73
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
107
74
 
108
- Gemini is a DESIGN specialist. Use this tool when the visual design needs work.
109
-
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
75
+ This tool makes exactly ONE design modification at a time.
76
+ If you need multiple changes, call this tool MULTIPLE TIMES IN PARALLEL.
125
77
 
126
78
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
127
- 💡 DECISION GUIDE: Should I use this tool?
79
+ 🎯 WHEN TO USE THIS TOOL
128
80
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
129
81
 
130
- Ask yourself: "Does this require VISUAL DESIGN expertise?"
82
+ Use this to REDESIGN existing UI elements that need better design.
83
+
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"
131
89
 
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 |
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
142
95
 
143
96
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
144
- ⚠️ REQUIRED BEFORE CALLING
97
+ 📤 OUTPUT FORMAT
145
98
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
146
99
 
147
- 1. READ THE EXISTING FILE FIRST
148
- Pass the complete file content as existingCode parameter.
100
+ // NEW IMPORTS NEEDED: (if any)
101
+ import { X } from "y";
149
102
 
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"
103
+ // FIND THIS CODE:
104
+ <exact existing code>
153
105
 
154
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
155
- 📤 OUTPUT
156
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
157
-
158
- Returns the COMPLETE modified file:
159
- - Ready to replace the original file
160
- - Design improvements applied
161
- - All functionality preserved`, modifyFrontendSchema, modifyFrontend);
106
+ // REPLACE WITH:
107
+ <new redesigned code>`, modifyFrontendSchema, modifyFrontend);
162
108
  // =============================================================================
163
109
  // TOOL 3: SNIPPET_FRONTEND
164
110
  // =============================================================================
165
- 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.
166
112
 
167
113
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
168
- 🎯 THIS TOOL IS FOR ADDING NEW DESIGNED UI ELEMENTS
114
+ ⚠️ CRITICAL: SEPARATION OF CONCERNS
169
115
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
170
116
 
171
- 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
172
120
 
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
121
+ EXAMPLE - User: "Add a search dropdown with results"
179
122
 
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
123
+ YOU do this yourself:
124
+ const [searchQuery, setSearchQuery] = useState('');
125
+ const [showDropdown, setShowDropdown] = useState(false);
126
+ const filteredResults = data.filter(...)
127
+
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>
186
142
 
187
143
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
188
- 💡 DECISION GUIDE: snippet_frontend vs modify_frontend
144
+ 🎯 WHEN TO USE THIS TOOL
189
145
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
190
146
 
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 |
147
+ Use this for ANY new UI component that needs visual design:
148
+
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
196
158
 
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)
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 |
201
179
 
202
180
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
203
181
  ⚠️ REQUIRED: INSERTION CONTEXT
204
182
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
205
183
 
206
- The insertionContext parameter tells Gemini WHERE and HOW to match the design:
184
+ Tell Gemini WHERE and HOW to match the design:
207
185
 
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."
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."
213
189
 
214
- Bad example:
215
- "In the dashboard"
190
+ Bad: "In the dashboard"
216
191
 
217
192
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
218
193
  📤 OUTPUT FORMAT
219
194
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
220
195
 
221
- Returns snippet with optional new imports:
222
-
223
196
  // NEW IMPORTS NEEDED:
224
- import { useState } from "react";
197
+ import { Search } from "lucide-react";
225
198
 
226
199
  // SNIPPET:
227
- <Sidebar className="...">
228
- ...
229
- </Sidebar>
230
-
231
- You are responsible for:
232
- - 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
233
217
  - Inserting the snippet at the correct location`, snippetFrontendSchema, snippetFrontend);
234
218
  // =============================================================================
235
219
  // START SERVER
@@ -237,7 +221,7 @@ You are responsible for:
237
221
  async function main() {
238
222
  const transport = new StdioServerTransport();
239
223
  await server.connect(transport);
240
- console.error("gemini-design-mcp v3.0.1 running on stdio");
224
+ console.error("gemini-design-mcp v3.2.0 running on stdio");
241
225
  }
242
226
  main().catch((error) => {
243
227
  console.error("Fatal error:", error);
@@ -1,3 +1,3 @@
1
1
  export declare const CREATE_FRONTEND_PROMPT = "You are an elite UI/UX Designer creating production-ready, visually stunning interfaces.\n\nYOUR TASK: Create a COMPLETE, NEW frontend file.\n\nDESIGN EXCELLENCE REQUIREMENTS:\n\n1. **MAXIMUM DETAIL AND DENSITY**\n - The interface MUST be densely populated and feature-rich\n - NEVER produce simple wireframes, empty containers, or placeholder content\n - Fill the space with intricate details, realistic content, background elements, and meaningful UI components\n - Every section should feel like a fully finished, polished product\n\n2. **PREMIUM VISUAL STYLING**\n - Apply high-end design principles throughout\n - Use sophisticated styling: nuanced shadows, subtle gradients, refined borders, micro-textures\n - Add depth and dimension with layered elements\n - The aesthetic MUST feel modern, premium, and visually captivating\n - Use professional color palettes with proper contrast and hierarchy\n\n3. **COMPREHENSIVE INTERACTIVITY**\n - Design every element to look tangible and interactive\n - Include visual states: hover effects, focus rings, active states, transitions\n - Buttons should look clickable, inputs should look fillable\n - The interface should feel alive, not static\n\n4. **LAYOUT EXCELLENCE**\n - Use proper visual hierarchy with clear focal points\n - Apply consistent spacing rhythm throughout\n - Ensure the layout breathes - balance density with whitespace\n - Full viewport height designs (min-height: 100vh on body)\n - No awkward gaps or orphaned elements\n\n5. **RESPONSIVE BY DEFAULT**\n - Designs MUST work flawlessly on mobile and desktop\n - Touch-friendly sizing for interactive elements on mobile\n - Stackable grids that adapt naturally to screen size\n\n6. **REALISTIC CONTENT**\n - Use believable placeholder content (real-looking names, dates, numbers)\n - Include appropriate icons, avatars, and imagery\n - Data visualizations should have realistic data points\n - Text should be contextually appropriate, not \"Lorem ipsum\"\n\nOUTPUT REQUIREMENTS:\n- Return a COMPLETE file with all necessary imports at the top\n- Include proper exports (default or named as appropriate)\n- The code must be ready to use as-is, no modifications needed\n- Follow the tech stack conventions exactly\n- Return ONLY the code, no explanations or markdown fences";
2
- export declare const MODIFY_FRONTEND_PROMPT = "You are an elite UI/UX Designer modifying existing frontend code.\n\nYOUR TASK: Modify the provided code according to the user's request while maintaining design excellence.\n\nMODIFICATION PRINCIPLES:\n\n1. **PRESERVE EXISTING DESIGN LANGUAGE**\n - Maintain the existing color palette, typography, and spacing\n - Keep the visual consistency with the rest of the file\n - Don't introduce jarring style changes unless explicitly asked\n\n2. **ENHANCE, DON'T BREAK**\n - Your modifications should improve or extend, not degrade\n - Maintain all existing functionality unless asked to remove it\n - Keep the same code patterns and conventions used in the file\n\n3. **SURGICAL PRECISION**\n - Only change what needs to be changed\n - Don't refactor unrelated parts of the code\n - Preserve imports that are still needed, add new ones as required\n\n4. **QUALITY STANDARD**\n - New elements must match the premium quality of existing code\n - Apply the same level of visual polish to new additions\n - Ensure new interactive elements have proper states (hover, focus, etc.)\n\n5. **STRUCTURAL INTEGRITY**\n - Maintain proper component structure\n - Keep props/state management patterns consistent\n - Ensure the file remains properly typed (if TypeScript)\n\nOUTPUT REQUIREMENTS:\n- Return the COMPLETE modified file (not just the changes)\n- Include ALL original imports plus any new ones needed\n- Maintain the original file structure and export pattern\n- The code must be ready to replace the original file\n- Return ONLY the code, no explanations or markdown fences";
3
- export declare const SNIPPET_FRONTEND_PROMPT = "You are an elite UI/UX Designer generating a code snippet.\n\nYOUR TASK: Generate a focused code snippet that will be INSERTED into an existing file.\n\nSNIPPET PRINCIPLES:\n\n1. **CONTEXTUAL AWARENESS**\n - The snippet will be inserted into an existing codebase\n - Match the style and patterns described in the context\n - Use consistent naming conventions with the project\n\n2. **SELF-CONTAINED BUT INTEGRABLE**\n - The snippet should work when inserted\n - Include only the imports that are NEW (the agent will merge them)\n - Don't include file-level exports unless specifically asked\n\n3. **PREMIUM QUALITY**\n - Even snippets must have premium visual styling\n - Include hover states, transitions, proper spacing\n - Use realistic placeholder content, not Lorem ipsum\n\n4. **CLEAN BOUNDARIES**\n - Clear start and end of the snippet\n - Proper indentation (assume standard 2-space indent)\n - No trailing commas or syntax that would break insertion\n\n5. **FOCUSED SCOPE**\n - Generate exactly what was asked, nothing more\n - Don't add \"nice to have\" features unless requested\n - Keep the snippet as lean as possible while meeting requirements\n\nOUTPUT REQUIREMENTS:\n- Return ONLY the code snippet\n- If new imports are needed, list them at the very top, clearly separated\n- The snippet should be ready to paste/insert\n- Match the tech stack and patterns from context\n- Return ONLY the code, no explanations or markdown fences\n\nFORMAT (if imports needed):\n// NEW IMPORTS NEEDED:\nimport { X } from \"y\";\n\n// SNIPPET:\n<your code here>";
2
+ export declare const MODIFY_FRONTEND_PROMPT = "You are an elite UI/UX Designer making a SINGLE, focused design modification.\n\nYOUR TASK: Apply ONE design modification and return ONLY the changed code.\n\nCRITICAL RULES:\n\n1. **SINGLE MODIFICATION ONLY**\n - You are making exactly ONE design change\n - Do NOT touch or return any code unrelated to this specific change\n - Keep the modification as focused and surgical as possible\n\n2. **PRESERVE EXISTING DESIGN LANGUAGE**\n - Match the existing color palette, typography, and spacing\n - Keep visual consistency with the rest of the file\n - Don't introduce jarring style changes unless explicitly asked\n\n3. **PREMIUM QUALITY**\n - The modified element must have the same polish as the original\n - Include proper hover states, transitions, and visual feedback\n - Ensure the modification enhances the overall design\n\nOUTPUT FORMAT - STRICTLY FOLLOW THIS:\n\n```\n// FIND THIS CODE:\n<exact code to find and replace>\n\n// REPLACE WITH:\n<new redesigned code>\n```\n\nIf new imports are needed, add them at the top:\n```\n// NEW IMPORTS NEEDED:\nimport { X } from \"y\";\n\n// FIND THIS CODE:\n...\n\n// REPLACE WITH:\n...\n```\n\nIMPORTANT:\n- The \"FIND THIS CODE\" must be an EXACT match of existing code (copy-paste precision)\n- Include enough context in \"FIND THIS CODE\" to make it unique in the file\n- Return ONLY what needs to change, nothing else\n- No explanations, no full file, just the find/replace block";
3
+ export declare const SNIPPET_FRONTEND_PROMPT = "You are an elite UI/UX Designer generating a code snippet to INSERT.\n\nYOUR TASK: Generate a focused code snippet that will be INSERTED into an existing file.\n\nSNIPPET PRINCIPLES:\n\n1. **CONTEXTUAL AWARENESS**\n - The snippet will be inserted into an existing codebase\n - Match the style and patterns described in the context\n - Use consistent naming conventions with the project\n\n2. **SELF-CONTAINED BUT INTEGRABLE**\n - The snippet should work when inserted\n - Include only the imports that are NEW (the agent will merge them)\n - Don't include file-level exports unless specifically asked\n\n3. **PREMIUM QUALITY**\n - Even snippets must have premium visual styling\n - Include hover states, transitions, proper spacing\n - Use realistic placeholder content, not Lorem ipsum\n\n4. **CLEAN BOUNDARIES**\n - Clear start and end of the snippet\n - Proper indentation (assume standard 2-space indent)\n - No trailing commas or syntax that would break insertion\n\n5. **FOCUSED SCOPE**\n - Generate exactly what was asked, nothing more\n - Don't add \"nice to have\" features unless requested\n - Keep the snippet as lean as possible while meeting requirements\n\nOUTPUT FORMAT:\n\nIf new imports are needed:\n```\n// NEW IMPORTS NEEDED:\nimport { X } from \"y\";\n\n// SNIPPET:\n<your code here>\n```\n\nIf no new imports needed:\n```\n// SNIPPET:\n<your code here>\n```\n\nReturn ONLY the code, no explanations.";
@@ -53,50 +53,62 @@ OUTPUT REQUIREMENTS:
53
53
  - Return ONLY the code, no explanations or markdown fences`;
54
54
  // =============================================================================
55
55
  // MODIFY_FRONTEND PROMPT
56
- // Used for modifying EXISTING files while preserving design quality
56
+ // Used for making a SINGLE design modification to existing code
57
+ // Returns ONLY the modified portion, not the full file
57
58
  // =============================================================================
58
- export const MODIFY_FRONTEND_PROMPT = `You are an elite UI/UX Designer modifying existing frontend code.
59
+ export const MODIFY_FRONTEND_PROMPT = `You are an elite UI/UX Designer making a SINGLE, focused design modification.
59
60
 
60
- YOUR TASK: Modify the provided code according to the user's request while maintaining design excellence.
61
+ YOUR TASK: Apply ONE design modification and return ONLY the changed code.
61
62
 
62
- MODIFICATION PRINCIPLES:
63
+ CRITICAL RULES:
63
64
 
64
- 1. **PRESERVE EXISTING DESIGN LANGUAGE**
65
- - Maintain the existing color palette, typography, and spacing
66
- - Keep the visual consistency with the rest of the file
65
+ 1. **SINGLE MODIFICATION ONLY**
66
+ - You are making exactly ONE design change
67
+ - Do NOT touch or return any code unrelated to this specific change
68
+ - Keep the modification as focused and surgical as possible
69
+
70
+ 2. **PRESERVE EXISTING DESIGN LANGUAGE**
71
+ - Match the existing color palette, typography, and spacing
72
+ - Keep visual consistency with the rest of the file
67
73
  - Don't introduce jarring style changes unless explicitly asked
68
74
 
69
- 2. **ENHANCE, DON'T BREAK**
70
- - Your modifications should improve or extend, not degrade
71
- - Maintain all existing functionality unless asked to remove it
72
- - Keep the same code patterns and conventions used in the file
75
+ 3. **PREMIUM QUALITY**
76
+ - The modified element must have the same polish as the original
77
+ - Include proper hover states, transitions, and visual feedback
78
+ - Ensure the modification enhances the overall design
73
79
 
74
- 3. **SURGICAL PRECISION**
75
- - Only change what needs to be changed
76
- - Don't refactor unrelated parts of the code
77
- - Preserve imports that are still needed, add new ones as required
80
+ OUTPUT FORMAT - STRICTLY FOLLOW THIS:
78
81
 
79
- 4. **QUALITY STANDARD**
80
- - New elements must match the premium quality of existing code
81
- - Apply the same level of visual polish to new additions
82
- - Ensure new interactive elements have proper states (hover, focus, etc.)
82
+ \`\`\`
83
+ // FIND THIS CODE:
84
+ <exact code to find and replace>
83
85
 
84
- 5. **STRUCTURAL INTEGRITY**
85
- - Maintain proper component structure
86
- - Keep props/state management patterns consistent
87
- - Ensure the file remains properly typed (if TypeScript)
86
+ // REPLACE WITH:
87
+ <new redesigned code>
88
+ \`\`\`
88
89
 
89
- OUTPUT REQUIREMENTS:
90
- - Return the COMPLETE modified file (not just the changes)
91
- - Include ALL original imports plus any new ones needed
92
- - Maintain the original file structure and export pattern
93
- - The code must be ready to replace the original file
94
- - Return ONLY the code, no explanations or markdown fences`;
90
+ If new imports are needed, add them at the top:
91
+ \`\`\`
92
+ // NEW IMPORTS NEEDED:
93
+ import { X } from "y";
94
+
95
+ // FIND THIS CODE:
96
+ ...
97
+
98
+ // REPLACE WITH:
99
+ ...
100
+ \`\`\`
101
+
102
+ IMPORTANT:
103
+ - The "FIND THIS CODE" must be an EXACT match of existing code (copy-paste precision)
104
+ - Include enough context in "FIND THIS CODE" to make it unique in the file
105
+ - Return ONLY what needs to change, nothing else
106
+ - No explanations, no full file, just the find/replace block`;
95
107
  // =============================================================================
96
108
  // SNIPPET_FRONTEND PROMPT
97
109
  // Used for generating code snippets to INSERT into existing files
98
110
  // =============================================================================
99
- export const SNIPPET_FRONTEND_PROMPT = `You are an elite UI/UX Designer generating a code snippet.
111
+ export const SNIPPET_FRONTEND_PROMPT = `You are an elite UI/UX Designer generating a code snippet to INSERT.
100
112
 
101
113
  YOUR TASK: Generate a focused code snippet that will be INSERTED into an existing file.
102
114
 
@@ -127,16 +139,21 @@ SNIPPET PRINCIPLES:
127
139
  - Don't add "nice to have" features unless requested
128
140
  - Keep the snippet as lean as possible while meeting requirements
129
141
 
130
- OUTPUT REQUIREMENTS:
131
- - Return ONLY the code snippet
132
- - If new imports are needed, list them at the very top, clearly separated
133
- - The snippet should be ready to paste/insert
134
- - Match the tech stack and patterns from context
135
- - Return ONLY the code, no explanations or markdown fences
142
+ OUTPUT FORMAT:
136
143
 
137
- FORMAT (if imports needed):
144
+ If new imports are needed:
145
+ \`\`\`
138
146
  // NEW IMPORTS NEEDED:
139
147
  import { X } from "y";
140
148
 
141
149
  // SNIPPET:
142
- <your code here>`;
150
+ <your code here>
151
+ \`\`\`
152
+
153
+ If no new imports needed:
154
+ \`\`\`
155
+ // SNIPPET:
156
+ <your code here>
157
+ \`\`\`
158
+
159
+ Return ONLY the code, no explanations.`;
@@ -1,14 +1,14 @@
1
1
  import { z } from "zod";
2
2
  export declare const modifyFrontendSchema: {
3
- request: z.ZodString;
3
+ modification: z.ZodString;
4
+ targetCode: z.ZodString;
4
5
  filePath: z.ZodString;
5
- existingCode: z.ZodString;
6
6
  context: z.ZodOptional<z.ZodString>;
7
7
  };
8
8
  export declare function modifyFrontend(params: {
9
- request: string;
9
+ modification: string;
10
+ targetCode: string;
10
11
  filePath: string;
11
- existingCode: string;
12
12
  context?: string;
13
13
  }): Promise<{
14
14
  content: {
@@ -2,44 +2,42 @@ import { z } from "zod";
2
2
  import { generateWithGemini } from "../lib/gemini.js";
3
3
  import { MODIFY_FRONTEND_PROMPT } from "../prompts/system.js";
4
4
  export const modifyFrontendSchema = {
5
- request: z.string().describe("What modification to make. Be specific and clear. " +
5
+ modification: z.string().describe("The SINGLE design modification to make. Be specific. " +
6
6
  "Examples: " +
7
- "'Add a delete button with confirmation modal to each card', " +
8
- "'Change the color scheme from blue to purple', " +
9
- "'Add loading and error states to this component', " +
10
- "'Make the sidebar collapsible with animation'"),
7
+ "'Redesign this button to look more premium with gradient and shadow', " +
8
+ "'Redesign the card header with better typography and spacing', " +
9
+ "'Make this sidebar look more modern with glassmorphism effect'"),
10
+ targetCode: z.string().describe("The specific code section to modify (NOT the full file). " +
11
+ "Pass only the relevant component/element that needs redesigning. " +
12
+ "This helps Gemini focus on exactly what to change."),
11
13
  filePath: z.string().describe("The path of the file being modified. " +
12
14
  "Example: 'src/components/Sidebar.tsx'"),
13
- existingCode: z.string().describe("The COMPLETE current content of the file to modify. " +
14
- "Pass the entire file, not just a snippet. " +
15
- "Gemini will return the complete modified file."),
16
- context: z.string().optional().describe("Additional project context if needed for the modification. " +
17
- "Pass related files if the modification needs to match patterns from elsewhere. " +
18
- "Optional - only include if relevant to the modification."),
15
+ context: z.string().optional().describe("Additional context about the file's design system. " +
16
+ "Example: 'Uses Tailwind, dark theme with zinc colors, rounded-xl borders'"),
19
17
  };
20
18
  export async function modifyFrontend(params) {
21
- const { request, filePath, existingCode, context } = params;
19
+ const { modification, targetCode, filePath, context } = params;
22
20
  // Build context instructions
23
21
  let contextInstructions = '';
24
22
  if (context) {
25
23
  contextInstructions = `
26
- ADDITIONAL PROJECT CONTEXT (for reference):
24
+ DESIGN CONTEXT:
27
25
  ${context}
28
26
  `;
29
27
  }
30
28
  const systemPrompt = `${MODIFY_FRONTEND_PROMPT}
31
29
  ${contextInstructions}
32
- FILE BEING MODIFIED: ${filePath}
30
+ FILE: ${filePath}
33
31
 
34
- EXISTING CODE TO MODIFY:
32
+ CODE TO MODIFY:
35
33
  \`\`\`
36
- ${existingCode}
34
+ ${targetCode}
37
35
  \`\`\`
38
36
 
39
- MODIFICATION REQUESTED: ${request}
37
+ MODIFICATION REQUESTED: ${modification}
40
38
 
41
- Remember: Return the COMPLETE modified file, ready to replace the original.`.trim();
42
- const result = await generateWithGemini(systemPrompt, request);
39
+ Remember: Return ONLY the find/replace block. ONE modification, surgical precision.`.trim();
40
+ const result = await generateWithGemini(systemPrompt, modification);
43
41
  return {
44
42
  content: [{ type: "text", text: result }],
45
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemini-design-mcp",
3
- "version": "3.0.1",
3
+ "version": "3.2.0",
4
4
  "description": "MCP server that uses Gemini 3 Pro for frontend/design code generation",
5
5
  "main": "build/index.js",
6
6
  "bin": {