Skip to main content
Glama

AI QA Agent MCP

An MCP-enabled QA automation framework built with Playwright and Node.js for executing UI and API automated tests through a Model Context Protocol (MCP) server.

The project demonstrates how traditional test automation can be exposed as reusable MCP tools, allowing an MCP-compatible client to trigger test suites and receive structured test results.

๐Ÿš€ Features

  • Playwright UI automation

  • API testing with Playwright

  • Page Object Model (POM)

  • MCP server integration

  • MCP tool-based test execution

  • Structured JSON test results

  • Login, inventory and checkout test coverage

  • Positive and negative test scenarios

  • Regression test execution

  • Environment-based configuration

  • HTML test reporting

  • Screenshots on failure

  • GitHub Actions CI/CD

  • Automated execution on push and pull requests

Related MCP server: mcp-playwright-test

๐Ÿงฐ Tech Stack

  • JavaScript

  • Node.js

  • Playwright

  • Model Context Protocol (MCP)

  • MCP Inspector

  • Git

  • GitHub

  • GitHub Actions

๐Ÿ—๏ธ Architecture

                MCP Client / Inspector
                         |
                         v
                    MCP Server
                  (mcp/server.js)
                         |
                         v
                   run_tests Tool
                         |
             +-----------+-----------+
             |                       |
             v                       v
       Test Tool Layer          Suite Selection
       (tools/*.js)        login / inventory /
                           checkout / api /
                           regression
             |
             v
        testRunner.js
             |
             v
          Playwright
         /          \
        v            v
    UI Tests      API Tests
       |
       v
  Page Objects

๐Ÿ“ Project Structure

my-ai-qa-agent/
โ”‚
โ”œโ”€โ”€ .github/
โ”‚   โ””โ”€โ”€ workflows/
โ”‚       โ””โ”€โ”€ playwright.yml
โ”‚
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ customer.js
โ”‚   โ””โ”€โ”€ users.js
โ”‚
โ”œโ”€โ”€ mcp/
โ”‚   โ””โ”€โ”€ server.js
โ”‚
โ”œโ”€โ”€ pages/
โ”‚   โ”œโ”€โ”€ LoginPage.js
โ”‚   โ”œโ”€โ”€ InventoryPage.js
โ”‚   โ”œโ”€โ”€ CartPage.js
โ”‚   โ””โ”€โ”€ CheckoutPage.js
โ”‚
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ api/
โ”‚   โ”‚   โ””โ”€โ”€ users.api.spec.js
โ”‚   โ”œโ”€โ”€ login.spec.js
โ”‚   โ”œโ”€โ”€ inventory.spec.js
โ”‚   โ””โ”€โ”€ checkout.spec.js
โ”‚
โ”œโ”€โ”€ tools/
โ”‚   โ”œโ”€โ”€ testRunner.js
โ”‚   โ”œโ”€โ”€ runLoginTests.js
โ”‚   โ”œโ”€โ”€ runInventoryTests.js
โ”‚   โ”œโ”€โ”€ runCheckoutTests.js
โ”‚   โ”œโ”€โ”€ runApiTests.js
โ”‚   โ””โ”€โ”€ runRegressionTests.js
โ”‚
โ”œโ”€โ”€ .env.example
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ playwright.config.js
โ””โ”€โ”€ README.md

pages/

Contains reusable Page Object Model classes that encapsulate UI locators and user actions.

tests/

Contains Playwright UI and API test specifications.

tools/

Acts as the bridge between MCP requests and Playwright test execution. Individual tools select test suites while testRunner.js executes Playwright and summarizes the results.

mcp/

Contains the MCP server that exposes QA automation capabilities as MCP tools.

.github/workflows/

Contains the GitHub Actions workflow used to execute the automated test suite in CI.

โš™๏ธ Installation

Clone the repository:

git clone https://github.com/bisminizzar84/ai-qa-agent-mcp
cd ai-qa-agent-mcp

Install dependencies:

npm install

Install Playwright browsers:

npx playwright install

Create a local .env file based on .env.example:

BASE_URL=https://www.saucedemo.com

๐Ÿงช Running Tests

Run the complete test suite:

npm test

Run tests with a visible browser:

npx playwright test --headed

Run only login tests:

npx playwright test tests/login.spec.js

Run API tests:

npx playwright test tests/api/users.api.spec.js

Open the Playwright HTML report:

npx playwright show-report

๐Ÿค– MCP Integration

The project exposes QA automation through an MCP server.

Start the server through MCP Inspector:

npx -y @modelcontextprotocol/inspector@latest node mcp/server.js

The run_tests MCP tool supports multiple suites:

  • login

  • inventory

  • checkout

  • api

  • regression

Example request:

{
  "suite": "api"
}

Example response:

{
  "suite": "api",
  "status": "passed",
  "total": 1,
  "passed": 1,
  "failed": 0,
  "skipped": 0,
  "durationMs": 1841
}

The MCP layer converts test execution into structured results that can be consumed by MCP-compatible clients.

๐Ÿ”„ CI/CD

GitHub Actions automatically executes the Playwright test suite when code is pushed to main or when a pull request targets main.

The pipeline performs:

  1. Repository checkout

  2. Node.js setup

  3. Dependency installation

  4. Playwright browser installation

  5. Automated test execution

  6. Playwright report upload

This provides automated regression feedback for every code change.

๐Ÿ”ฎ Future Enhancements

  • Connect an LLM to the MCP server for natural-language test execution

  • AI-assisted failure analysis

  • Automatic defect summaries

  • Test generation from natural-language requirements

  • Additional API coverage

  • Parallel and cross-browser execution

  • Dockerized test execution

  • Test result notifications

Related MCP Connectors

  • An MCP server that provides access to Testiny projects, test cases and test runs

  • Run, debug, and triage tests from your IDE using natural language, no dashboard switching, no manual data transfers. The TestMu AI (formerly LambdaTest) MCP Server is a single remote server exposing four tool suites: HyperExecute โ€” analyze your project, generate YAML configs and test runner commands, then monitor jobs and sessions. Automation โ€” pull a TestID's details plus command, network, and console logs into one chat for instant root-cause analysis. Includes mobile app upload. SmartUI โ€” explain pixel, layout, DOM, and perceptual changes in a visual regression run, with context-aware React/HTML/CSS fixes. Accessibility โ€” audit any public URL or a local React app against WCAG and get ready-to-apply remediation steps. Connects over https://mcp.lambdatest.com/mcp using OAuth 2.1 โ€” no API keys in your config. One-click install in Cursor; works with Claude, GitHub Copilot, Cline, and any MCP client. Tests execute on the TestMu AI cloud: 3,000+ browsers and 10,000+ real devices.

  • Katalon True Platform MCP: design tests, run with AI, upload reports, assess release readiness.

  • MEOK MCP Test MCP โ€” golden-file + schema-drift + tool-failure tests for any MCP server. Drop-in

Related MCP Servers