Deterministic, offline root-cause analysis and pre-commit fix verification for coding agents.
io.github.noordeen123/culprit MCP Server
This MCP server provides deterministic, offline root-cause analysis and pre-commit fix verification for coding agents. It targets static-analysis and regression-style workflows, including git-blame context and coding-agent use cases. The project is associated with Model Context Protocol (“mcp” / “mcp-server”) and supports developer tooling for CLI and CI pipelines.
🛠️ Key Features
Deterministic offline root-cause analysis
Pre-commit fix verification
Static-analysis and regression checks
Git integration via git-blame
Tagged for MCP (“mcp”, “mcp-server”, “model-context-protocol”)
🚀 Use Cases
Root-cause analysis during coding-agent workflows
Code review assistance with git blame information
Pre-commit validation for proposed fixes
Pull-request related workflows (topics include “pull” and “ci”)
⚡ Developer Benefits
Works for coding agents and subagents
CLI-focused and CI-ready workflow support
Python-related tooling (topics include “python”)
Git-focused diagnostics for coding changes
⚠️ Limitations
No explicit limitations are provided in the available source excerpt.
Root-cause analysis for agent-driven development.
Your coding agent finds what introduced a bug, and verifies its own fix is complete before it commits.
A real run. The fix patched one caller of parse_config and missed two, so it scores partial.
Why an agent needs this
An agent is good at writing a patch and bad at knowing whether the patch is done.
It cannot see that the helper it just changed has three other callers, or that the bug
it is fixing was introduced by a refactor two years ago. culprit answers both from git
history, as structured JSON it can act on rather than prose it has to interpret:
The agent asks
culprit answers
"What introduced this bug?"
Ranked suspect commits, the author's intent, the releases it shipped in
"Is my fix complete?"
verify_fix: missed call sites, whether a test shipped, a risk level
⚡️ Instant. No test runs, no bisect. It blames the fix's own lines back through refactors.
🔒 Read-only and offline. Never writes to your repo or PR. No API key, no network.
🔌 MCP-native. 11 tools over stdio, on the official MCP registry, plus a one-command plugin.
🗣️ Language-agnostic. Suspects work anywhere git does. Blast radius reads 12 language families.
Does it actually work?
Benchmarked against 50 real regressions, 25 from git and 25 from
systemd, where the introducing commit is known from each
fix's Fixes: trailer (author-verified ground truth). Given only the fix commit, culprit blames
the removed lines to rank the commits that introduced the bug.
Metric
Result
Introducing commit ranked #1
50% (25/50)
Introducing commit in the top-5 suspect set
66% (33/50)
Deterministic and offline, on large C codebases the engine has never seen. Reproduce with
python benchmarks/run.py, which clones the repos and scores every case.
Quick start
Claude Code plugin (installs the MCP server plus a skill that tells the agent when to use it):
RCA straight from a stack trace, no diff or PR needed
verify_fix, the pre-commit gate
The agent runs this on its own diff before committing:
verdict: complete when no untouched call site is left behind, partial when one was
missed, risky when risk is high. The verdict is the completeness axis; test coverage is
the separate confidence axis on risk_level.
untouched_references: the exact files that still use the changed symbol. This is the
list the agent goes and patches.
skipped_symbols, adds_test, notes: what was too widely used to check, whether
a test shipped, and what to do next.
Loop until complete, then commit. That is the whole idea.
CLI and CI
bash
rca # current branch vs the configured base
rca --last # the latest commit only
rca --pr 16786 # a specific PR (uses the PR's own base)
rca --trace crash.txt # RCA from a stack trace, no fix or PR needed
rca --verify-fix patch.diff # check a diff before committing
rca --select-tests # print the tests to run for this change
rca --html report.html --open # a single self-contained HTML report
rca --pr 16889 --fail-on high # exit non-zero when QA risk is high
rca serve --repo /path # local web UI with a base picker
--html writes one self-contained file. No CDN, opens offline, attaches to CI. It opens with the
verdict: a scored QA risk with the factors behind it, and the prime suspect with how long the bug
lived.
Then it reconstructs how the bug got there. Every commit that touched the buggy line, from
creation through the commit that broke it (red, with the exact diff) to the fix (green):
--bisect "<cmd>" runs a real bisect as an optional confirmation layer, in a throwaway
git worktree so your checkout is never touched. When the first failing commit matches the
blamed suspect, the report stamps it confirmed by git bisect.
Architecture
One normalized context in, one structured JSON result out. The only non-deterministic step
is the optional LLM narrative, isolated behind an adapter so the engine runs with no API key.
Two lanes, one engine. Every module writes one slice of the result, so nothing cares whether
the target came from gh, the REST API, local git, or a pasted stack trace. Full module map:
docs/ARCHITECTURE.md.
Configuration
The base branch resolves in order: the --base flag, then CULPRIT_BASE, then .culprit.toml
(base = "origin/main"), then HEAD~1. --last forces the latest-commit view.
PR titles and labels use the GitHub CLI when present, or the unauthenticated REST API for public
repos (set GITHUB_TOKEN or GITLAB_TOKEN to raise limits). Deep links cover GitHub, GitLab,
Bitbucket, and Gitea. Blast radius reads imports across JS/TS, Python, Go, Java/Kotlin, Ruby,
C/C++, C#, PHP, Rust, Scala, and Swift.