gemini-design-mcp 3.6.9 → 3.6.11

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
@@ -59,9 +59,7 @@ Present options to user, they select one, then pass it here via designSystem.vib
59
59
  📤 OUTPUT
60
60
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
61
61
 
62
- Returns a COMPLETE file ready to save.
63
-
64
- 💡 TIP: Use writeFile: true to write directly to disk (faster, lighter context).`, createFrontendSchema, createFrontend);
62
+ Returns a confirmation message after writing to disk (lightweight context).`, createFrontendSchema, createFrontend);
65
63
  // =============================================================================
66
64
  // TOOL 2: MODIFY_FRONTEND
67
65
  // =============================================================================
@@ -114,7 +112,7 @@ import { X } from "y";
114
112
  // REPLACE WITH:
115
113
  <new redesigned code>
116
114
 
117
- 💡 TIP: Use writeFile: true to apply the modification directly to disk.`, modifyFrontendSchema, modifyFrontend);
115
+ The modification is applied directly to disk by default.`, modifyFrontendSchema, modifyFrontend);
118
116
  // =============================================================================
119
117
  // TOOL 3: SNIPPET_FRONTEND
120
118
  // =============================================================================
@@ -238,10 +236,9 @@ import { Search } from "lucide-react";
238
236
 
239
237
  You (Claude) are responsible for:
240
238
  - Adding the logic (useState, handlers) BEFORE calling this tool
241
- - Merging new imports
242
- - Inserting the snippet at the correct location
239
+ - Providing insertAtLine or insertAfterPattern for direct insertion
243
240
 
244
- 💡 TIP: Use writeFile: true + insertAtLine or insertAfterPattern to insert directly.`, snippetFrontendSchema, snippetFrontend);
241
+ The snippet is inserted directly to disk by default (requires insertAtLine OR insertAfterPattern).`, snippetFrontendSchema, snippetFrontend);
245
242
  // =============================================================================
246
243
  // TOOL 4: GENERATE_VIBES
247
244
  // =============================================================================
@@ -1,3 +1,3 @@
1
1
  export type ThinkingMode = "minimal" | "low" | "medium" | "high";
2
2
  export declare const DEFAULT_MODEL = "gemini-3-flash-preview";
3
- export declare function generateWithGemini(systemPrompt: string, userPrompt: string, model?: string, thinkingMode?: ThinkingMode): Promise<string>;
3
+ export declare function generateWithGemini(systemPrompt: string, userPrompt: string, model?: string, thinkingMode?: ThinkingMode, endpoint?: string): Promise<string>;
@@ -15,7 +15,7 @@ function getApiKey() {
15
15
  }
16
16
  return apiKey;
17
17
  }
