Skip to main content
Glama
AI QA Agent MCP

AI QA Agent MCP

by sadi-qa

AI QA Agent MCP

QA Validation

A TypeScript-based Model Context Protocol server that analyzes Playwright JSON and JUnit XML test results and provides structured QA insights to AI clients.

Project Goal

This project demonstrates how an AI client can use MCP tools, resources, and prompts to:

  • Discover supported test-result files

  • Normalize Playwright JSON and JUnit XML reports

  • Calculate test-execution metrics

  • Analyze failed, timed-out, and flaky tests

  • Group failures by probable category

  • Generate structured draft bug reports

  • Generate Markdown QA execution summaries

  • Provide advisory release-quality recommendations

Related MCP server: kairo

Implemented MCP Capabilities

Tools

  • list_test_runs

  • get_test_run_summary

  • analyze_test_failures

  • generate_bug_report

  • generate_qa_summary

Resource

  • test-run://latest

The resource returns the newest supported report as normalized QA execution data.

Prompt

  • prepare_release_quality_report

The prompt guides an AI client through a structured release-quality analysis workflow using the available MCP tools.

Supported Report Formats

  • Playwright JSON

  • JUnit XML

Both formats are converted into one normalized internal test-result model before analysis.

Technology Stack

  • Node.js

  • TypeScript

  • Model Context Protocol TypeScript SDK

  • Zod

  • Fast XML Parser

  • Vitest

  • V8 code coverage

  • Playwright JSON

  • JUnit XML

  • MCP Inspector

  • Codex CLI

  • GitHub Actions

Architecture

Playwright JSON Reports     JUnit XML Reports
          |                         |
          +------------+------------+
                       |
                       v
                 Report Parsers
                       |
                       v
             Normalized Test Results
                       |
                       v
               QA Analysis Services
                       |
                       v
                   MCP Server
              |         |         |
            Tools    Resources   Prompts
              |         |         |
              +---------+---------+
                       |
                       v
             MCP Inspector or AI Client

Project Structure

ai-qa-agent-mcp/
├── .github/
│   └── workflows/
│       └── qa-validation.yml
├── docs/
├── reports/
├── sample-data/
│   ├── json/
│   │   └── playwright-results.json
│   └── junit/
│       └── junit-results.xml
├── src/
│   ├── config/
│   ├── parsers/
│   ├── prompts/
│   ├── resources/
│   ├── services/
│   ├── tools/
│   ├── types/
│   ├── mcp-server.ts
│   └── server.ts
├── tests/
│   ├── integration/
│   │   └── mcp-server.integration.test.ts
│   └── unit/
├── .gitignore
├── package.json
├── README.md
├── tsconfig.build.json
├── tsconfig.json
└── vitest.config.ts

Development Commands

Install dependencies:

npm install

Run the server during development:

npm run dev

Check TypeScript:

npm run typecheck

Run automated tests:

npm test

Run tests with coverage:

npm run test:coverage

Generate the production build:

npm run build

Run type checking, automated tests, and the production build:

npm run check

Run type checking, coverage validation, and the production build:

npm run check:coverage

MCP Integration Testing

The integration suite creates an MCP server and client connected through the SDK's in-memory transport.

It verifies that an MCP client can:

  • Discover all five registered tools

  • Call the JUnit test-run summary tool

  • Discover and read test-run://latest

  • Discover and retrieve prepare_release_quality_report

  • Exchange normalized QA data through the MCP protocol

The reusable MCP server is created by:

src/mcp-server.ts

The production stdio entry point remains:

src/server.ts

Continuous Integration

The QA Validation GitHub Actions workflow runs for:

  • Pull requests targeting main

  • Pushes to main

  • Manual workflow executions

The workflow uses Node.js 24 and runs:

npm ci
npm run check:coverage

The workflow fails when type checking, tests, coverage thresholds, or the production build fail.

Coverage Thresholds

The project enforces these minimum global coverage thresholds:

Metric

Minimum

Current

Statements

80%

82.99%

Branches

65%

70.37%

Functions

90%

92.68%

Lines

80%

82.94%

Coverage reports are generated in text, JSON summary, and HTML formats.

Generated reports are stored under:

coverage/

Example Report Paths

Paths must be relative to the configured approved reports directory.

json/playwright-results.json
junit/junit-results.xml

Security Principles

  • Read-only report access by default

  • Restricted file-system access

  • Safe path resolution

  • Maximum report-size enforcement

  • Input validation for MCP tools

  • No automatic issue creation

  • No secret values in logs

  • Human review required for AI-generated conclusions

  • Release recommendations are advisory only

Quality Validation

The project currently includes automated coverage for:

  • Playwright JSON parsing

  • JUnit XML parsing

  • Shared report-format routing

  • Test-run file discovery

  • Test-execution metric calculation

  • Failure analysis

  • Draft bug-report generation

  • QA-summary generation

  • Latest-test-run resource handling

  • Safe file-path validation

  • MCP tool discovery and invocation

  • MCP resource discovery and reading

  • MCP prompt discovery and retrieval

Current validation result:

17 test files passed
53 tests passed
Coverage thresholds passed
Production build passed

Current Status

Version 0.1.0 is under active development.

Implemented features include five MCP tools, one MCP resource, one MCP prompt, Playwright JSON support, JUnit XML support, unit and integration test coverage, enforced coverage thresholds, and GitHub Actions CI validation.

Available Tools

5 tools
analyze_test_failuresAnalyze Test FailuresA

Analyze failed, timed-out, and flaky tests from an approved Playwright JSON report and group them by probable failure category.

Inputs: reportPath (required).

generate_bug_reportGenerate Bug ReportA

Generate a structured draft bug report for one failed, timed-out, or flaky test from an approved Playwright JSON report.

Inputs: testId (required), reportPath (required).

generate_qa_summaryGenerate QA SummaryB

Generate a complete QA execution summary containing metrics, failure analysis, quality risks, Markdown output, and an advisory release recommendation.

Inputs: reportPath (required).

get_test_run_summaryGet Test Run SummaryA

Read an approved Playwright JSON report and calculate pass, failure, skip, timeout, and flaky-test metrics.

Inputs: reportPath (required).

list_test_runsList Test RunsA

Find available Playwright JSON and JUnit test-result files in the approved reports directory.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a clearly distinct role in the QA workflow: discovery, summary, failure analysis, bug report generation, and full summary. No two tools overlap in purpose.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun snake_case pattern (list_, get_, analyze_, generate_), making the set predictable and easy to navigate.

    Tool Count5/5

    With 5 tools, the set is well-scoped for a QA agent: it covers discovery, analysis, and reporting without excess or gaps.

    Completeness5/5

    The tool surface covers the complete QA report workflow: finding reports, summarizing metrics, analyzing failures, drafting bug reports, and producing a final summary. No obvious missing operations.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers