Skip to main content
Glama
NorthSeacoder

Frontend Test Generation & Code Review MCP Server

fe-testgen-mcp

Frontend unit test generation service based on the MCP protocol, focusing on AI analysis and code generation capabilities. Exposes MCP tools via HTTP Streaming for integration with clients like n8n, Cursor, and Claude.

Core Capabilities

  • Test Matrix Analysis: Analyzes code changes to generate feature lists and test scenarios

  • Test Code Generation: Generates complete unit test code based on the matrix

  • Multi-framework Support: Supports Vitest and Jest

  • Multi-scenario Coverage: happy-path, edge-case, error-path, state-change

Related MCP server: Phabricator MCP Server

Quick Start

# 安装依赖
pnpm install

# 构建
pnpm build

# 启动服务
pnpm start

The service listens on http://localhost:3000/mcp by default.

Environment Configuration

Copy env.example to .env and fill in the necessary configurations:

# 必需:OpenAI API 密钥
OPENAI_API_KEY=your_api_key

# 可选:自定义模型
OPENAI_MODEL=gpt-4

# 可选:服务配置
HTTP_PORT=3000
HTTP_HOST=0.0.0.0  # 允许外部访问

MCP Tools

analyze-test-matrix

Analyzes code changes and generates a test matrix.

Parameters:

Parameter

Type

Required

Description

rawDiff

string

Unified diff format text

identifier

string

Unique identifier (MR ID, commit hash)

rules

string

Content of test-strategy.md

framework

string

Test framework (vitest/jest)

Returns: Feature list, test scenarios, statistics

generate-tests

Generates unit test code.

Parameters:

Parameter

Type

Required

Description

rawDiff

string

Unified diff format text

identifier

string

Unique identifier

rules

string

Content of test-strategy.md

framework

string

Test framework

scenarios

string[]

Specified scenario types

maxTests

number

Maximum number of tests

Returns: Array of test cases (including file path, code, and scenario type)

n8n Integration

Workflow Example

GitLab/Phabricator Webhook
    │
    ▼
读取 diff + rules 文件
    │
    ▼
调用 MCP generate-tests
    │
    ▼
写入测试文件 + 创建 MR
    │
    ▼
发送通知(企微/飞书)

HTTP Call Example

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"
      }
    }
  }'

rules File Format

Create .cursor/rules/test-strategy.md in your project:

# 测试生成规则

## 测试框架配置
- **测试框架**:vitest
- **测试文件模式**:**/*.{test,spec}.{ts,tsx}

## Mock 策略
- 使用 vi.fn() 进行函数 mock
- HTTP 请求优先 mock fetch/axios

n8n reads the content of this file and passes it as the rules parameter to the MCP.

Docker Deployment

docker build -t fe-testgen-mcp .
docker run -d -p 3000:3000 \
  -e OPENAI_API_KEY=xxx \
  fe-testgen-mcp

FAQ

Q: How to improve the consistency of the generated results?

A: The service uses temperature=0 and a fixed seed=42 by default, with response caching enabled.

Q: How to specify the test framework?

A: Priority: framework parameter > parsed from rules > default vitest

Q: What Node.js version is required?

A: Node.js 18+ (20+ recommended)

F
license - not found
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    -
    quality
    D
    maintenance
    Analyzes 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
  • F
    license
    A
    quality
    D
    maintenance
    Provides 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

View all related MCP servers

Related MCP Connectors

  • 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.

  • Screens public GitHub repos and PRs to generate risk maps, findings, and merge-readiness signals.

View all MCP Connectors

Latest Blog Posts

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