Skip to main content
Glama
README.md
# πŸ€– QA Copilot AI

![Architecture](docs/architecture.png)

> **An AI-powered QA Assistant that helps QA engineers analyze test failures, identify root causes, generate fixes, classify defects, detect flaky tests, and automate testing activities using MCP, TypeScript, and Large Language Models.**

---

## πŸš€ Project Overview

Modern QA teams spend significant time analyzing failed automation tests, debugging errors, writing bug reports, and identifying flaky tests.

**QA Copilot AI** is an AI-assisted testing platform designed to reduce debugging effort by combining:

* Model Context Protocol (MCP)
* Large Language Models (Groq LLM)
* Playwright automation data
* REST APIs
* TypeScript backend services

The system allows QA engineers to provide test reports and receive AI-generated insights such as:

* Root cause analysis
* Failure classification
* Suggested fixes
* Test improvement recommendations
* Automated QA artifacts

---

# 🎯 Problem Statement

Automation failures often require manual investigation:

❌ Reading long stack traces
❌ Finding root causes
❌ Identifying flaky tests
❌ Writing defect reports
❌ Creating repetitive test cases

QA Copilot AI solves this by acting as an intelligent testing assistant.

---

# ✨ Features

## AI-Powered QA Analysis

βœ… Failure Analysis
βœ… Test Report Analysis
βœ… Root Cause Identification
βœ… Fix Suggestions
βœ… Failure Classification
βœ… Flaky Test Detection

## Test Automation Assistance

βœ… API Test Generator
βœ… Test Case Generator
βœ… Playwright Script Generator
βœ… Bug Report Generator

## Engineering Features

βœ… MCP Server Implementation
βœ… REST API using Express.js
βœ… Modular TypeScript Architecture
βœ… Environment Configuration
βœ… Error Handling
βœ… Logging Utilities

---

# πŸ— System Architecture

![Architecture](docs/architecture.png)

Workflow:

```
QA Engineer
     |
     |
Test Reports / Logs
     |
     v
QA Copilot API
     |
     v
MCP Server
     |
     |
-----------------------------
|      |        |            |
Failure Report  Fix     Flaky
Analyzer Analyzer Suggest Detector

     |
     v

Groq Large Language Model

     |
     v

AI Generated QA Insights
```

---

# πŸ›  Tech Stack

| Category        | Technology             |
| --------------- | ---------------------- |
| Language        | TypeScript             |
| Runtime         | Node.js                |
| Backend         | Express.js             |
| AI Model        | Groq LLM               |
| Protocol        | Model Context Protocol |
| Automation      | Playwright             |
| Package Manager | npm                    |
| Configuration   | dotenv                 |

---

# πŸ“ Project Structure

```
QA-Copilot-AI

src/
 β”œβ”€β”€ ai/
 β”‚    └── promptTemplates.ts
 |
 β”œβ”€β”€ api/
 |
 β”œβ”€β”€ mcp-server/
 |
 β”œβ”€β”€ tools/
 |
 β”œβ”€β”€ services/
 |
 β”œβ”€β”€ config/
 |
 └── utils/

docs/
 β”œβ”€β”€ architecture.png
 └── architecture.md

screenshots/

package.json
README.md
```

---

# βš™ Installation

Clone repository:

```bash
git clone https://github.com/Sham-coder16/qa-copilot-ai.git
```

Navigate:

```bash
cd qa-copilot-ai
```

Install dependencies:

```bash
npm install
```

---

# πŸ”‘ Environment Setup

Create `.env`

```env
GROQ_API_KEY=your_api_key
PORT=3000
```

---

# β–Ά Running Application

## Start MCP Server

```bash
npm run mcp
```

Expected:

```
MCP SERVER STARTED
Tools Registered Successfully
```

---

## Start API Server

```bash
npm run api
```

Expected:

```
API Server running on port 3000
```

---

## Run Test Client

```bash
npx tsx src/test-client.ts
```

---

# πŸ”§ MCP Tools

Available tools:

| Tool                   | Purpose                   |
| ---------------------- | ------------------------- |
| Failure Analyzer       | Analyze failed tests      |
| Report Analyzer        | Analyze execution reports |
| Suggest Fix            | Generate solutions        |
| Failure Classification | Categorize failures       |
| Flaky Detector         | Detect unstable tests     |
| Test Generator         | Generate automation tests |
| Bug Generator          | Create defect reports     |

---

# πŸ“‘ REST API Example

Endpoint:

```
POST /analyze
```

Request:

```json
{
 "failure": "Login test failed due to timeout"
}
```

Response:

```json
{
 "category":"Automation Failure",
 "rootCause":"Element loading issue",
 "suggestion":"Increase explicit wait"
}
```

---

# πŸ“Έ Screenshots
# πŸ“Έ Project Screenshots

## MCP Server Running

![MCP Server](screenshots/mcp-server.png)


## API Server Running

![API Running](screenshots/api-running.png)


## AI Failure Analysis

![Failure Analysis](screenshots/postman-report-analysis.png)


## Bug Report Generation

![Bug Report](screenshots/postman-bug-report.png)


## Test Case Generation

![Test Case Generator](screenshots/postman-testcase-generator.png)

# πŸ”„ Future Enhancements

* Docker Support
* GitHub Actions CI/CD
* Jenkins Pipeline Integration
* Database Storage
* Web Dashboard
* Multiple LLM Provider Support
* Playwright HTML Report Integration

---

# πŸ’‘ Skills Demonstrated

* QA Automation
* Playwright Testing
* TypeScript Development
* Node.js Backend
* REST API Development
* AI Integration
* Prompt Engineering
* MCP Architecture
* LLM Testing Concepts
* GitHub Project Management

---

# πŸ‘©β€πŸ’» Author

**Shamli Kadukar**

GitHub:

https://github.com/Sham-coder16

---

⭐ If this project helped you understand AI-powered QA automation, consider starring the repository.

TDQS

B3.2/5.0

Scored across 10 tools

Disambiguation4/5

Most tools have distinct purposes: ping for health, analyze_failure and analyze_report both deal with failures but one is general and one is report-specific, classify_failure categorizes, suggest_fix provides fixes, detect_flaky_tests is unique, and generate_* tools are clearly separate. Minor overlap exists between analyze_failure and classify_failure, but descriptions reduce ambiguity.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern (e.g., analyze_failure, generate_test_cases, summarize_bug). Even ping is a verb, and the absence of object is acceptable for a health check. No mixing of styles or vague verbs.

Tool Count5/5

With 10 tools, the server is well-scoped for an AI QA assistant. Each tool addresses a specific needβ€”health check, failure analysis, report parsing, fix suggestion, classification, flaky detection, and three generation tools plus bug summarizationβ€”without unnecessary redundancy.

Completeness4/5

The domain of QA assistance is well-covered: generating test cases, scripts, and API tests; analyzing and classifying failures; suggesting fixes; detecting flaky tests; and summarizing bugs. A minor gap is lack of explicit test maintenance or planning tools, but the core lifecycle of creating and debugging tests is solid.

Maintenance

ActivityStale
ResponsivenessNo issues