18
- export async function generateWithGemini(systemPrompt, userPrompt, model = DEFAULT_MODEL, thinkingMode = "minimal") {
18
+ export async function generateWithGemini(systemPrompt, userPrompt, model = DEFAULT_MODEL, thinkingMode = "minimal", endpoint = "generate") {
19
19
  const apiKey = getApiKey();
20
20
  try {
21
21
  const response = await fetch(PROXY_URL, {
@@ -26,6 +26,7 @@ export async function generateWithGemini(systemPrompt, userPrompt, model = DEFAU
26
26
  },
27
27
  body: JSON.stringify({
28
28
  model,
29
+ endpoint,
29
30
  contents: [
30
31
  {
31
32
  role: "user",
@@ -37,7 +37,7 @@ export declare const createFrontendSchema: {
37
37
  keywords: string[];
38
38
  };
39
39
  }>>;
40
- writeFile: z.ZodOptional<z.ZodBoolean>;
40
+ writeFile: z.ZodDefault<z.ZodBoolean>;
41
41
  };
42
42
  export declare function createFrontend(params: {
43
43
  request: string;
@@ -24,8 +24,9 @@ export const createFrontendSchema = {
24
24
  }).describe("The selected design vibe"),
25
25
  }).optional().describe("Design system with selected vibe. REQUIRED for new projects without existing design. " +
26
26
  "Call generate_vibes first, user selects, then pass the selection here."),
27
- writeFile: z.boolean().optional().describe("If true, write the file directly to disk instead of returning the code. " +
28
- "Returns a confirmation message instead of the full code, keeping context lightweight."),
27
+ writeFile: z.boolean().default(true).describe("Write the file directly to disk instead of returning the code. " +
28
+ "Returns a confirmation message instead of the full code, keeping context lightweight. " +
29
+ "Defaults to true."),
29
30
  };
30
31
  export async function createFrontend(params) {
31
32
  const { request, filePath, techStack, context, designSystem, writeFile } = params;
@@ -70,7 +71,7 @@ TECH STACK: ${techStack}
70
71
  FILE PATH: ${filePath}
71
72
 
72
73
  Remember: Return a COMPLETE file ready to save at ${filePath}`.trim();
73
- const rawResult = await generateWithGemini(systemPrompt, request, undefined, "high");
74
+ const rawResult = await generateWithGemini(systemPrompt, request, undefined, "high", "create_frontend");
74
75
  // Strip markdown code fences from the result
75
76
  const result = stripCodeFences(rawResult);
76
77
  // Write file directly if requested
@@ -46,8 +46,8 @@ export async function generateVibes(params) {
46
46
  }
47
47
  const userPrompt = contextParts.join("\n");
48
48
  const result = await generateWithGemini(GENERATE_VIBES_PROMPT, userPrompt, undefined, // default model
49
- "high" // high thinking for creative vibes
50
- );
49
+ "high", // high thinking for creative vibes
50
+ "generate_vibes");
51
51
  // Parse the JSON response
52
52
  try {
53
53
  // Clean the response (remove potential markdown code blocks)
@@ -6,7 +6,7 @@ export declare const modifyFrontendSchema: {
6
6
  filePath: z.ZodString;
7
7
  context: z.ZodOptional<z.ZodString>;
8
8
  scale: z.ZodOptional<z.ZodEnum<["refined", "balanced", "zoomed"]>>;
9
- writeFile: z.ZodOptional<z.ZodBoolean>;
9
+ writeFile: z.ZodDefault<z.ZodBoolean>;
10
10
  };
11
11
  export declare function modifyFrontend(params: {
12
12
  modification: string;
@@ -20,9 +20,10 @@ export const modifyFrontendSchema = {
20
20
  "Example: 'Project uses: var(--font-heading), var(--bg-primary), .section-padding class'"),
21
21
  scale: scaleSchema.optional().describe("Element sizing: 'refined' (small, elegant), 'balanced' (standard), 'zoomed' (large). " +
22
22
  "Controls button sizes, typography, spacing, icons."),
23
- writeFile: z.boolean().optional().describe("If true, apply the modification directly to the file on disk. " +
23
+ writeFile: z.boolean().default(true).describe("Apply the modification directly to the file on disk. " +
24
24
  "Reads the file, applies find/replace, and writes back. " +
25
- "Returns a confirmation instead of the find/replace instructions."),
25
+ "Returns a confirmation instead of the find/replace instructions. " +
26
+ "Defaults to true."),
26
27
  };
27
28
  export async function modifyFrontend(params) {
28
29
  const { modification, targetCode, filePath, context, scale, writeFile } = params;
@@ -49,7 +50,7 @@ ${targetCode}
49
50
  MODIFICATION REQUESTED: ${modification}
50
51
 
51
52
  Remember: Return ONLY the find/replace block. ONE modification, surgical precision.`.trim();
52
- const result = await generateWithGemini(systemPrompt, modification, undefined, "minimal");
53
+ const result = await generateWithGemini(systemPrompt, modification, undefined, "minimal", "modify_frontend");
53
54
  // Apply modification directly if requested
54
55
  if (writeFile) {
55
56
  const fileContent = readFileIfExists(filePath);
@@ -7,7 +7,7 @@ export declare const snippetFrontendSchema: {
7
7
  insertionContext: z.ZodString;
8
8
  context: z.ZodOptional<z.ZodString>;
9
9
  scale: z.ZodOptional<z.ZodEnum<["refined", "balanced", "zoomed"]>>;
10
- writeFile: z.ZodOptional<z.ZodBoolean>;
10
+ writeFile: z.ZodDefault<z.ZodBoolean>;
11
11
  insertAtLine: z.ZodOptional<z.ZodNumber>;
12
12
  insertAfterPattern: z.ZodOptional<z.ZodString>;
13
13
  };
@@ -23,8 +23,9 @@ export const snippetFrontendSchema = {
23
23
  "Without this, Gemini will create standalone styles that won't match your design system."),
24
24
  scale: scaleSchema.optional().describe("Element sizing: 'refined' (small, elegant), 'balanced' (standard), 'zoomed' (large). " +
25
25
  "Controls button sizes, typography, spacing, icons."),
26
- writeFile: z.boolean().optional().describe("If true, insert the snippet directly into the file on disk. " +
27
- "Requires insertAtLine OR insertAfterPattern to know where to insert."),
26
+ writeFile: z.boolean().default(true).describe("Insert the snippet directly into the file on disk. " +
27
+ "Requires insertAtLine OR insertAfterPattern to know where to insert. " +
28
+ "Defaults to true."),
28
29
  insertAtLine: z.number().optional().describe("Line number (1-indexed) where to insert the snippet. " +
29
30
  "The snippet will be inserted AFTER this line. " +
30
31
  "Required if writeFile is true and insertAfterPattern is not provided."),
@@ -54,7 +55,7 @@ INSERTION CONTEXT:
54
55
  ${insertionContext}
55
56
 
56
57
  Generate a snippet that will integrate smoothly at this location.`.trim();
57
- const result = await generateWithGemini(systemPrompt, request, undefined, "minimal");
58
+ const result = await generateWithGemini(systemPrompt, request, undefined, "minimal", "snippet_frontend");
58
59
  // Insert snippet directly if requested
59
60
  if (writeFile) {
60
61
  if (!lineNumber && !pattern) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemini-design-mcp",
3
- "version": "3.6.9",
3
+ "version": "3.6.11",
4
4
  "description": "MCP server that uses Gemini 3 Pro for frontend/design code generation",
5
5
  "main": "build/index.js",
6
6
  "bin": {