
Test Genie
io.github.MUSE-CODE-SPACE由 GitHub 帳號 MUSE-CODE-SPACE 發布v2.0.3更新於 Oct 24, 2026
AI-powered app test automation for iOS, Android, Flutter, React Native, Web
概覽
一個 MCP 伺服器,用來掃描 iOS、Android、Flutter、React Native 與 Web 專案中的缺陷、安全性問題與競態條件,並提出與套用修正。
- 可以做什麼
- Test Genie 提供 23 個用於應用程式測試自動化與程式碼分析的工具。主打工具 diagnose_project 會快速掃描並回傳依優先順序排序的問題清單,例如硬編碼金鑰、SQL 注入、競態條件、記憶體洩漏與效能問題。其他工具可偵測記憶體洩漏、邏輯錯誤、競態條件與安全性問題,提出並套用含備份的修正、回復變更、執行情境與壓力測試,以及產生報告與 CI/CD 設定。run_iterative_fix_loop 工具會串起偵測、試跑、修補、重跑測試與回歸回復。
- 適用情境
- 適合在提交前快速檢查行動或跨平台應用程式有哪些問題,也適合讓助理提出並套用小型機械式修正,再透過重跑測試加以驗證。它面向開發回饋循環,不適用於正式上線的把關或合規等級的安全稽核。
- 執行需求
- 以 npm 套件(test-genie-mcp)透過 stdio 在本機執行,僅限桌面端,需要 Node.js。選用環境變數包括用於限制檔案存取的 TEST_GENIE_ALLOWED_ROOT、用於存放歷史記錄的 TEST_GENIE_STORAGE_DIR,以及用於選用 LLM 修正策略的 ANTHROPIC_API_KEY 或 OPENAI_API_KEY。安裝 swiftc、kotlinc、javac 或 dart 等平台編譯器可提升語法驗證效果。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Test Genie,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
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.
[npm version] [CI] [License: MIT] [MCP]
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):
Claude calls diagnose_project under the hood. ~30 seconds later you see:
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.
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:
This 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
Expected output (truncated):
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
See docs/ITERATE_FIX_LOOP.md for a sequence diagram and the full safety-guard list.
Tools (23)
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):
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):
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
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
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
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.
來源:README.md,提交 6f17d84
工具
0版本歷史
1- v2.0.3最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分