# seawandererind-hash/testpilot-mcp architecture

> Architecture diagram of the GitHub repository seawandererind-hash/testpilot-mcp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/seawandererind-hash/testpilot-mcp
- Repository: https://github.com/seawandererind-hash/testpilot-mcp

## Overview

TestPilot is an MCP-based test-automation assistant. Its main journey guides a team through setup, importing and reviewing cases, planning, generating tests, running and triaging them, and reporting or syncing results. The graph also retains the live-testing, AI-driven testing, quality, coverage, add-on, and browser UI capabilities described in the README. Source excerpts show MCP tool registration and selected internal calls; other links follow the README’s workflow, so unsampled implementation details are not inferred.

Main entry points: [`src/run/playwright.ts`](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/run/playwright.ts) (Test execution), [`src/core/wizard.ts`](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/core/wizard.ts) (Guided setup), [`src/tools/quickstart.ts`](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/tools/quickstart.ts) (Quick start), [`src/testcases/import.ts`](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/testcases/import.ts) (Case import)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_mcp["MCP server<br/>[server.ts]"]
  node_tools["MCP tool handlers<br/>[common.ts]"]
  node_ui["Browser app<br/>[server.ts]"]
end

subgraph group_setup["Project setup"]
  node_wizard["Guided setup<br/>[wizard.ts]"]
  node_quickstart["Quick start<br/>[quickstart.ts]"]
  node_project[("Project state<br/>[store.ts]")]
  node_environment["Environment config<br/>[env.ts]"]
  node_scaffold["Framework scaffold<br/>[engine.ts]"]
end

subgraph group_cases["Cases and planning"]
  node_case_import["Case import<br/>[import.ts]"]
  node_case_formats["Case format adapters"]
  node_review["Case review<br/>[review.ts]"]
  node_planning["Automation plan<br/>[plan.ts]"]
end

subgraph group_automation["Test automation"]
  node_exploration["App exploration<br/>[web.ts]"]
  node_live["Live testing<br/>[engine.ts]"]
  node_generation["Test generation<br/>[playwright.ts]"]
  node_ai_tests["AI-driven tests<br/>[midscene.ts]"]
  node_execution["Test execution<br/>[playwright.ts]"]
  node_healing["Locator healing<br/>[locators.ts]"]
end

subgraph group_results["Quality and results"]
  node_quality["Quality checks<br/>[gate.ts]"]
  node_coverage["Coverage map<br/>[coverage.ts]"]
  node_reports["Reports and CI<br/>[report.ts]"]
  node_sync["Result publishing<br/>[sync.ts]"]
  node_capabilities["Add-on capabilities<br/>[index.ts]"]
end

node_team(("QA team"))
node_app["Application under test"]
node_test_services["Test management services"]
node_ci["CI pipeline"]

node_team -->|"asks for help"| node_mcp
node_mcp -->|"registers tools"| node_tools
node_team -->|"opens app"| node_ui
node_team -->|"chooses setup"| node_wizard
node_wizard -->|"saves choices"| node_project
node_wizard -->|"configures keys"| node_environment
node_team -->|"requests quick check"| node_quickstart
node_quickstart -->|"records setup"| node_project
node_quickstart -->|"explores app"| node_exploration
node_wizard -->|"creates framework"| node_scaffold
node_team -->|"supplies cases"| node_case_import
node_case_import -.->|"uses adapters"| node_case_formats
node_case_import -.->|"normalizes cases"| node_review
node_review -->|"scores and plans"| node_planning
node_team -->|"requests exploration"| node_exploration
node_exploration -->|"inspects pages"| node_app
node_team -->|"watches test"| node_live
node_team -->|"approves generation"| node_generation
node_planning -->|"guides test generation"| node_generation
node_generation -->|"writes runnable tests"| node_execution
node_team -->|"describes test"| node_ai_tests
node_ai_tests -->|"drives app"| node_app
node_team -->|"runs tests"| node_execution
node_execution -->|"exercises app"| node_app
node_execution -->|"feeds failures"| node_healing
node_execution -->|"checks test code"| node_quality
node_execution -->|"supplies run results"| node_coverage
node_execution -->|"produces results"| node_reports
node_reports -->|"supports pipelines"| node_ci
node_team -->|"approves publishing"| node_sync
node_sync -->|"sends results"| node_test_services
node_team -->|"requests add-ons"| node_capabilities

