Skip to main content
Glama
MCP Frontend Tools Server

MCP Frontend Tools Server

by ashios15

mcp-frontend-tools

El servidor de referencia del Model Context Protocol para trabajo frontend. Una instalación le da a cualquier agente de programación — Claude Desktop, Cursor, VS Code, Zed, Continue — ojos y manos reales sobre tu interfaz:

  • axe_audit — ejecuta el motor de reglas real axe-core contra HTML sin procesar (vía jsdom) o una URL en vivo (vía Playwright). Devuelve violaciones agrupadas por impacto WCAG con enlaces de corrección.

  • page_screenshot — PNGs de Chromium headless de cualquier URL o selector CSS, con controles de viewport / DPR / esquema de color / waitForSelector.

  • bundle_budget_check — recorre un directorio dist/, calcula tamaños gzip (+ brotli opcional), aplica un presupuesto en KB global o por entrada. JSON de aprobado/fallo listo para CI.

  • design_token_diff — diferencia estructural de dos archivos de tokens W3C DTCG / Style Dictionary. Informa de tokens añadidos / eliminados / cambiados con notas que reconocen $type.

  • storybook_story_run — carga una historia individual de Storybook en Chromium headless vía iframe.html?id=…, toma una captura de pantalla y ejecuta una auditoría axe solo sobre el componente renderizado.

  • scaffold_react_component — emite un componente React tipado (funcional / forwardRef / as polimórfico) además de pruebas Vitest e historias de Storybook opcionales.

Todas las herramientas devuelven JSON estructurado sobre el que el modelo puede razonar. Sin envoltorios personalizados por editor.


Instalación

npm i -g @ashios15/mcp-frontend-tools
# Optional — enables page_screenshot, storybook_story_run, and URL-mode axe_audit
npm i -g playwright
npx playwright install chromium

Se requiere Node ≥ 20. Sin Playwright, el servidor aún se inicia; esas tres herramientas devolverán un error claro de "instalar playwright" si se llaman.

Claude Desktop

Añadir a ~/Library/Application Support/Claude/claude_desktop_config.json (o el equivalente en Windows):

{
  "mcpServers": {
    "frontend-tools": {
      "command": "mcp-frontend-tools"
    }
  }
}

Cursor

Settings → MCP → Add new server:

{
  "frontend-tools": { "command": "mcp-frontend-tools" }
}

VS Code (modo agente de GitHub Copilot)

Añadir a .vscode/mcp.json:

{
  "servers": {
    "frontend-tools": { "command": "mcp-frontend-tools" }
  }
}

MCP Inspector

npx @modelcontextprotocol/inspector mcp-frontend-tools

Related MCP server: Components Build MCP

Referencia de herramientas

axe_audit

{
  url?: string;        // require playwright
  html?: string;       // jsdom
  tags?: string[];     // default: wcag2a/aa + wcag21aa + wcag22aa + best-practice
  selector?: string;   // URL mode only
  timeoutMs?: number;  // default 15000
}

Devuelve violaciones y reglas incompletas con impact, help, helpUrl y hasta 5 nodos de ejemplo fallidos por regla.

page_screenshot

{
  url: string;
  outPath: string;           // absolute; parent dirs auto-created
  selector?: string;
  fullPage?: boolean;
  width?: number;            // default 1280
  height?: number;           // default 800
  deviceScaleFactor?: number;// default 2
  colorScheme?: "light" | "dark" | "no-preference";
  waitForSelector?: string;
  timeoutMs?: number;
}

bundle_budget_check

{
  buildDir: string;
  budgetKb?: number;                       // default 250 (gzipped)
  perEntryBudgetKb?: Record<string, number>;// key = path substring, longest match wins
  ext?: string[];                          // default [".js",".mjs",".cjs",".css"]
  includeBrotli?: boolean;
}

Devuelve cada archivo con tamaños raw / gzip / brotli, su presupuesto aplicado y status: "pass" | "fail".

design_token_diff

{
  beforePath: string;
  afterPath: string;
  ignoreKeys?: string[];
}

Entiende la forma W3C DTCG ($value, $type). Las claves de metadatos de grupo que comienzan con $ se ignoran. Los cambios de color / dimensión obtienen notes anotadas.

storybook_story_run

