Auto-Heal-MCP
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Auto-Heal-MCP
Trust-Gated Playwright Failure Arbiter & Deterministic MCP Server
Auto-Heal-MCP is an automated, safety-critical test repair engine and Model Context Protocol (MCP) server for Playwright suites. Rather than blindly patching broken tests or modifying locators at runtime, Auto-Heal-MCP deterministically classifies failures, halts on genuine application bugs and assertion mismatches, preserves test semantics via TypeScript AST invariants, verifies candidates against dependent blast-radius specs, and outputs auditable unified .patch files.
Architecture Pipeline
Playwright Test Failure
│
▼
┌───────────────────────────────┐
│ Forensic Custom Reporter │
│ (ARIA Snapshot, Console, Net) │
└───────────────┬───────────────┘
│
▼
┌───────────────────────────────┐
│ Security Redactor │
│ (Tokens, Cookies, Auth, PII) │
└───────────────┬───────────────┘
│
▼
┌───────────────────────────────┐
│ Deterministic Classifier │
│ (Net 500, Page Crash, Assert) │
└───────┬───────────────┬───────┘
│ │
APP_BUG / │ │ LOCATOR_DRIFT
ASSERTION ▼ ▼
┌────────────────┐ ┌───────────────────────────────────┐
│ HALT HEALING │ │ Single-Shot Ollama / ARIA Healer │
│ (0% False-Grn) │ │ (qwen2.5-coder:7b / Semantic ARIA)│
└────────────────┘ └─────────────────┬─────────────────┘
│ Candidate Locator
▼
┌───────────────────────────────────┐
│ TypeScript AST Multi-Gate Guard │
│ (Syntax, Assertion Multiset, No │
│ Skip, No XPath/Positional Locators│
└─────────────────┬─────────────────┘
│ Verified AST
▼
┌───────────────────────────────────┐
│ Safe In-Memory Blast-Radius Check │
│ (Dependent Specs, try/finally disk│
│ restoration, silent stdio pipe) │
└─────────────────┬─────────────────┘
│ All Specs Green
▼
┌───────────────────────────────────┐
│ Emit Unified .patch Diff │
│ & Expose via Deterministic MCP │
└───────────────────────────────────┘Related MCP server: playwright-e2e-mcp
Key Engineering Trade-offs
Native Telemetry & ARIA Snapshot over
trace.zip: Extracting multi-megabyte Playwright trace zip archives requires unzipping and heavy binary parsing. Auto-Heal-MCP uses an official customReporterand test fixture that extracts real-time accessible trees (page.locator('body').ariaSnapshot()), console errors, and first-party HTTP responses with zero external dependencies and sub-millisecond overhead.Deterministic, Zero-LLM MCP Server: The MCP server (
src/mcp/server.ts) does not call any LLM internally. AI agent clients (such as OpenCode, Antigravity, or Claude Code) perform high-level orchestration, while the MCP server exposes pure, deterministic, sandboxed tools for forensics retrieval, policy classification, AST validation, and blast-radius verification.TypeScript AST Multiset Assertion Preservation: Regex-based code checks are easily tricked. Auto-Heal-MCP parses TypeScript source into an Abstract Syntax Tree using the official TypeScript Compiler API, tracks the multiset counts of all outer
expect(...)call chains, forbids assertion deletion, prevents weakening assertion expected values (e.g.,'$99.00'to'$199.00'), blocks test skipping (test.skip), and rejects brittle positional/XPath locators.In-Memory
try/finallyRestoration over Git Worktrees: Git worktrees on Windows often hit file locking, symlink permission issues, and index contention. Auto-Heal-MCP verifies candidates in-place inside a stricttry { write(patched) } finally { write(original) }block, guaranteeing byte-for-byte original file restoration on disk even if test execution crashes or aborts.Auditable Unified Diffs over Runtime Monkey-Patching: Runtime locator healing masks underlying regressions and prevents CI reviewers from auditing code changes. Auto-Heal-MCP emits standard, reviewable unified
.patchfiles in.veriheal/patches/that can be inspected, committed, or rejected by human developers.
8-Scenario Chaos Benchmark Scorecard
Auto-Heal-MCP was evaluated against an 8-scenario controlled chaos checkout suite simulating real-world UI refactors and P0 application regressions.
The table below reflects real, verified terminal output from npm run eval:offline (with process.env.VERIHEAL_OFFLINE = '1'):
Scenario | Category | Classifier Verdict | Outcome Status | Mode | Blast Specs Verified | Duration | Result |
|
|
|
|
| 2 specs | 13,891 ms | PASS |
|
|
|
|
| 2 specs | 11,800 ms | PASS |
|
|
|
|
| 2 specs | 11,561 ms | PASS |
|
|
|
|
| 2 specs | 11,814 ms | PASS |
|
|
|
|
| none | 7,879 ms | PASS |
|
|
|
|
| none | 7,294 ms | PASS |
|
|
|
|
| none | 7,239 ms | PASS |
|
|
|
|
| none | 7,441 ms | PASS |
Summary Metrics
Refactors Healed: 4 / 4 (100.0%) (all valid UI refactors repaired and verified against dependent specs)
P0 Bugs Blocked: 4 / 4 (100.0%) (zero attempts to heal broken payment gateways, crashes, or mismatched totals)
False-Green Rate: 0.0% (0 / 4) (strict gate met: not a single regression was falsely masked)
Overall Accuracy: 100.0%
Disk File Integrity: PASSED (Zero disk drift)
(Note: When local Ollama is active with qwen2.5-coder:7b, UI refactors heal via ollama-live mode; under CI or when Ollama is offline, the deterministic semantic ARIA matcher resolves 100% of candidate locators without network).
MCP Server Tools Reference
The MCP Server communicates over stdio without external API keys or nested LLM calls.
Tool Name | Input Schema | Description |
|
| Retrieves and parses |
|
| Pure deterministic classifier assigning failure categories ( |
|
| Runs TypeScript Compiler API AST invariant validation (syntax, multiset assertion preservation, skip prevention). |
|
| Safely validates patch against path traversal, tests across all dependent specs in-place, and restores original files. |
Connecting via OpenCode (opencode.json)
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"auto-heal-mcp": {
"type": "local",
"command": ["npx", "tsx", "src/mcp/server.ts"],
"enabled": true
}
}
}Quickstart & Verification Commands
Prerequisites
Node.js 22+
npm 10+
(Optional) Ollama running
qwen2.5-coder:7blocally for live LLM healing.
Installation
# Clone the repository and install dependencies
npm ci
# Install Playwright browser binaries
npx playwright install chromiumRunning the Test Suite
# 1. Verify TypeScript types
npm run typecheck
# 2. Run core unit tests (redactor & classifier)
npm run test:unit
# 3. Run AST guardrail & unified diff tests
npm run test:guardrail
# 4. Run baseline Playwright specs (100% passing baseline)
npm run test:baseline
# 5. Run end-to-end MCP stdio verification (all 4 tools tested over stdio)
npm run test:mcp
# 6. Run the full 8-scenario Chaos Benchmark (Offline Mode)
npm run eval:offline
# 7. Run the full 8-scenario Chaos Benchmark (Online Ollama Mode)
npm run evalScope & v2 Roadmap
v1 Focus: Page Object Model (POM) locator healing, web-first ARIA matching, AST assertion invariants, single-file blast-radius verification.
v2 Roadmap:
Multi-file atomic patch verification (refactors touching both POM and test specs simultaneously).
Visual regression gate using pixelmatch / Playwright visual snapshot diffs.
Bidirectional git PR integration and automated PR comments.
License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Browser-backed QA with evidence and fix-ready reports for coding agents.
Approved test intent, reviewed Playwright automation and run evidence, inside your editor.
Preflight QA for AI-agent deliverables with structured verdicts and repair guidance.
Remote MCP tools for 3-vendor AI workflow diagnostics, HAR sandboxes, 50v audits, and rubrics.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables AI agents to perform one-shot triage of Playwright trace files, pinpointing root causes like backend API failures or locator issues and generating self-healing code fixes in a single low-token call.4MIT
- AlicenseAqualityBmaintenanceEnables AI agents to run, debug, and inspect Playwright end-to-end tests, returning structured pass/fail stats, failure diagnostics with actionable fix hints, live DOM inspection, selector validation, visual diffs, and flakiness verdicts instead of raw test output.11MIT
- AlicenseNot gradedqualityCmaintenanceExposes 11 agent-native QA tools over stdio so coding agents can discover a project, analyze risk, select the smallest relevant test set, generate and dry-run tests, triage failures, propose tiered heals, analyze flakes, generate quality reports, and evaluate release readiness. Planning and healing tools stay read-only or propose-only, while execution defaults to dry-run, keeping agent actions safe and evidence-backed.MIT
- AlicenseAqualityCmaintenanceEnables AI clients to reproduce reported UI issues in an isolated, policy-restricted browser context, gather sanitized evidence, distinguish observed facts from candidate causes, and produce structured reports plus reviewable Playwright regression tests.7MIT