click node_mcp "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/server.ts"
click node_tools "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/tools/common.ts"
click node_ui "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/ui-app/server.ts"
click node_wizard "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/core/wizard.ts"
click node_quickstart "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/tools/quickstart.ts"
click node_project "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/core/store.ts"
click node_environment "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/core/env.ts"
click node_scaffold "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/scaffold/engine.ts"
click node_case_import "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/testcases/import.ts"
click node_case_formats "https://github.com/seawandererind-hash/testpilot-mcp/tree/main/src/testcases/importers"
click node_review "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/testcases/review.ts"
click node_planning "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/plan/plan.ts"
click node_exploration "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/explore/web.ts"
click node_live "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/live/engine.ts"
click node_generation "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/generate/playwright.ts"
click node_ai_tests "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/ai/midscene.ts"
click node_execution "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/run/playwright.ts"
click node_healing "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/heal/locators.ts"
click node_quality "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/quality/gate.ts"
click node_coverage "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/insights/coverage.ts"
click node_reports "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/report/report.ts"
click node_sync "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/integrations/sync.ts"
click node_capabilities "https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/capabilities/index.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mcp,node_tools,node_ui toneBlue
class node_wizard,node_quickstart,node_project,node_environment,node_scaffold toneAmber
class node_case_import,node_case_formats,node_review,node_planning toneMint
class node_exploration,node_live,node_generation,node_ai_tests,node_execution,node_healing toneRose
class node_quality,node_coverage,node_reports,node_sync,node_capabilities,node_team,node_app,node_test_services,node_ci toneIndigo
```

## Components

### Entry points

- [MCP server](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/server.ts): `src/server.ts`
- [MCP tool handlers](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/tools/common.ts): `src/tools/common.ts`
- [Browser app](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/ui-app/server.ts): `src/ui-app/server.ts`

### Project setup

- [Guided setup](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/core/wizard.ts): `src/core/wizard.ts`
- [Quick start](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/tools/quickstart.ts): `src/tools/quickstart.ts`
- [Project state](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/core/store.ts): `src/core/store.ts`
- [Environment config](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/core/env.ts): `src/core/env.ts`
- [Framework scaffold](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/scaffold/engine.ts): `src/scaffold/engine.ts`

### Cases and planning

- [Case import](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/testcases/import.ts): `src/testcases/import.ts`
- [Case format adapters](https://github.com/seawandererind-hash/testpilot-mcp/tree/main/src/testcases/importers): `src/testcases/importers`
- [Case review](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/testcases/review.ts): `src/testcases/review.ts`
- [Automation plan](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/plan/plan.ts): `src/plan/plan.ts`

### Test automation

- [App exploration](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/explore/web.ts): `src/explore/web.ts`
- [Live testing](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/live/engine.ts): `src/live/engine.ts`
- [Test generation](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/generate/playwright.ts): `src/generate/playwright.ts`
- [AI-driven tests](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/ai/midscene.ts): `src/ai/midscene.ts`
- [Test execution](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/run/playwright.ts): `src/run/playwright.ts`
- [Locator healing](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/heal/locators.ts): `src/heal/locators.ts`

### Quality and results

- [Quality checks](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/quality/gate.ts): `src/quality/gate.ts`
- [Coverage map](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/insights/coverage.ts): `src/insights/coverage.ts`
- [Reports and CI](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/report/report.ts): `src/report/report.ts`
- [Result publishing](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/integrations/sync.ts): `src/integrations/sync.ts`
- [Add-on capabilities](https://github.com/seawandererind-hash/testpilot-mcp/blob/main/src/capabilities/index.ts): `src/capabilities/index.ts`

### Other components

- **QA team**
- **Application under test**
- **Test management services**
- **CI pipeline**

## Connections

- QA team → MCP server: asks for help (evidence: `README.md`)
- MCP server → MCP tool handlers: registers tools (evidence: `src/server.ts`)
- QA team → Browser app: opens app (evidence: `README.md`)
- QA team → Guided setup: chooses setup (evidence: `README.md`)
- Guided setup → Project state: saves choices (evidence: `README.md`)
- Guided setup → Environment config: configures keys (evidence: `README.md`)
- QA team → Quick start: requests quick check (evidence: `README.md`)
- Quick start → Project state: records setup (evidence: `src/tools/quickstart.ts`)
- Quick start → App exploration: explores app (evidence: `src/tools/quickstart.ts`)
- Guided setup → Framework scaffold: creates framework (evidence: `README.md`)
- QA team → Case import: supplies cases (evidence: `README.md`)
- Case import → Case format adapters: uses adapters
- Case import → Case review: normalizes cases
- Case review → Automation plan: scores and plans (evidence: `README.md`)
- QA team → App exploration: requests exploration (evidence: `README.md`)
- App exploration → Application under test: inspects pages (evidence: `README.md`)
- QA team → Live testing: watches test (evidence: `README.md`)
- QA team → Test generation: approves generation (evidence: `README.md`)
- Automation plan → Test generation: guides test generation (evidence: `README.md`)
- Test generation → Test execution: writes runnable tests (evidence: `README.md`)
- QA team → AI-driven tests: describes test (evidence: `README.md`)
- AI-driven tests → Application under test: drives app (evidence: `README.md`)
- QA team → Test execution: runs tests (evidence: `README.md`)
- Test execution → Application under test: exercises app (evidence: `README.md`)
- Test execution → Locator healing: feeds failures (evidence: `README.md`)
- Test execution → Quality checks: checks test code (evidence: `src/quality/gate.ts`)
- Test execution → Coverage map: supplies run results (evidence: `src/insights/coverage.ts`)
- Test execution → Reports and CI: produces results (evidence: `README.md`)
- Reports and CI → CI pipeline: supports pipelines (evidence: `README.md`)
- QA team → Result publishing: approves publishing (evidence: `README.md`)
- Result publishing → Test management services: sends results (evidence: `README.md`)
- QA team → Add-on capabilities: requests add-ons (evidence: `README.md`)
