AI Test Automation MCP Server
Exposes AI agents as MCP tools to fetch Jira stories, generate BRDs and Playwright test scripts, run tests, and auto-heal broken locators. Integrates with Claude Desktop and Cursor IDE for enterprise-grade test automation.
README
🤖 AI Test Automation Platform
Enterprise-Grade, AI-Powered Multi-Agent Test Automation Framework
Built with Playwright · Appium · TypeScript · OpenAI · MCP · LangSmith · Redis · Gatling
🚀 Overview
An enterprise-grade, AI-driven multi-agent test automation platform that:
- 📋 Reads Jira stories and parses Acceptance Criteria automatically
- 📝 Generates BRD documents using AI-powered analysis
- ⚡ Auto-generates Playwright TypeScript test scripts (Web, Mobile, GraphQL & REST API)
- 🔧 Self-heals broken test locators using AI confidence scoring
- 💰 Saves 100% LLM token costs via SHA-256 distributed Redis caching
- 📊 Streams AI telemetry to LangSmith for real-time observability
- 🌐 Executes cross-platform tests on Local, BrowserStack, AWS Device Farm
🏗️ High-Level Architecture
┌─────────────────────────────────────────────────────────────────┐
│ AI MULTI-AGENT PIPELINE │
│ │
│ Jira Story ──► PlannerAgent ──► GeneratorAgent ──► HealerAgent │
│ (AC) (BRD .md) (.spec.ts files) (Auto-Heal) │
│ │
│ Distributed Cache: In-Memory ──► Disk ──► Redis │
│ Observability: LangSmith APM (Token Telemetry + Evals) │
│ Orchestration: MCP Server (Claude/Cursor IDE Integration) │
└─────────────────────────────────────────────────────────────────┘
🛠️ Tech Stack
| Layer | Technology |
|---|---|
| Web Automation | Playwright 1.49+ (TypeScript) |
| Mobile Automation | Appium 2.0 + WebdriverIO 9 (TypeScript) |
| API / GraphQL Testing | Playwright APIRequestContext (Native) |
| Load Testing | Gatling TypeScript Framework |
| AI Model Integration | OpenAI GPT-4o / Google Gemini |
| AI Observability | LangSmith (Token Telemetry + LLM-as-a-Judge Evals) |
| LLM Cache Engine | SHA-256 In-Memory + Disk + Redis (Distributed) |
| Protocol Standard | Anthropic MCP (Model Context Protocol) |
| CI/CD Pipeline | GitLab CI (Shift-Left AI Orchestration) |
| Cloud Grids | BrowserStack Automate + AWS Device Farm |
| Reporting | Monocart HTML Reporter (Videos + Traces) |
📁 Project Structure
ai-test-automation-platform/
├── agents/
│ ├── pipeline.ts # 🎯 Central Orchestration Layer (5-Step Pipeline)
│ ├── jira/
│ │ ├── JiraClient.ts # Jira REST API integration
│ │ └── StoryParser.ts # ADF → Structured JSON parser
│ ├── planner/
│ │ └── PlannerAgent.ts # AI-powered BRD generator (GPT-4o/Gemini)
│ ├── generator/
│ │ └── GeneratorAgent.ts # Playwright TypeScript test generator
│ ├── healer/
│ │ ├── HealerAgent.ts # JSON results parser & failure classifier
│ │ └── LocatorHealer.ts # Self-healing engine (data-testid/role/text)
│ └── utils/
│ └── LlmCache.ts # SHA-256 Two-Tier LLM Cache (Disk + Redis)
├── mcp-server/
│ └── server.ts # MCP Protocol Server (Claude/Cursor integration)
├── tests/
│ ├── ui/ # Playwright Web E2E test suites
│ ├── mobile/ # Appium WebdriverIO mobile specs
│ └── api/
│ ├── graphql.spec.ts # Native GraphQL query & mutation tests
│ └── location.spec.ts # REST API test suite
├── load-tests/ # Gatling TypeScript performance suite
├── screens/ # Mobile Page Object Models (POM)
├── config/ # Environment & capability configurations
└── .gitlab-ci.yml # Shift-Left AI CI/CD pipeline
⚡ Quick Start
Prerequisites
- Node.js 20+
- npm 10+
- Appium Server (for mobile tests)
Installation
git clone https://github.com/abhirise1981/ai-test-automation-platform.git
cd ai-test-automation-platform
npm install
npx playwright install
Environment Setup
cp .env.example .env
# Fill in your API keys in .env
Running Tests
# Run full AI pipeline for a Jira story
npx ts-node agents/pipeline.ts --issue PROJ-123
# Run on BrowserStack Cloud
npx ts-node agents/pipeline.ts --issue PROJ-123 --target browserstack
# Run Playwright Web tests only
npm test
# Run Mobile tests (Android)
npm run test:mobile:android
# Run GraphQL API tests
npx playwright test tests/api/graphql.spec.ts
# Start MCP Server (for Claude/Cursor integration)
npm run mcp:start
# Run Gatling load tests
npx gatling run
🤖 AI Agents
1. PlannerAgent
- Reads Jira User Story + Acceptance Criteria
- Calls OpenAI GPT-4o to identify Happy Path, Negative, and Edge Case scenarios
- Outputs structured BRD Markdown document
2. GeneratorAgent
- Reads BRD and generates Playwright TypeScript test scripts
- Supports Web (Playwright), Mobile (Appium), and API (GraphQL/REST)
3. HealerAgent + LocatorHealer
- Parses
test-results/results.jsonfor failed tests - Classifies failures:
LOCATOR_BROKEN | TIMING_FLAKY | ASSERTION_DRIFT | APP_CRASH - Auto-patches broken locators with 85%+ confidence threshold
💰 LLM Cost Optimization
Our LlmCache.ts implements a 3-Tier Caching Architecture:
Request → SHA-256 Hash → In-Memory (0ms) → Disk (2ms) → Redis (5ms) → LLM API
- Cache HIT (In-Memory): 0ms, 100% token savings
- Cache HIT (Disk): 2ms, 100% token savings
- Cache HIT (Redis): 5ms cross-runner shared cache for CI/CD
- Cache MISS: Full LLM call, result cached for all future runs
📊 LangSmith Observability
Set LANGCHAIN_TRACING_V2=true in .env to enable:
- Real-time agent execution traces
- Token count & cost monitoring per run
- LLM-as-a-Judge evaluation scores
- Prompt-level debugging in LangSmith Playground
📱 Mobile Testing (Appium 2.0)
- Android: UiAutomator2 driver with W3C Pointer Actions
- iOS: XCUITest driver with accessibility-id locator strategy
- Zero Java: 100% TypeScript with WebdriverIO 9
- Cloud: BrowserStack App Automate & AWS Device Farm support
🔗 MCP Server Integration
This framework exposes all AI agents as Model Context Protocol (MCP) tools compatible with:
- Claude Desktop
- Cursor IDE
- VS Code (Copilot)
- Any MCP-compatible AI assistant
npm run mcp:start
# → Registers: fetch_jira_story, generate_brd, generate_tests, run_tests, heal_tests
👨💻 Author
Abhishek Kumar
Senior AI Test Automation Architect
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。