Frontend Test Generation & Code Review MCP Server
fe-testgen-mcp
Servicio de generación de pruebas unitarias de frontend basado en el protocolo MCP, enfocado en capacidades de análisis e IA para la generación de código. Expone herramientas MCP a través de HTTP Streaming, integrables con clientes como n8n, Cursor y Claude.
Capacidades principales
Análisis de matriz de pruebas: Analiza cambios en el código, genera listas de funciones y escenarios de prueba
Generación de código de prueba: Genera código de prueba unitaria completo basado en la matriz
Soporte multi-framework: Soporta Vitest y Jest
Cobertura multiescenario: happy-path, edge-case, error-path, state-change
Related MCP server: Phabricator MCP Server
Inicio rápido
# 安装依赖
pnpm install
# 构建
pnpm build
# 启动服务
pnpm startEl servicio escucha por defecto en http://localhost:3000/mcp
Configuración del entorno
Copie env.example a .env y rellene la configuración necesaria:
# 必需:OpenAI API 密钥
OPENAI_API_KEY=your_api_key
# 可选:自定义模型
OPENAI_MODEL=gpt-4
# 可选:服务配置
HTTP_PORT=3000
HTTP_HOST=0.0.0.0 # 允许外部访问Herramientas MCP
analyze-test-matrix
Analiza los cambios en el código y genera una matriz de pruebas.
Parámetros:
Parámetro | Tipo | Requerido | Descripción |
rawDiff | string | ✅ | Texto en formato Unified diff |
identifier | string | Identificador único (MR ID, commit hash) | |
rules | string | Contenido de test-strategy.md | |
framework | string | Framework de pruebas (vitest/jest) |
Retorno: Lista de funciones, escenarios de prueba, estadísticas
generate-tests
Genera código de pruebas unitarias.
Parámetros:
Parámetro | Tipo | Requerido | Descripción |
rawDiff | string | ✅ | Texto en formato Unified diff |
identifier | string | Identificador único | |
rules | string | Contenido de test-strategy.md | |
framework | string | Framework de pruebas | |
scenarios | string[] | Tipos de escenarios especificados | |
maxTests | number | Cantidad máxima de pruebas |
Retorno: Array de casos de prueba (incluye ruta de archivo, código, tipo de escenario)
Integración con n8n
Ejemplo de flujo de trabajo
GitLab/Phabricator Webhook
│
▼
读取 diff + rules 文件
│
▼
调用 MCP generate-tests
│
▼
写入测试文件 + 创建 MR
│
▼
发送通知(企微/飞书)Ejemplo de llamada HTTP
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "generate-tests",
"arguments": {
"rawDiff": "diff --git a/src/utils.ts ...",
"framework": "vitest"
}
}
}'Formato del archivo rules
Cree .cursor/rules/test-strategy.md en el proyecto:
# 测试生成规则
## 测试框架配置
- **测试框架**:vitest
- **测试文件模式**:**/*.{test,spec}.{ts,tsx}
## Mock 策略
- 使用 vi.fn() 进行函数 mock
- HTTP 请求优先 mock fetch/axiosn8n lee el contenido de este archivo y lo pasa como parámetro rules al MCP.
Despliegue con Docker
docker build -t fe-testgen-mcp .
docker run -d -p 3000:3000 \
-e OPENAI_API_KEY=xxx \
fe-testgen-mcpPreguntas frecuentes
P: ¿Cómo mejorar la consistencia de los resultados generados?
R: El servicio utiliza por defecto temperature=0 y un seed=42 fijo, además de habilitar la caché de respuestas.
P: ¿Cómo especificar el framework de pruebas?
R: Prioridad: parámetro framework > análisis en rules > vitest por defecto
P: ¿Qué versión de Node.js se requiere?
R: Node.js 18+ (se recomienda 20+)
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseDqualityDmaintenanceProvides tools for frontend testing including code analysis, test generation, test execution, and React component testing for Jest and Cypress frameworks.426MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Phabricator for task management and code review workflows, including viewing and commenting on tasks, managing differential revisions, and providing intelligent review analysis with code context.7MIT
- AlicenseNot gradedqualityDmaintenanceAnalyzes React component changes by performing structural analysis and generating visual diffs to identify pixel-level differences. It integrates with Figma to validate implementation compliance against design specifications and automates component reviews across git branches.MIT
- FlicenseAqualityDmaintenanceProvides AI assistants with frontend development tools including component scaffolding, bundle analysis, accessibility checks, and responsive design guidance. Enables automated generation of React components with tests and stories, bundle optimization recommendations, and WCAG compliance fixes.6
Related MCP Connectors
Risk-scan a diff, flag AI-generated-code tells, find secrets. 5 of 7 tools need no account.
AI QA that runs your app in a browser on every pull request: projects, test targets, test cases.
Agentic code review, no signup to try: reality gates + frontier-model review, with veto.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/NorthSeacoder/fe-testgen-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server