Skip to main content
Glama
NorthSeacoder

Frontend Test Generation & Code Review MCP Server

fe-testgen-mcp

MCPプロトコルに基づいたフロントエンドユニットテスト生成サービスで、AI分析とコード生成機能に特化しています。HTTP Streamingを通じてMCPツールを公開し、n8n、Cursor、Claudeなどのクライアントと統合可能です。

コア機能

  • テストマトリックス分析:コードの変更を分析し、機能リストとテストシナリオを生成

  • テストコード生成:マトリックスに基づいて完全なユニットテストコードを生成

  • マルチフレームワーク対応:VitestとJestをサポート

  • マルチシナリオカバレッジ:happy-path、edge-case、error-path、state-change

Related MCP server: Phabricator MCP Server

クイックスタート

# 安装依赖
pnpm install

# 构建
pnpm build

# 启动服务
pnpm start

サービスはデフォルトで http://localhost:3000/mcp をリッスンします。

環境設定

env.example.env にコピーし、必要な設定を入力してください:

# 必需:OpenAI API 密钥
OPENAI_API_KEY=your_api_key

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

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

MCPツール

analyze-test-matrix

コードの変更を分析し、テストマトリックスを生成します。

パラメータ

パラメータ

必須

説明

rawDiff

string

Unified diff形式のテキスト

identifier

string

一意識別子(MR ID、commit hash)

rules

string

test-strategy.mdの内容

framework

string

テストフレームワーク(vitest/jest)

戻り値:機能リスト、テストシナリオ、統計情報

generate-tests

ユニットテストコードを生成します。

パラメータ

パラメータ

必須

説明

rawDiff

string

Unified diff形式のテキスト

identifier

string

一意識別子

rules

string

test-strategy.mdの内容

framework

string

テストフレームワーク

scenarios

string[]

指定するシナリオタイプ

maxTests

number

最大テスト数

戻り値:テストケースの配列(ファイルパス、コード、シナリオタイプを含む)

n8n統合

ワークフロー例

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

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

rulesファイル形式

プロジェクト内に .cursor/rules/test-strategy.md を作成します:

# 测试生成规则

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

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

n8nはこのファイルの内容を読み取り、rules パラメータとしてMCPに渡します。

Dockerデプロイ

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

よくある質問

Q: 生成結果の一貫性を高めるには?

A: サービスはデフォルトで temperature=0 と固定の seed=42 を使用し、レスポンスキャッシュを有効にしています。

Q: テストフレームワークを指定するには?

A: 優先順位:framework パラメータ > rules 内の解析 > デフォルトの vitest

Q: 必要なNode.jsのバージョンは?

A: Node.js 18以上(20以上を推奨)

F
license - not found
Not graded
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
    Not graded
    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

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

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