QA-MCP-Learning-Lab
Showcases principal-level QA architecture using MCP tools and Playwright for validating security, business workflows, contract safety, and cross-layer consistency.
README
QA-MCP-Learning-Lab
Project Overview
QA-MCP-Learning-Lab is a showcase repository for principal-level quality engineering architecture using Model Context Protocol (MCP) tools and Playwright-based UI validation. The project demonstrates how modern QA systems can validate security, business workflows, contract safety, and cross-layer consistency in a single, extensible test harness.
QA Pillars
- Security / Session Integrity
- Validate authentication, authorization, and protected endpoint behavior.
- Business Workflows
- Exercise end-to-end business logic for create/read/update/delete flows.
- Contract / Data Safety
- Enforce request and response schemas with Zod to prevent malformed payloads.
- Cross-Layer Sync
- Verify that backend behavior and frontend/UI expectations remain aligned.
Architectural View
🏗️ QA & System Architecture Overview
This section outlines how our test suites, core infrastructure, and quality pillars connect to deliver reliable software outputs.
🗺️ Architecture Blueprint
| Layer | Component Group | Included Elements & Responsibilities |
|---|---|---|
| Layer 1 | 🛠️ Test Harness | MCP Tools • Node Unit Tests • Playwright UI Tests<br>The entry point where all automated tests run. |
| Layer 2 | 💻 System Components | Server & Tool Registry • API / Business Logic • Frontend Browser • Zod Schemas<br>The actual application code and infrastructure being tested. |
| Layer 3 | 🛡️ QA Pillars | Security & Session Integrity • Contract & Data Safety • Cross-Layer Sync<br>The core criteria ensuring safety, data contract validation, and system sync. |
| Layer 4 | 📊 Outputs | QA Reports & Artifacts<br>The final test results, logs, and compliance documentation generated. |
🔄 How Data Flows
- Test Execution: The Test Harness (Layer 1) fires automated tests.
- System Evaluation: These tests hit the System Components (Layer 2) to verify the UI, API, and schemas.
- Core Validation: The system behaviors are filtered against our strict QA Pillars (Layer 3).
- Final Delivery: The pipeline outputs clean, client-ready QA Reports (Layer 4) showing exactly what passed or failed.
Directory Structure
- src/tools
- MCP tool implementations and tool registration logic.
- src/tests
- Node-based unit tests and Playwright smoke/e2e tests.
- src/utils/schema.ts
- Shared Zod schemas for request/response contract validation.
- src/playwright
- Playwright configuration and browser-based test setup.
- src/server.ts
- Application entry point for local execution and tool exposure.
MCP Tool Registration
MCP tools are implemented under the src/tools area and registered with the server entry point so they can be exposed to clients in a structured, discoverable way. The server acts as the orchestration layer for tool execution and test interaction.
Zod Schemas and Contract Enforcement
Zod schemas provide runtime validation for payload structures and API contracts. They help ensure the system fails fast when requests or responses drift from the expected shape, improving diagnostics and preventing downstream compatibility issues.
Test Portfolio
The project is organized as a showcase test portfolio with 10 milestone tests across four phases.
- Phase 1: Session & Security (2 tests)
- Authentication/session handling
- Protected endpoint security
- Phase 2: CRUD & Business Logic (4 tests)
- Create, read, update, and delete workflow coverage
- Phase 3: Contract & Diagnostics (2 tests)
- Schema validation and contract-safe behavior
- Phase 4: Cross-Layer UI (2 tests)
- Frontend/browser-level verification against the same product behavior
- One test is optional and runs only when a valid
BASE_URLis configured
Total showcase tests: 10
Note: this repository does not include a hosted frontend application by default. To enable the optional UI smoke check, set
BASE_URLto a running frontend URL such ashttp://localhost:3000or your deployed app URL.
CI/CD
The project includes a GitHub Actions workflow at .github/workflows/ci.yml that runs the build and test pipeline automatically.
CI Workflow Expectations
- Install dependencies with npm ci
- Build the TypeScript project with npm run build
- Execute the test harness with npm test
- Publish Playwright report artifacts for inspection
Available npm Scripts
- npm run build
- npm test
Test Reports
Playwright reports are generated into the test-results directory, including an HTML report for browser-based validation.
How to Run
npm ci
npm run build
npm test
npx playwright show-report
Environment Variables
BASE_URL— Optional frontend URL used by the Playwright frontend smoke test.- Example:
BASE_URL=http://localhost:3000or BASE_URL=https://demo.realworld.show
If BASE_URL is not set, the optional frontend verification test will be skipped, but the remaining workflow and contract tests will still run.
Test inventory (what runs today)
Primary showcase tests (10):
src/tests/conduit.phase1.test.ts— 2 tests (Session & Security)src/tests/phase2-crud.test.ts— 4 tests (CRUD & Business Logic)src/tests/phase3-contract.test.ts— 2 tests (Contract & Diagnostics)src/tests/phase4-ui.test.ts— 2 tests (Cross-Layer UI)
Additional tests included in the repository (not part of the primary 10):
src/tests/playwright.smoke.test.ts— 2 Playwright checks (engine availability + optional frontend smoke check)src/tests/run-all-tests.report.test.ts— 1 internal regression/test helper (parses Playwright JSON)
When the harness runs all files in src/tests, these extras will increase the total test count reported (e.g. 13 total in some runs). To restrict reports to the 10 showcase tests, exclude the helper files or adjust the harness filter.
Future Enhancements
- Add custom reporters for phase-by-phase test results and trend tracking
- Integrate with a dashboard for richer QA visibility and historical reporting
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。