viewgate-mcp 1.0.58 → 1.0.59

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.
Files changed (2) hide show
  1. package/dist/index.js +24 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -238,9 +238,11 @@ function createMcpServer(apiKey, personalKey) {
238
238
  inputSchema: {
239
239
  type: "object",
240
240
  properties: {
241
- limit: { type: "number", description: "How many pending components to generate.", default: 1 },
242
- framework: { type: "string", description: "Target: react or react+vite (both output React components).", default: "react" },
241
+ limit: { type: "number", description: "How many pending components to generate." },
242
+ framework: { type: "string", description: "Target: react or react+vite (both output React components)." },
243
+ styleHandler: { type: "string", description: "Override project styling tech (css, tailwind, sass, css-modules, css-in-js, bootstrap, mui)." }
243
244
  },
245
+ required: []
244
246
  },
245
247
  },
246
248
  {
@@ -403,7 +405,8 @@ function createMcpServer(apiKey, personalKey) {
403
405
  const args = argsAny;
404
406
  const limit = Math.min(args.limit || 1, 10);
405
407
  // Fetch project styleHandler from config
406
- let styleHandler = 'css';
408
+ let styleHandler = args.styleHandler || 'css';
409
+ let isOverridden = !!args.styleHandler;
407
410
  try {
408
411
  const configRes = await fetch(`${BACKEND_URL}/api/mcp/config`, {
409
412
  headers: {
@@ -414,11 +417,18 @@ function createMcpServer(apiKey, personalKey) {
414
417
  });
415
418
  if (configRes.ok) {
416
419
  const configData = (await configRes.json());
417
- styleHandler = configData?.settings?.styleHandler || 'css';
420
+ const projectStyle = configData?.settings?.styleHandler;
421
+ if (!isOverridden && projectStyle) {
422
+ styleHandler = projectStyle;
423
+ }
424
+ console.error(`[MCP] Style handler identified: ${styleHandler} (Project: ${configData?.settings?.projectName || 'unknown'}, Overridden: ${isOverridden})`);
425
+ }
426
+ else {
427
+ console.error(`[MCP] Could not fetch project config, status: ${configRes.status}. Defaulting to: ${styleHandler}`);
418
428
  }
419
429
  }
420
430
  catch (e) {
421
- console.error('[MCP] Could not fetch project config for styleHandler:', e);
431
+ console.error('[MCP] Exception fetching project config:', e.message);
422
432
  }
423
433
  const styleHandlerLabels = {
424
434
  'css': 'Plain CSS (vanilla, no framework dependencies)',
@@ -529,7 +539,15 @@ function createMcpServer(apiKey, personalKey) {
529
539
  ok: true,
530
540
  generated: 0,
531
541
  styleHandler,
532
- instruction: `IMPORTANTE: Esta tool te entrega las especificaciones. TÚ (EL LLM) DEBES: 1) Escribir el archivo físico del componente en el workspace local del proyecto (ej: src/components/[Name].jsx) usando tus tools de escritura/multi_replace. 2) Registrar la preview usando 'mark_ui_component_generated'. OBLIGATORIO: usar ${styleLabel} para los estilos. DEBES respetar estrictamente las themingTokens: NUNCA uses colores hardcodeados (#HEX o rgba), debes usar SIEMPRE la prop theme o su fallback var(--vg-*). No uses cssContent directamente si styleHandler indica otra tecnología.`,
542
+ isOverridden,
543
+ instruction: `IMPORTANTE: Esta tool te entrega las especificaciones para generar componentes de producción.
544
+ TÚ (EL LLM) DEBES:
545
+ 1) ESCRIBIR EL ARCHIVO FÍSICO en el workspace local (ej: 'src/components/[Name].jsx') usando 'write_to_file' o 'multi_replace'.
546
+ 2) REGISTRAR LA PREVIEW usando 'mark_ui_component_generated'.
547
+
548
+ REQUISITO TECNOLÓGICO OBLIGATORIO: Usar ${styleLabel} para TODOS los estilos.
549
+ REQUISITO DE THEMING: DEBES respetar las themingTokens. NUNCA hardcodees colores (#hex, etc). Usa SIEMPRE la prop 'theme' o el fallback 'var(--vg-*)'.
550
+ NOTA: Si styleHandler es '${styleHandler}', NO utilices otra tecnología distinta aunque los archivos originales (Figma HTML/CSS) digan lo contrario.`,
533
551
  results
534
552
  }, null, 2)
535
553
  }]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viewgate-mcp",
3
- "version": "1.0.58",
3
+ "version": "1.0.59",
4
4
  "main": "dist/index.js",
5
5
  "bin": {
6
6
  "viewgate-mcp": "./dist/index.js"