{
  storybookUrl: string;      // e.g. http://localhost:6006
  storyId: string;           // e.g. components-button--primary
  screenshotPath?: string;
  runAxe?: boolean;          // default true
  viewport?: { width: number; height: number };
  colorScheme?: "light" | "dark" | "no-preference";
  timeoutMs?: number;
}

Carga ${storybookUrl}/iframe.html?viewMode=story&id=${storyId}, espera a #storybook-root e informa de cualquier error de página + violaciones de axe limitadas a la historia.

scaffold_react_component

{
  name: string;           // PascalCase
  outDir: string;         // absolute
  variant?: "functional" | "forwardRef" | "polymorphic";
  withTests?: boolean;    // default true
  withStory?: boolean;    // default true
  props?: Array<{ name: string; type: string; required?: boolean; defaultValue?: string }>;
}

¿Por qué esto en lugar de scripts ad-hoc?

  • Los agentes obtienen contratos tipados. Cada herramienta es un JSON Schema validado por Zod que el modelo puede inspeccionar.

  • Sin alucinaciones locales. Las violaciones de Axe provienen del motor real axe-core, no de una expresión regular. Los tamaños de paquete provienen de la compresión real zlib, no de estimaciones.

  • Componible. Fallo en bundle_budget_check → pide al agente que lleve el archivo más grande a page_screenshot → alimenta la imagen en un paso de regresión visual. Todo a través de MCP.

  • Superficie estable. Las herramientas cambian detrás de un aumento de versión; tu .vscode/mcp.json no.

Desarrollo

git clone https://github.com/ashios15/mcp-frontend-tools.git
cd mcp-frontend-tools
npm install
npm run test       # 3 unit tests (bundle + tokens + scaffold)
npm run build
npm run inspector  # opens MCP Inspector against the built server
node scripts/smoke.mjs  # quick stdio tools/list check

Licencia

MIT © ashios15

mcp-frontend-tools

El servidor de referencia del Model Context Protocol para trabajo frontend. Una instalación le da a cualquier agente de programación — Claude Desktop, Cursor, VS Code, Zed, Continue — ojos y manos reales sobre tu interfaz:

  • axe_audit — ejecuta el motor de reglas real axe-core contra HTML sin procesar (vía jsdom) o una URL en vivo (vía Playwright). Devuelve violaciones agrupadas por impacto WCAG con enlaces de corrección.

  • page_screenshot — PNGs de Chromium headless de cualquier URL o selector CSS, con controles de viewport / DPR / esquema de color / waitForSelector.

  • bundle_budget_check — recorre un directorio dist/, calcula tamaños gzip (+ brotli opcional), aplica un presupuesto en KB global o por entrada. JSON de aprobado/fallo listo para CI.

  • design_token_diff — diferencia estructural de dos archivos de tokens W3C DTCG / Style Dictionary. Informa de tokens añadidos / eliminados / cambiados con notas que reconocen $type.

  • storybook_story_run — carga una historia individual de Storybook en Chromium headless vía iframe.html?id=…, toma una captura de pantalla y ejecuta una auditoría axe solo sobre el componente renderizado.

  • scaffold_react_component — emite un componente React tipado (funcional / forwardRef / as polimórfico) además de pruebas Vitest e historias de Storybook opcionales.

Todas las herramientas devuelven JSON estructurado sobre el que el modelo puede razonar. Sin envoltorios personalizados por editor.


Instalación

npm i -g @ashishjoshi/mcp-frontend-tools
# Optional — enables page_screenshot, storybook_story_run, and URL-mode axe_audit
npm i -g playwright
npx playwright install chromium

Se requiere Node ≥ 20. Sin Playwright, el servidor aún se inicia; esas tres herramientas devolverán un error claro de "instalar playwright" si se llaman.

Claude Desktop

Añadir a ~/Library/Application Support/Claude/claude_desktop_config.json (o el equivalente en Windows):

{
  "mcpServers": {
    "frontend-tools": {
      "command": "mcp-frontend-tools"
    }
  }
}

Cursor

Settings → MCP → Add new server:

{
  "frontend-tools": { "command": "mcp-frontend-tools" }
}

VS Code (modo agente de GitHub Copilot)

Añadir a .vscode/mcp.json:

