npm package: @giaeulate/testing-mcp
Description: MCP server for automated testing - supports React, Python, and Golang projects
Author: giaeulate
Latest version: 1.0.0

# @giaeulate/testing-mcp

MCP (Model Context Protocol) server for automated testing. Supports **Python**, **JavaScript/TypeScript**, and **Golang** projects.

## Features

- **Auto-detection** of project type and test framework
- **Test generation** with AAA pattern (Arrange-Act-Assert)
- **Test execution** with structured results
- **Failure analysis** with suggested fixes
- **Setup configuration** for new projects

## Supported Languages & Frameworks

| Language | Test Framework | Detection |
|----------|----------------|-----------|
| Python | pytest | `requirements.txt`, `pyproject.toml`, `*.py` |
| JavaScript/TypeScript | Jest, Vitest | `package.json`, `*.js`, `*.ts`, `*.jsx`, `*.tsx` |
| Golang | go test | `go.mod`, `*.go` |

## Installation

### Using npm (recommended)

```bash
npm install -g @giaeulate/testing-mcp
```

### Add to Claude Code

```bash
claude mcp add testing-mcp -- npx @giaeulate/testing-mcp
```

Or if installed globally:

```bash
claude mcp add testing-mcp -- testing-mcp
```

### Verify installation

```bash
claude mcp list
```

## Available Tools

### 1. `analyze_project`

Analyzes a project and detects the technology stack.

**Input:**
- `projectPath` (string, required): Absolute path to the project

**Output:**
- `language`: python | javascript | typescript | golang
- `framework`: django | fastapi | flask | react | vue | express | gin | fiber | null
- `testFramework`: pytest | jest | vitest | gotest
- `testableFiles`: List of files that can be tested
- `existingTests`: List of existing test files
- `configFiles`: Configuration files found

### 2. `generate_tests`

Generates tests for a specific file.

**Input:**
- `filePath` (string, required): Absolute path to the file to test
- `testFramework` (string, optional): pytest | jest | vitest | gotest
- `testType` (string, optional): unit | integration | e2e (default: unit)

**Output:**
- `testCode`: Generated test code
- `testFilePath`: Suggested path for the test file
- `dependencies`: Required dependencies (if missing)

### 3. `run_tests`

Runs tests in a project.

**Input:**
- `projectPath` (string, required): Absolute path to the project
- `testPattern` (string, optional): Pattern to filter tests
- `coverage` (boolean, optional): Include coverage report

**Output:**
- `passed`: Number of passed tests
- `failed`: Number of failed tests
- `skipped`: Number of skipped tests
- `coverage`: Coverage percentage (if requested)
- `failures`: Detailed list of failures
- `duration`: Execution time in ms
- `rawOutput`: Complete command output

### 4. `analyze_failures`

Analyzes test failures and suggests fixes.

**Input:**
- `testOutput` (string, required): Output from failed tests
- `sourceFile` (string, optional): Related source file path

**Output:**
- `analysis`: Problem explanation
- `suggestedFix`: Suggested code fix
- `relatedFiles`: Potentially related files

### 5. `setup_testing`

Initializes testing configuration in a project.

**Input:**
- `projectPath` (string, required): Absolute path to the project
- `framework` (string, required): pytest | jest | vitest | gotest

**Output:**
- `configFiles`: Created configuration files
- `commands`: Commands to install dependencies
- `instructions`: Additional instructions

## Usage Examples

### Analyze a project

```
analyze_project({ projectPath: "/path/to/my-project" })
```

### Generate tests for a file

```
generate_tests({
  filePath: "/path/to/my-project/src/utils.py",
  testType: "unit"
})
```

### Run tests with coverage

```
run_tests({
  projectPath: "/path/to/my-project",
  coverage: true
})
```

### Setup testing in a new project

```
setup_testing({
  projectPath: "/path/to/my-project",
  framework: "pytest"
})
```

## License

MIT