Test Analyzer MCP Server

Test Analyzer MCP Server

Enables comprehensive analysis of JavaScript/TypeScript project testing setups by detecting frameworks like Jest, Vitest, and Cypress, analyzing test coverage metrics, and generating actionable recommendations for improving test quality. Provides detailed insights into test structure, dependencies, and coverage thresholds with visual feedback.

Category
访问服务器

README

Test Analyzer MCP Server

A Model Context Protocol (MCP) server that provides tools for analyzing unit test setups, checking coverage, and generating comprehensive test reports for JavaScript/TypeScript projects.

Features

  • 🔍 Framework Detection: Automatically detects Jest, Vitest, Mocha, Cypress, and Playwright
  • 📊 Coverage Analysis: Detailed coverage metrics with visual feedback
  • 📁 Test Discovery: Finds and analyzes all test files in your project
  • 🎯 Smart Recommendations: Actionable insights to improve your testing strategy
  • 🚀 Frontend Focused: Optimized for React, Vue, Angular, and other frontend frameworks

Installation

The server is already configured in your MCP settings at:

/Users/venkatagiribabu.jeedigunta/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Available Tools

1. analyze_test_setup

Analyzes the complete unit test setup of a repository.

Parameters:

  • repoPath (required): Path to the repository to analyze

Returns:

  • Framework name (jest, vitest, mocha, etc.)
  • List of test files found
  • Total test count
  • Test structure (suites, tests, hooks)
  • Coverage configuration
  • Testing dependencies
  • Summary report

2. check_coverage

Checks test coverage for a repository with detailed metrics.

Parameters:

  • repoPath (required): Path to the repository
  • runTests (optional, default: false): Whether to run tests to generate fresh coverage data

Returns:

  • Line coverage percentage
  • Statement coverage percentage
  • Function coverage percentage
  • Branch coverage percentage
  • Visual status indicators (✅ Good, ⚠️ Fair, ❌ Poor)
  • Overall coverage summary

3. get_test_summary

Generates a comprehensive test analysis report.

Parameters:

  • repoPath (required): Path to the repository

Returns:

  • Complete test setup overview
  • Coverage metrics with visual feedback
  • Categorized dependencies
  • Actionable recommendations
  • Markdown-formatted report

Sample Queries

Here are example queries you can use with Claude when this MCP server is active:

Basic Analysis

"Analyze the test setup for the project at /Users/me/projects/my-react-app"

"Check what testing framework is being used in /path/to/project"

"Find all test files in my current project"

Coverage Analysis

"Check the test coverage for /Users/me/projects/my-app"

"Run tests and get fresh coverage data for the project at /path/to/repo"

"What's the current test coverage status? Is it meeting the thresholds?"

Comprehensive Reports

"Give me a complete test analysis report for /Users/me/projects/frontend-app"

"Generate a test summary with recommendations for improving coverage"

"Analyze the testing setup and suggest improvements"

Specific Inquiries

"How many tests are in the project at /path/to/repo?"

"What testing dependencies are installed in this project?"

"Is coverage reporting configured properly?"

"Which test files have been created in this project?"

Supported Test Frameworks

Unit Testing

  • Jest - Detected via jest.config.js, package.json
  • Vitest - Detected via vitest.config.js, vite.config.js
  • Mocha - Detected via .mocharc.js, .mocharc.json

E2E Testing

  • Cypress - Detected via cypress.config.js, cypress.json
  • Playwright - Detected via playwright.config.js

Supported Coverage Tools

  • Jest Coverage (built-in)
  • NYC/Istanbul (.nycrc, .nycrc.json)
  • C8 (V8 coverage)
  • Vitest Coverage (@vitest/coverage-c8, @vitest/coverage-istanbul)

Test File Patterns

The server automatically detects test files matching these patterns:

  • **/*.test.{js,jsx,ts,tsx}
  • **/*.spec.{js,jsx,ts,tsx}
  • **/__tests__/**/*.{js,jsx,ts,tsx}
  • test/**/*.{js,jsx,ts,tsx} (Mocha)
  • cypress/integration/**/* (Cypress)
  • cypress/e2e/**/* (Cypress)
  • **/*.cy.{js,jsx,ts,tsx} (Cypress component tests)
  • tests/**/*.{js,jsx,ts,tsx} (Playwright)
  • e2e/**/*.{js,jsx,ts,tsx} (E2E tests)

Coverage Thresholds

The server evaluates coverage based on these thresholds:

  • Good: ≥ 80% coverage
  • ⚠️ Fair: ≥ 60% coverage
  • Poor: < 60% coverage

Example Output

Test Setup Analysis

{
  "framework": "jest",
  "testFiles": ["src/__tests__/utils.test.js", "src/components/Button.test.tsx"],
  "testCount": 25,
  "testStructure": {
    "suites": 10,
    "tests": 25,
    "hooks": ["beforeEach", "afterEach"]
  },
  "dependencies": ["jest@29.5.0", "@testing-library/react@14.0.0"]
}

Coverage Report

Coverage Summary:
- Lines: 85.5% ✅ Good
- Statements: 84.2% ✅ Good
- Functions: 78.9% ⚠️ Fair
- Branches: 72.3% ⚠️ Fair

Overall: ⚠️ Fair

Recommendations

## Recommendations

- 🟡 Branch coverage is below 80%. Add tests for different code paths.
- 🟡 Function coverage could be improved. Consider testing utility functions.
- ✅ Line coverage is good! Keep maintaining high standards.

Advanced Usage

Analyzing Multiple Projects

You can analyze multiple projects in sequence:

"First analyze tests for /project1, then compare with /project2"

CI/CD Integration Ideas

"Check if the coverage meets our 80% threshold for CI"
"Generate a test report for the pull request review"

Test Improvement Workflow

1. "Analyze current test setup"
2. "Check which files have low coverage"
3. "Suggest test cases for uncovered branches"
4. "Re-run coverage after adding tests"

Troubleshooting

No Framework Detected

  • Ensure package.json exists in the repository
  • Check if test framework is in devDependencies
  • Verify configuration files are present

No Coverage Data Found

  • Run tests with runTests: true parameter
  • Ensure coverage is configured in test framework
  • Check if coverage directory exists after running tests

No Test Files Found

  • Verify test files follow common naming patterns
  • Check if tests are in excluded directories (node_modules, dist, build)
  • Ensure file extensions match (.test.js, .spec.ts, etc.)

Development

Adding New Frameworks

To support additional test frameworks, update the frameworks array in the server implementation with:

  • Framework name
  • Configuration file patterns
  • Test file patterns

Extending Coverage Support

The server can be extended to support additional coverage formats by:

  • Adding new file patterns to coverageFiles array
  • Implementing parsers for specific coverage formats
  • Supporting additional coverage reporters

License

ISC

Author

Giri - https://github.com/giri-jeedigunta/

Cline MCP screenshots

<img width="654" height="674" alt="Screenshot 2025-08-14 at 14 27 22" src="https://github.com/user-attachments/assets/7503569f-afda-4587-8267-72c6323729af" /> <img width="820" height="221" alt="Screenshot 2025-08-14 at 14 26 11" src="https://github.com/user-attachments/assets/494ea61a-f25e-4b1f-a215-74676ccae57d" /> <img width="808" height="561" alt="Screenshot 2025-08-14 at 14 26 03" src="https://github.com/user-attachments/assets/f2855b21-76bf-48bd-94c5-435a610e1c10" /> <img width="812" height="818" alt="Screenshot 2025-08-14 at 14 25 43" src="https://github.com/user-attachments/assets/c0f29b81-b3c5-4f50-9045-57c00df3c359" />

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选