{
  "servers": {
    "frontend-tools": { "command": "mcp-frontend-tools" }
  }
}

MCP Inspector

npx @modelcontextprotocol/inspector mcp-frontend-tools

Referencia de herramientas

axe_audit

{
  url?: string;        // require playwright
  html?: string;       // jsdom
  tags?: string[];     // default: wcag2a/aa + wcag21aa + wcag22aa + best-practice
  selector?: string;   // URL mode only
  timeoutMs?: number;  // default 15000
}

Devuelve violaciones y reglas incompletas con impact, help, helpUrl y hasta 5 nodos de ejemplo fallidos por regla.

page_screenshot

{
  url: string;
  outPath: string;           // absolute; parent dirs auto-created
  selector?: string;
  fullPage?: boolean;
  width?: number;            // default 1280
  height?: number;           // default 800
  deviceScaleFactor?: number;// default 2
  colorScheme?: "light" | "dark" | "no-preference";
  waitForSelector?: string;
  timeoutMs?: number;
}

bundle_budget_check

{
  buildDir: string;
  budgetKb?: number;                       // default 250 (gzipped)
  perEntryBudgetKb?: Record<string, number>;// key = path substring, longest match wins
  ext?: string[];                          // default [".js",".mjs",".cjs",".css"]
  includeBrotli?: boolean;
}

Devuelve cada archivo con tamaños raw / gzip / brotli, su presupuesto aplicado y status: "pass" | "fail".

design_token_diff

{
  beforePath: string;
  afterPath: string;
  ignoreKeys?: string[];
}

Entiende la forma W3C DTCG ($value, $type). Las claves de metadatos de grupo que comienzan con $ se ignoran. Los cambios de color / dimensión obtienen notes anotadas.

storybook_story_run

{
  storybookUrl: string;      // e.g. http://localhost:6006
  storyId: string;           // e.g. components-button--primary
  screenshotPath?: string;
  runAxe?: boolean;          // default true
  viewport?: { width: number; height: number };
  colorScheme?: "light" | "dark" | "no-preference";
  timeoutMs?: number;
}

Carga ${storybookUrl}/iframe.html?viewMode=story&id=${storyId}, espera a #storybook-root e informa de cualquier error de página + violaciones de axe limitadas a la historia.

scaffold_react_component

{
  name: string;           // PascalCase
  outDir: string;         // absolute
  variant?: "functional" | "forwardRef" | "polymorphic";
  withTests?: boolean;    // default true
  withStory?: boolean;    // default true
  props?: Array<{ name: string; type: string; required?: boolean; defaultValue?: string }>;
}

¿Por qué esto en lugar de scripts ad-hoc?

  • Los agentes obtienen contratos tipados. Cada herramienta es un JSON-Schema validado por Zod que el modelo puede inspeccionar.

  • Sin alucinaciones locales. Las violaciones de Axe provienen del motor real axe-core, no de una expresión regular. Los tamaños de paquete provienen de la compresión real zlib, no de estimaciones.

  • Componible. Fallo en bundle_budget_check → pide al agente que lleve el archivo más grande a page_screenshot → alimenta la imagen en un paso de regresión visual. Todo a través de MCP.

  • Superficie estable. Las herramientas cambian detrás de un aumento de versión; tu .vscode/mcp.json no.

Desarrollo

npm install
npm run test       # 3 unit tests (bundle + tokens + scaffold)
npm run build
npm run inspector  # opens MCP Inspector against the built server
node scripts/smoke.mjs  # quick stdio tools/list check

Licencia

MIT © Ashish Joshi

Servidor de herramientas de frontend para MCP

Un servidor de Model Context Protocol (MCP) que da a los asistentes de IA (Claude, Copilot, Cursor) acceso a herramientas de desarrollo frontend — creación de componentes, análisis de paquetes, comprobaciones de accesibilidad y guías de diseño responsivo.

MCP TypeScript Node.js

Herramientas disponibles

Herramienta

Descripción

scaffold_react_component

Genera un componente React tipado con pruebas, historias y módulo CSS

analyze_bundle

Escanea un directorio de compilación en busca de JS/CSS sobredimensionado, informa de los hallazgos

check_accessibility

