git-insight-mcp
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Semantic git queries via MCP. Beyond git log — answer who/what/when/why about any line, file, or branch.
Pairs with terminal-history-mcp and localhost-mcp. Together: what you ran, what's running, what you changed.
Why
Devs ask these constantly; git answers poorly:
- "Who last touched this function?" — git blame only gives lines, not authors-by-region
- "What PR introduced this line?" — manual: blame → commit SHA → search GH
- "Which files always change together?" — no built-in
- "Show unmerged branches older than 30 days" — bash one-liner gymnastics
- "What did I work on last week?" — manual log scrub
LLM agents need this context to make safe edits. Currently they git log -n 5 and miss everything.
Install
Wire into Claude Code:
Or any MCP-compatible client. Runs as a stdio MCP server.
For PR / issue lookups, set a GitHub token:
Without a token, the local-git tools still work. PR linkage is skipped.
Tools
| Tool | Purpose |
|------|---------|
| who_touched | Group blame by author. Lines, commits, last-touched, primary owner. Optional line-range narrowing. |
| introducing_pr | Find the PR that introduced a line (or commit). Parses merge messages first; falls back to GitHub API. |
| co_change | Files most often changed together with the input file. |
| branch_hygiene | List branches with ahead/behind, last commit, merged status, stale flag. |
| recent_work | Standup helper: author's commits + files + ins/del in a window. |
| commit_context | Full commit context: subject, body, files, PR, related issues. |
Sample output (who_touched)
CLI usage (sanity checks)
Build from source
Limits (v0.1)
- GitHub only (no GitLab/Bitbucket yet).
- co_change is O(window × files-per-commit) — defaults capped at 1000 commits.
- Function-level blame is by line range, not AST. Renames not yet tracked.
- GH API rate limit applies (5000/h authed). PR results uncached this version.