gitrisk-mcp
Provides tools for analyzing a local Git repository's history, including hotspot scoring, change coupling, expert ownership and bus factor, and release notes generation from commit history.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MCP Server: Git Risk Analytics, The Hard Way
Build an MCP server that answers the questions a new teammate asks about a codebase:
which files are the riskiest, who actually knows them, which files secretly change
together, and what would we lose if one person left? Start from git log bytes and end
with an agent calling your tools over MCP.
At the end you will have built a small version of gitrisk-mcp yourself, and you will understand the parts that tutorials about "wrap an API in a tool" skip: parsing a tool's output without being fooled by it, scoring with defensible maths, and proving that a read-only server really is read-only.
Why this exists
Generic git MCP servers expose status, diff and commit. Those answer "what is
happening now". Almost every hard question about an old codebase is about history:
Where do bugs live? Files that change a lot, recently, by many hands.
Who should review this? Not the person with the most commits (they may have run a formatter) but whoever's lines survive in the file today.
What breaks when I touch this? Files that always change in the same commit.
What if Dana leaves? Directories where one person holds most of the knowledge.
None of that is hard maths. The hard part is the data: renames, merge commits, reformat
commits that touch 4,000 files, binary files, .mailmap, shallow clones. Each module
adds one piece and a main.py that builds a real git repository with scripted commits
and asserts exact numbers.
Related MCP server: Wendy - Codebase Q&A Agent
Modules
# | Module | You build | Key idea |
01 |
| Argument lists, control-character separators, refs are untrusted input | |
02 |
|
| |
03 |
| Churn x exponential recency decay x author breadth; mass commits | |
04 |
| Support, confidence, reverse confidence | |
05 |
| Surviving lines vs recent work; "more than half" | |
06 |
| Conventional commits, PR numbers, merge commits | |
07 |
| Tool design, errors, |
Run it
You need Python 3.10+ and git on your PATH. Nothing else is installed globally.
python -m venv .venv
.venv/Scripts/activate # Windows PowerShell: .venv\Scripts\Activate.ps1
pip install -r requirements.txt
python verify.py # builds a real repo per module and checks every number
python verify.py 03 05 # just some modulesOr run one module on its own: python 03-hotspot-scoring/main.py.
The demo repository
Every module analyses the same six-commit history built by demo_repo.py
with explicit authors and dates, so all numbers can be checked with a pencil:
c1 alice 2026-01-05 feat: initial core app/core.py +10 app/util.py +4 README.md +2
c2 bob 2026-01-12 fix: edge case (#1) app/core.py +5 app/util.py +2
c3 alice 2026-01-19 feat(api): routes (#2) app/core.py +3 api/routes.py +6 <- tag v0.1
c4 carol 2026-02-02 docs: explain routes api/routes.py +4
c5 bob 2026-02-09 refactor: tidy app/core.py +2 app/util.py +1
c6 carol 2026-02-16 style: reformat everything vendor/f00..f11.txt +1 each, app/core.py +1c6 is the villain: a mass "reformat" commit that touches 13 files and would wreck every
statistic if we let it.
How each module works
The concept, with the reason behind each design choice.
The code: small enough to read in one sitting, all of it in
minirisk/.main.py: runs the code against a real repository and checks the results withassert.break-it.md: experiments that make the code fail on purpose, so you see why each guard exists.
License
MIT.
This server cannot be deployed
Maintenance
Related MCP Connectors
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Codebase intelligence for AI agents — dead code, blast radius, ownership.
Search indexed code, trace dependencies, assess change impact, and recall repository memory.
Your team's shipping standards, org map and delivery metrics, inside your coding agent.
Related MCP Servers
- FlicenseBqualityDmaintenanceProvides AI coding agents with structured Git repository context including project state, code structure, activity, and risk analysis without modifying or uploading code.53-
- AlicenseBqualityAmaintenanceCodebase Q&A agent with git-history awareness. Explore a repo with list_files, read_file, and search, plus git log, blame, and diff and a repo map to answer "why did this change?" questions. Runs locally as an MCP server for Claude Code and other MCP clients.11MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to turn local git history into answers about recent activity, file hotspots, change coupling, stale or already-merged branches, contributors, ref comparisons, and drafted release notes. It runs locally over stdio with a git subcommand allowlist, so it is read-only, works offline and without shell access, and is safe to auto-approve.1363 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables coding agents to query a codebase's git-history coupling graph to find blast radius, missing coupled files, explain why files change together via PRs/issues, and report how much of the graph was inspected.383 npm1MIT