Comprobaciones estáticas WCAG 2.2 en HTML con sugerencias de corrección

responsive_breakpoint_guide

Genera patrones de CSS responsivo, consultas de contenedor y Tailwind

Configuración

Claude Desktop

Añadir a ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "frontend-tools": {
      "command": "node",
      "args": ["/path/to/mcp-frontend-tools/dist/index.js"]
    }
  }
}

VS Code con Copilot

Añadir a .vscode/settings.json:

{
  "github.copilot.chat.mcpServers": {
    "frontend-tools": {
      "command": "node",
      "args": ["${workspaceFolder}/mcp-frontend-tools/dist/index.js"]
    }
  }
}

Ejemplo de uso (en chat de IA)

"Crea un componente UserProfileCard con props de avatar, nombre y biografía"

La IA llama a scaffold_react_component y obtiene:

  • UserProfileCard.tsx — Componente tipado con forwardRef

  • UserProfileCard.test.tsx — Pruebas con Testing Library

  • UserProfileCard.stories.tsx — Historia de Storybook

  • UserProfileCard.module.css — Módulo CSS

  • index.ts — Exportación de barril

"Analiza mi carpeta dist/ en busca de problemas de tamaño de paquete"

La IA llama a analyze_bundle y devuelve un informe en markdown con archivos sobredimensionados, recomendaciones y una tabla resumen.

Arquitectura

src/
├── index.ts                  # MCP server setup (stdio transport)
└── tools/
    ├── index.ts              # Tool definitions + router
    ├── scaffold-component.ts # React component generator
    ├── bundle-analyzer.ts    # Build output analyzer
    ├── a11y-checker.ts       # Static WCAG checks
    └── responsive-guide.ts   # Responsive CSS pattern generator

Desarrollo

npm install
npm run build
npm run inspector   # Test with MCP Inspector

Licencia

MIT

Available Tools

6 tools
axe_auditaxe-core Accessibility AuditA

Run the axe-core accessibility ruleset against an HTML string (jsdom) or a live URL (Playwright). Returns violations grouped by impact with fix guidance and helpUrl links.

Inputs: url, html, tags, selector, +1 more.

bundle_budget_checkBundle Budget CheckA

Walk a build directory, measure raw + gzip (+ optional brotli) sizes per file, and flag files that exceed a global or per-entry KB budget. CI-friendly JSON output.

Inputs: buildDir (required), budgetKb, perEntryBudgetKb, ext, +1 more.

design_token_diffDesign Token DiffA

Diff two design-token JSON files (W3C DTCG / Style Dictionary style). Reports added, removed, and changed tokens with $type-aware classification. Useful for PR review of design-system changes.

Inputs: beforePath (required), afterPath (required), ignoreKeys.

page_screenshotPage Screenshot (Playwright)A

Launch headless Chromium, navigate to a URL, and save a PNG screenshot. Supports element selectors, full-page capture, dark mode, and custom viewports. Requires the optional playwright peer dependency.

Inputs: url (required), outPath (required), selector, fullPage, +6 more.

scaffold_react_componentScaffold React ComponentB

Write a TypeScript React component, optional test, and optional Storybook story into outDir. Supports functional, forwardRef, and polymorphic (as prop) variants.

Inputs: name (required), outDir (required), variant, withTests, +2 more.

storybook_story_runStorybook Story RunA

Load a single Storybook story in headless Chromium via iframe.html, optionally screenshot it, and run an axe-core audit against the rendered output. Requires playwright.

Inputs: storybookUrl (required), storyId (required), screenshotPath, runAxe, +3 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a distinct frontend concern: accessibility auditing, bundle sizing, design token diffs, page screenshots, component scaffolding, and Storybook testing. No two tools could be confused.

    Naming Consistency5/5

    All tool names follow a consistent 'object_action' or 'domain_action' pattern with lowercase underscores (e.g., axe_audit, design_token_diff). No mixing of conventions.

    Tool Count5/5

    Six tools is an appropriate size for a frontend utility toolkit. Each tool provides a distinct, useful function without being overwhelming or too sparse.

    Completeness4/5

    The set covers key frontend tasks: accessibility, performance, design tokens, component generation, and testing. A minor gap is the lack of a linting or formatting tool, but the surface is coherent for its scope.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers