Multi-language code analysis for complexity, debt, hotspots, ownership, and defect prediction
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Your AI writes code without knowing where the landmines are.
Omen gives AI assistants the context they need: complexity hotspots, hidden dependencies, defect-prone files, and self-admitted debt. One command surfaces what's invisible.
Why "Omen"? An omen is a sign of things to come - good or bad. Your codebase is full of omens: low complexity and clean architecture signal smooth sailing ahead, while high churn, technical debt, and code clones warn of trouble brewing. Omen surfaces these signals so you can act before that "temporary fix" celebrates its third anniversary in production.
There are two types of complexity:
Cyclomatic Complexity counts the number of different paths through your code. Every if, for, while, or switch creates a new path. A function with cyclomatic complexity of 10 means there are 10 different ways to run through it. The higher the number, the more test cases you need to cover all scenarios.
Cognitive Complexity measures how hard code is for a human to read. It penalizes deeply nested code (like an if inside a for inside another if) more than flat code. Two functions can have the same cyclomatic complexity, but the one with deeper nesting will have higher cognitive complexity because it's harder to keep track of.
Why it matters: Research shows that complex code has more bugs and takes longer to fix. McCabe's original 1976 paper found that functions with complexity over 10 are significantly harder to maintain. SonarSource's cognitive complexity builds on this by measuring what actually confuses developers.
[!TIP] Keep cyclomatic complexity under 10 and cognitive complexity under 15 per function.
When developers write TODO: fix this later or HACK: this is terrible but works, they're creating technical debt and admitting it. Omen finds these comments and groups them by type:
| Category | Markers | What it means |
|---|---|---|
| Design | HACK, KLUDGE, SMELL | Architecture shortcuts that need rethinking |
| Defect | BUG, FIXME, BROKEN | Known bugs that haven't been fixed |
| Requirement | TODO, FEAT | Missing features or incomplete implementations |
| Test | FAILING, SKIP, DISABLED | Tests that are broken or turned off |
| Performance | SLOW, OPTIMIZE, PERF | Code that works but needs to be faster |
| Security | SECURITY, VULN, UNSAFE | Known security issues |
Why it matters: Potdar and Shihab's 2014 study found that SATD comments often stay in codebases for years. The longer they stay, the harder they are to fix because people forget the context. Maldonado and Shihab (2015) showed that design debt is the most common and most dangerous type.
[!TIP] Review SATD weekly. If a TODO is older than 6 months, either fix it or delete it.
SATD is debt a developer chose to keep; a stub is work that was never finished - the kind of thing an agent or human leaves behind mid-task. Omen finds stubs via tree-sitter AST analysis (never plain string matching, so string literals containing trigger words are never false positives) and groups them by pattern type:
| Category | Severity | What it means |
|---|---|---|
not_implemented | High | Explicit not-implemented idioms: todo!(), raise NotImplementedError, throw new Error('not implemented') |
elision | Medium | Comments admitting skipped work: // ... rest of the implementation, // placeholder, // your code here |
empty_body | Medium | A function/method with an empty body that can't legitimately be empty (non-void return type, or an elision comment inside) |
Why it matters: Unfinished work that looks complete (it compiles, it's committed) is more dangerous than code that's obviously missing - nothing signals it needs attention until it's called in production. Stubs feed into the composite health score's debt component alongside SATD, so unresolved stubs lower your repo's score just like unresolved TODOs do.
[!TIP] Add
omen stubs --gate errorto CI to block merges that leavetodo!()orNotImplementedErrorbehind.
Dead code includes:
return statement that can never executeWhy it matters: Dead code isn't just clutter. It confuses new developers who think it must be important. It increases build times and binary sizes. Worst of all, it can hide bugs - if someone "fixes" dead code thinking it runs, they've wasted time. Romano et al. (2020) found that dead code is a strong predictor of other code quality problems.
[!TIP] Delete dead code. Version control means you can always get it back if needed.
Churn looks at your git history and counts:
Files with high churn are "hotspots" - they're constantly being touched, which could mean they're:
Why it matters: Nagappan and Ball's 2005 research at Microsoft found that code churn is one of the best predictors of bugs. Files that change a lot tend to have more defects. Combined with complexity data, churn helps you find the files that are both complicated AND frequently modified - your highest-risk code.
[!TIP] If a file has high churn AND high complexity, prioritize refactoring it.
There are three types of clones:
| Type | Description | Example |
|---|---|---|
| Type-1 | Exact copies (maybe different whitespace/comments) | Copy-pasted code |
| Type-2 | Same structure, different names | Same function with renamed variables |
| Type-3 | Similar code with some modifications | Functions that do almost the same thing |
Why it matters: When you fix a bug in one copy, you have to remember to fix all the other copies too. Juergens et al. (2009) found that cloned code has significantly more bugs because fixes don't get applied consistently. The more clones you have, the more likely you'll miss one during updates.
[!TIP] Anything copied more than twice should probably be a shared function. Aim for duplication ratio under 5%.
Omen combines multiple signals to predict defect probability using PMAT-weighted metrics:
Each file gets a risk score from 0% to 100%.
Why it matters: You can't review everything equally. Menzies et al. (2007) showed that defect prediction helps teams focus testing and code review on the files most likely to have problems. Rahman et al. (2014) found that even simple models outperform random file selection for finding bugs.
[!TIP] Prioritize code review for files with >70% defect probability.
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/omen)<a href="https://allmcps.com/mcp/omen"><img src="https://allmcps.com/api/badge/omen?style=directory" alt="Omen on AllMCPs" /></a>