grep + Reptar = Greptar. Find the mutations before they find you.
Greptar is a mutation-based code verification server that speaks MCP. It hunts bugs by injecting mutations into your code and measuring whether your tests and reviews catch them.
Two modes, one scoring matrix:
- Semantic mutations — AI-crafted realistic bugs a human might actually write
- Mechanical mutations — automated operator swaps via cargo-mutants for breadth
What survives is what you should worry about.
┌─────────────────────────────────┐
│ Scoring Matrix │
├──────────────┬───────────────────┤
│ │ Review catches it? │
│ ├────────┬──────────┤
│ │ Yes │ No │
├──────────────┼────────┼──────────┤
│ Tests Yes │ Strong │ReviewGap │
│ catch No │TestGap │BlindSpot │
│ it? │ │ │
└──────────────┴────────┴──────────┘
- Strong — both tests and review catch it. You're covered.
- TestGap — review catches it but tests don't. Write a test.
- ReviewGap — tests catch it but review missed it. Sharpen your eye.
- BlindSpot — nobody catches it. Highest priority.
- Rust (2024 edition)
- ripgrep (
rg) — for thescantool - cargo-mutants — for the
mutantstool (optional)
cargo build --releaseAdd to your MCP client config (e.g. Claude Code's settings.json):
{
"mcpServers": {
"greptar": {
"command": "/path/to/greptar/target/release/greptar",
"args": []
}
}
}scan → read context → generate plan → plan → execute_plan → score
scan— discover mutation targets with ripgrep- Read surrounding context for each target
- Generate a mutation plan (realistic bugs a human might write)
plan— load the mutation planexecute_plan— run all mutations in one call (recommended) — or use the interactive loop:inject→test→record→revertscore— view the detection matrix
mutants → score
mutants— run cargo-mutants on specific filesscore— view results (merged with any semantic results)
Both workflows feed the same scoring matrix. Run them together for depth + breadth.
| Tool | Purpose | Phase |
|---|---|---|
scan |
Discover mutation targets via ripgrep | Idle → Scanned |
plan |
Load a mutation plan | Scanned → Planned |
inject |
Apply a mutation to the codebase | Planned → Injected |
test |
Run tests against injected mutation | Injected |
record |
Record test/review outcome | Injected |
revert |
Undo injected mutation via git | Injected → Planned |
execute_plan |
Batch-run all mutations automatically | Planned → Planned |
mutants |
Run cargo-mutants for mechanical mutations | Any* → Planned |
score |
View the detection matrix | Any |
status |
Check current phase | Any |
reset |
Clear state and start over | Any (not Injected) |
Idle → (scan) → Scanned → (plan) → Planned → (inject) → Injected → (revert) → Planned
↑ │
└──────────────────────────────────────────┘
Reptar is a fictional mutant dinosaur from Rugrats — a radioactive T-Rex that's equal parts terrifying and beloved. Greptar is grep + Reptar: it greps through your code to find where mutations can hide, then stomps on the ones your tests miss.
Mutation testing is about finding what survives. Greptar makes sure nothing does.
MIT
