test-genie-mcp
Provides test automation and self-healing fix capabilities for Android apps, including detection of race conditions, memory leaks, and security issues.
Analyzes Dart code for issues such as missing super.dispose() calls and provides syntax-validated fixes for Flutter apps.
Automates Flutter widget testing and applies fixes such as adding missing dispose() overrides for AnimationController.
Provides test automation and self-healing fix capabilities for iOS apps, including detection of retain cycles and closure capture in Swift.
Detects and suggests fixes for Kotlin concurrency issues like MutableStateFlow mutated off Dispatchers.Main and Flow collected without proper context.
Detects and fixes React-specific issues such as useState setters called after await without mount guards and missing useEffect cleanup.
Detects and suggests fixes for Swift concurrency issues like @Published mutation outside @MainActor and concurrent DispatchQueue writes without barrier.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@test-genie-mcp vibe check my app"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
test-genie-mcp
Built for vibe coders: one command, get a prioritized list of what's actually broken about your project.
Self-healing test automation for iOS, Android, Flutter, React Native and Web apps — as an MCP server.
v3.1.1 — vibe-check + honest auto-fix. One MCP call, ~30 seconds: race conditions + security issues + memory leaks + logic errors + perf smells, prioritized. Stays on your machine, no telemetry. Pass
autoFix: truefor the small, safe mechanical fixes (weak-hash, simpleMath.randomassignment) — backup + syntax-validate + rollback-on-syntax-fail. For test-verified application of harder fixes, use v3.0.0's iterate-fix loop.
Vibe coders quickstart
You don't read the docs. You open the project, talk to Claude, and want a verdict. Here it is:
In Claude (with test-genie-mcp installed — setup):
/vibe-check /Users/me/my-appClaude calls diagnose_project under the hood. ~30 seconds later you see:
# vibe-check report
- Project: /Users/me/my-app
- Platform: web
- Findings: 11 total — 4 critical, 4 high, 1 medium, 1 low
- Estimated fix time: ~85 min
## Top 5 issues
### 1. [CRIT] Hardcoded AWS access key id found in source
- File: `server.js:7`
- Category: security / secret (CWE-798)
- Confidence: 95%
- Fix: Move the value to an env var, gitignore the config, rotate the leaked key.
### 2. [CRIT] SQL string built by concatenating user input
- File: `server.js:21`
- Category: security / injection (CWE-89)
- Fix: Use parameterized queries (`db.query("... WHERE id = ?", [id])`).
### 3. [HIGH] useState setter called after await without mount guard
- File: `UserProfile.tsx:16`
- Category: race-condition / react-setstate-after-await (CWE-362)
- Confidence: 78%
- Fix: Use AbortController and check signal.aborted before calling setters.
… (top 5 shown — full list at output: "detailed")
## Next steps
1. Address the critical / high findings above.
2. Re-run diagnose_project after fixing to confirm convergence.
3. Use run_iterative_fix_loop for test-driven verification of each fix.If any finding is autoFixable: true and is at high/critical severity, the diagnose_project call accepts autoFix: true to apply the mechanical replacement directly (with backup + syntax validation — see SAFETY.md for the exact guards). The v3.1.1 honest scope is narrow: weak hash (createHash('md5'|'sha1') → createHash('sha256')) and standalone Math.random() in security-sensitive files. For broader/structural fixes (race conditions, eval, exec injection) run run_iterative_fix_loop separately — it re-runs tests and auto-rolls-back on regression.
Related MCP server: mcp-lab-agent
Why test-genie?
The bottleneck in mobile + cross-platform test automation isn't writing tests — it's the loop between a failing test and a passing test. test-genie closes that loop:
failing test → analyzer flags issue → fix proposed → dry-run + syntax check →
applied with backup → affected tests re-run → regression check → loop or stopThis full loop is the run_iterative_fix_loop tool. The diagnose_project autoFix: true path in v3.1.1 covers a strict subset — backup + dry-run + syntax-validate + apply, without re-running tests (so no test-regression rollback in that path). Use the right tool for the job — and see SAFETY.md for the exact guards on each.
Other tools (Detox, Maestro, Playwright, xcodebuild test) run tests. test-genie runs tests and drives the fix until the bar is met or it can no longer make progress — without you scrubbing through stack traces.
5-minute Quickstart
# 1. Install
npm install -g test-genie-mcp
# 2. Add to Claude Desktop config (~/.config/claude/claude_desktop_config.json)
{
"mcpServers": {
"test-genie": {
"command": "npx",
"args": ["test-genie-mcp"],
"env": {
"TEST_GENIE_ALLOWED_ROOT": "/path/to/your/project"
}
}
}
}
# 3. Restart Claude Desktop. From a chat:
# "Run the iterate-fix loop on /Users/me/my-rn-app with autoApply=false"Expected output (truncated):
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Iterative fix loop f8b3… — PAUSED-FOR-CONFIRMATION
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Iterations completed: 1
Fixes applied: 0
Regressions rolled back: 0
Final tests: 7/10 passing (3 failing)
Pending confirmations (3):
- 71fbe…: Fix: useEffect missing cleanup for setInterval (confidence: 85)
- 92ad1…: Fix: Force-unwrap on possibly-undefined name (confidence: 85)
- …
Resume token: f8b3…Re-call with autoApply: true (or resumeToken: "f8b3…") to actually patch the files.
Real use cases
The flows below describe the
run_iterative_fix_looppath (v3.0 headline) — full detect → propose → dry-run → apply-with-backup → re-run-tests → rollback-on-regression. Thediagnose_project autoFixpath in v3.1.1 is the narrower mechanical-replacement-only path; see SAFETY.md §4 for what that one actually touches.
1. React Native memory-leak self-healing
A team adds setInterval(...) in a useEffect and forgets cleanup. test-genie's detect_memory_leaks flags it, suggest_fixes proposes return () => clearInterval(id) (src/tools/fixing/suggestFixes.ts:169-179), the loop dry-runs the patch through the TS compiler, applies with backup, re-runs only the affected snapshot test, confirms 100% pass, stops. Before: 1 failing snapshot. After: 0 failing, 1 fix applied, 1 backup at .test-genie-backups/.
2. Flutter widget dispose() automation
AnimationController left undisposed. test-genie sees the missing dispose() override, generates a Dart @override dispose() { controller.dispose(); super.dispose(); } block (suggestFixes.ts:214-217), runs dart analyze on the patched file, applies, re-runs flutter test, converges.
3. iOS retain-cycle (closure capture)
self.timer = Timer.scheduledTimer(...) { _ in self.tick() } — rule-based detector flags closure self-capture, fixer rewrites to [weak self] _ in guard let self = self else { return }; self.tick() (suggestFixes.ts:239-242). If swiftc is on PATH the syntax check is real; otherwise test-genie reports "downgraded validation" so you know.
How the iterate-fix loop works
┌────────────────────┐
│ collect tests │ (run_scenario_test / supplied list)
└─────────┬──────────┘
│
pass-rate ≥ threshold? ── yes ──▶ SUCCESS
│ no
▼
┌────────────────────┐
│ detect issues │ memory + logic analyzers
└─────────┬──────────┘
│
┌────────────────────┐
│ suggest fixes │ rule-based (default) → LLM (hybrid, optional)
└─────────┬──────────┘
│
┌────────────────────┐
│ dry-run + syntax │ TS compiler API / platform compiler / brace check
└─────────┬──────────┘
│
┌────────────────────┐
│ apply with backup │ per-file `.test-genie-backups/`
└─────────┬──────────┘
│
┌────────────────────┐
│ re-run tests │ regression? yes → auto-rollback
└─────────┬──────────┘
│
▼
loop (≤ maxIterations, ≤ totalTimeout)See docs/ITERATE_FIX_LOOP.md for a sequence diagram and the full safety-guard list.
Tools (23)
# | Tool | Mode |
1 |
| real |
2 |
| real |
3 |
| real |
4 |
| hybrid |
5 |
| simulated |
6 |
| hybrid |
7 |
| real |
8 |
| real |
9 |
| real |
10 |
| real |
11 |
| real |
12 |
| real |
13 |
| hybrid |
14 |
| hybrid |
15 |
| real |
16 |
| real |
17 |
| real |
18 |
| real |
19 |
| real |
20 |
| real |
21 |
| real |
22 |
| real |
23 |
| real |
mode legend in docs/SIMULATION_VS_REAL.md.
Plus 4 resources (test-genie://iteration-logs, …/test-history/{path}, …/iteration-logs/{loopId}, …/applied-fixes/{path}) and 3 prompts (full-test-pipeline, diagnose-failure, vibe-check).
What vibe-check catches
Race conditions (detect_race_conditions / diagnose_project):
Pattern | Language | Severity | Auto-fixable (v3.1.1) |
| TS/JS/React | high | no (structural) |
| TS/JS/React | high | no (structural) |
| TS/JS | medium | no (ordering-sensitive) |
Adjacent fetches without | TS/JS | medium | no |
TOCTOU: | TS/JS Node | medium | no |
Non-atomic counter increment in async context | TS/JS | low | no |
| Swift | medium | no |
Concurrent | Swift | medium | no |
| Kotlin | medium | no |
| Kotlin | low | no |
Goroutine + shared map without | Go | high | no |
v3.1.1 honesty audit:
useEffect-no-abortandforEach-awaitwere previously advertised as auto-fixable. They are not — wrapping withAbortControlleror rewriting toPromise.all(arr.map(...))changes behavior we can't verify statically. They are now report-only. See SAFETY.md.
Security (detect_security_issues / diagnose_project):
Pattern | Severity | CWE | Auto-fixable (v3.1.1) |
Hardcoded AWS / Stripe / GitHub / Google / Slack token | critical / high | CWE-798 | no (rotate) |
Hardcoded JWT secret literal | high | CWE-798 | no |
API token in URL query string | high | CWE-200 | no |
| high | CWE-538 | no (rotation must follow) |
SQL string concat with | critical | CWE-89 | no |
| high | CWE-79 | no |
| critical | CWE-95 | no |
| high | CWE-338 | yes ( |
| high | CWE-338 | no (semantic) |
| high | CWE-327 | yes ( |
| medium | CWE-327 | no (below severity floor) |
| critical | CWE-78 | no |
| high | CWE-918 | no |
CORS | high | CWE-942 | no |
Cookie set without | low | CWE-1004 | no |
| medium | CWE-502 | no |
v3.1.1 honesty audit:
.env/Math.random(general)/yaml.loadwere previously advertised as auto-fixable. They were either too risky to rewrite blindly or no strategy shipped — flipped to report-only. See SAFETY.md §5.
What vibe-check misses (honest list)
This is a "catch the obvious stuff in 30s" filter, not Snyk / Semgrep / a full SAST tool. We don't catch:
Cross-file data-flow. If user input flows through three files before reaching a
db.query, the regex won't connect the dots. A real SAST traces taint across the call graph. Roadmap: ts-morph reference walking for top-N entry points.Vulnerable transitive deps. We don't query npm advisories — that's
npm audit's job, and bundling a stale advisory list would lie. Runnpm audit --jsonin parallel if you want dep-CVE coverage.Race conditions across processes. We catch in-process JS / Swift / Kotlin / Go races. Distributed races (lock ordering across services, DB transactions) need different tooling.
Type-correct but logic-broken code. The analyzer is syntactic, not semantic. A
Math.random()namedgetNoncewon't fool us; a properly-namedcrypto.randomBytesused with a tiny entropy budget will.Custom secret formats. Internal company tokens with unique prefixes need a regex you can add to
securityAnalyzer.SECRET_PATTERNS. PR welcome.Real-time / dynamic issues. Memory leaks under load, network timeouts, slow renders mid-interaction — those need
run_stress_test/run_simulation, not static analysis.
If you want deeper coverage on top of vibe-check: feed the findings into run_iterative_fix_loop for test-verified application, or escalate to Snyk / Semgrep / GitHub Advanced Security for compliance use cases.
vibe-check vs alternatives
vibe-check (test-genie) | Snyk | Semgrep | GitHub Advanced Security | |
Runs locally | yes | hybrid (cloud) | yes | no (cloud) |
Telemetry-free | yes (zero network calls) | no | partial | no |
Fix loop integration | yes ( | no | no | no |
Race-condition detection | yes (JS/Swift/Kotlin/Go) | no | partial | partial |
Cross-file taint flow | no (roadmap) | yes | yes | yes |
Setup time | none (already installed if test-genie is installed) | account + auth | install + ruleset | repo-level enable |
If your goal is "before I commit, what's broken?", vibe-check wins on latency. If your goal is "compliance + supply chain audit", use the dedicated tools.
When NOT to use test-genie
Production-gate test runs. test-genie is built for the development feedback loop. For shipping decisions, use a proper CI that you control end-to-end.
Code your team must hand-review every line of. The loop's job is to propose and apply fixes; if every fix needs a human eye, leave
autoApply: false(the default) and use it as a fix-proposal generator only.No backup / no version control situations. test-genie's auto-rollback is best-effort and requires the per-file backup to exist. Always run inside a git working tree.
Comparison
test-genie | Detox | Maestro | xcodebuild test | |
Runs E2E / unit tests | ✅ (via Jest/Detox/etc.) | ✅ | ✅ | ✅ |
Detects code issues | ✅ rule + LLM | ❌ | ❌ | ❌ |
Iterative fix loop | ✅ ( | ❌ | ❌ | ❌ |
Auto-rollback on test regression | ✅ inside | ❌ | ❌ | ❌ |
Auto-rollback on syntax failure | ✅ all apply paths | ❌ | ❌ | ❌ |
MCP-native (talks to Claude / agents) | ✅ | ❌ | ❌ | ❌ |
Multi-platform | iOS+Android+Web+Flutter+RN | iOS+Android | iOS+Android | iOS only |
Scope note:
diagnose_project autoFix: truerolls back on syntax-validate failure (applyFix.ts:185-202) but does not re-run tests, so it cannot detect test regressions. For test-driven rollback userun_iterative_fix_loop. See SAFETY.md §2.4.
test-genie uses tools like Jest, Detox, and xcodebuild test under the hood — it sits at the orchestration layer, not the test-runner layer.
Known limitations
Platform syntax check downgrade. For Swift/Kotlin/Java/Dart we try the platform compiler in
-typecheckmode. If the compiler isn't on PATH, we fall back to brace-balance validation and surfacedowngraded: truein the result. Installswiftc/kotlinc/javac/dartfor real validation.LLM is optional and gated.
strategy: 'hybrid'only kicks LLM in when rule-based confidence is below threshold. Without an API key the loop is rule-based-only — no failure.Storage is per-machine. Test history / iteration logs live under
$TEST_GENIE_STORAGE_DIR(defaults to~/.test-genie-mcp). Not synced across machines.Simulated mode is "simulation," not magic.
run_simulationreturns plausible anomalies, not real ones. Userun_scenario_test(hybrid) for real-device runs.
Configuration
Env var | Default | Purpose |
|
| Capability-based path safety — server refuses to read/write outside this root. |
|
| Where scenarios / results / iteration logs live. |
| auto-detect |
|
| — | Used when provider = |
| — | Used when provider = |
|
| Override Anthropic model. |
|
| Override OpenAI model. |
Migrating from v2.x
run_full_automationstill works. TheconfirmMode/autoFixoptions are kept for compatibility butautoApply: booleanis the new way —autoApply: trueis equivalent toconfirmMode: 'auto'.Subprocess hardening means platform tools now reject scheme / device / package-name arguments that contain shell metacharacters. If your CI was passing weird-looking values, sanitize them first.
See CHANGELOG.md for the full breaking-change list + migration recipes.
Roadmap
LLM-based fix-proposal voting (multiple proposals → pick the best by syntax + retest delta)
Multi-repo sync (run the loop across N repos in parallel from one MCP call)
A "watch mode" that runs the loop on file save
Better Detox / Maestro artifact ingestion (link videos into iteration logs)
Contributing
Issues, PRs, and ideas welcome — see CONTRIBUTING.md (TODO). Code lives under src/, tests under tests/. Run npm test before sending a PR.
Maintainer
@MUSE-CODE-SPACE — Yoonkyoung Gong.
License
MIT — see LICENSE.
Available Tools
23 toolsanalyze_app_structureC
[mode: real] Static analysis of the project: screens, components, APIs, state. Auto-detects platform when not provided.
Inputs: projectPath (required), depth, platform.
analyze_code_deepC
[mode: real] Deep AST analysis: functions, complexity, hooks, issues.
Inputs: projectPath (required), platform.
analyze_performanceC
[mode: real] Static performance analysis: rendering, computation, bundle.
Inputs: projectPath (required), platform.
apply_fixA
[mode: real] Apply a confirmed fix. backup=true, validate=true by default. Supports dryRun.
Inputs: fixId (required), backup, dryRun, validate.
confirm_fixB
[mode: real] Confirm / reject / modify a proposed fix prior to apply.
Inputs: fixId (required), action (required), reason, modifiedCode.
create_test_planB
[mode: real] Build a test plan from stored scenarios with filtering / scheduling.
Inputs: name (required), projectPath (required), template, typeFilter, +2 more.
detect_logic_errorsC
[mode: real] Detect race conditions, null refs, state inconsistencies.
Inputs: projectPath (required), checkTypes, analysisDepth.
detect_memory_leaksC
[mode: real] Detect memory leaks, retain cycles, unclosed resources.
Inputs: projectPath (required), analysisType, minLeakSizeMB.
detect_race_conditionsC
[mode: real, v3.1.0] Stand-alone race-condition detector — useState-after-await, missing AbortController, forEach-await, TOCTOU file ops, DispatchQueue races, Flow dispatcher mismatches.
Inputs: projectPath (required), platform.
detect_security_issuesB
[mode: real, v3.1.0] Stand-alone security scanner — hardcoded secrets (AWS/Stripe/GitHub/JWT), SQL/XSS/SSRF/eval injection, weak crypto, CORS misconfig, cookie flags, yaml.load.
Inputs: projectPath (required), platform.
diagnose_projectB
[mode: real, v3.1.0 headline] vibe-check the project — race conditions + security + memory + logic + performance in one parallel sweep. Returns prioritized findings + Markdown summary ready for chat.
Inputs: projectPath (required), checks, output, autoFix, +3 more.
generate_cicd_configC
[mode: real] Generate GitHub Actions / Jenkins / GitLab CI configuration.
Inputs: provider (required), projectPath (required), branches, platform, +3 more.
generate_reportC
[mode: real] Generate Markdown / HTML / JSON test automation report.
Inputs: projectPath (required), format, sections, outputPath.
generate_scenariosC
[mode: real] Generate test scenarios from analyzed app structure.
Inputs: projectPath (required), coverage, testTypes, focusAreas, +1 more.
get_pending_fixesB
[mode: real] List fixes awaiting confirmation for the project.
Inputs: projectPath (required).
get_test_historyC
[mode: real] Recent test executions for the project.
Inputs: projectPath (required), limit.
rollback_fixA
[mode: real] Restore the pre-apply file content from the backup.
Inputs: fixId (required).
run_full_automationD
[mode: hybrid] Analyze → plan → execute → detect → suggest in one call.
Inputs: projectPath (required), autoFix, platform, autoApply, +2 more.
run_iterative_fix_loopA
[mode: hybrid, headline tool] Self-healing test → fix → re-test loop with regression detection, auto-rollback, and resumeToken support. See docs/ITERATE_FIX_LOOP.md.
Inputs: projectPath (required), strategy, autoApply, resumeToken, +5 more.
run_scenario_testB
[mode: hybrid] Run a stored scenario; real subprocess where possible, falls back to simulated.
Inputs: platform (required), scenarioId (required), projectPath (required), device, +2 more.
run_simulationC
[mode: simulated] Random / sequential user-behavior simulation to find issues.
Inputs: duration (required), projectPath (required), intensity, userPatterns, +1 more.
run_stress_testC
[mode: hybrid] Concurrency / load test against an endpoint or UI surface.
Inputs: duration (required), targetType (required), concurrency (required), projectPath (required), +2 more.
suggest_fixesC
[mode: real] Generate rule-based fix suggestions for detected issues.
Inputs: projectPath (required), issueIds, maxSuggestions.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Most tools have distinct purposes (e.g., analyze_app_structure vs analyze_code_deep vs analyze_performance). The main overlap is between the comprehensive diagnose_project and the individual detectors, but their descriptions clearly differentiate them. Slight potential confusion exists between analyze_code_deep and detect_logic_errors due to overlapping 'issues' coverage.
All tool names follow a consistent verb_noun pattern in snake_case (e.g., analyze_app_structure, run_scenario_test, generate_report). The naming convention is uniform across the entire set, with no mixed styles or vague verbs.
23 tools is on the heavier side and falls into the borderline range for a typical MCP server. While the domain is broad and each tool has a role, the redundancy between combined and stand-alone detectors (e.g., diagnose_project vs detect_race_conditions) adds some unnecessary weight.
The tool set covers a full lifecycle: analysis, scenario generation, planning, execution, detection, fixing, reporting, and CI/CD. However, there are minor gaps such as no explicit tools for listing or deleting stored scenarios/test plans, which may require workarounds.
Maintenance
Related MCP Connectors
MCP server for Mint — AI-powered QA that runs your app in a real browser on every PR.
Mozark's MCP server for AI-powered app testing: device access, test automation, and QA insights.
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.
Voice-powered bug reporting with 13 MCP tools. Record bugs by talking; let AI find and fix them.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceAI-powered E2E testing MCP server. Point at a URL — AI generates test scenarios, runs Playwright tests, and self-heals failures automatically. Works on Canvas and Flutter Web apps.91 PyPI7AGPL 3.0
- AlicenseBqualityDmaintenanceAutonomous QA testing MCP server that analyzes, fixes, and learns from test failures. Integrates with IDE and Slack to provide cause and fix in plain language.3118 npmMIT
- AlicenseNot gradedqualityBmaintenanceMCP server for self-healing Selenide + Cucumber regression tests, using AI to fix failed locators and rerun tests.MIT
- AlicenseAqualityDmaintenanceAutomated Playwright E2E test repair powered by a self-improving, governed MCP server that runs failing tests, collects failure artifacts, reasons about root causes, validates and applies fixes, and re-runs to verify.12MIT