whyblame
Traces why a line of code exists past reformats to the commit and ticket behind it
whyblame is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.
- Pricing
- Open source
- Platforms
- CLI, API, VS Code
- Runs
- Locally
- Version
- 1.0.0
- Listing updated
Similar MCP servers
Install
Add with the CLI
Run in a terminal
claude mcp add whyblame --env GEMINI_API_KEY='<GEMINI_API_KEY>' -- uvx whyblameAdd --scope user to use it in every project, or --scope project to share it in .mcp.json.
Or share it with your project
Add to .mcp.json
{
"mcpServers": {
"whyblame": {
"command": "uvx",
"args": [
"whyblame"
],
"env": {
"GEMINI_API_KEY": "<GEMINI_API_KEY>"
}
}
}
}Add to claude_desktop_config.json
{
"mcpServers": {
"whyblame": {
"command": "uvx",
"args": [
"whyblame"
],
"env": {
"GEMINI_API_KEY": "<GEMINI_API_KEY>"
}
}
}
}Settings → Developer → Edit Config, then quit and reopen Claude Desktop.
Add to ~/.cursor/mcp.json
{
"mcpServers": {
"whyblame": {
"command": "uvx",
"args": [
"whyblame"
],
"env": {
"GEMINI_API_KEY": "<GEMINI_API_KEY>"
}
}
}
}Use .cursor/mcp.json in a project to share it with the project.
Add to ~/.copilot/mcp-config.json
{
"mcpServers": {
"whyblame": {
"type": "stdio",
"command": "uvx",
"args": [
"whyblame"
],
"env": {
"GEMINI_API_KEY": "<GEMINI_API_KEY>"
}
}
}
}Or put the same entry in .mcp.json at your workspace root to share it.
Add with the CLI
Run in a terminal
codex mcp add whyblame --env GEMINI_API_KEY='<GEMINI_API_KEY>' -- uvx whyblameOr add to config.toml
Add to ~/.codex/config.toml
[mcp_servers.whyblame]
command = "uvx"
args = ["whyblame"]
env = { GEMINI_API_KEY = "<GEMINI_API_KEY>" }Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"whyblame": {
"command": "uvx",
"args": [
"whyblame"
],
"env": {
"GEMINI_API_KEY": "<GEMINI_API_KEY>"
}
}
}
}Gemini CLI and Antigravity
Gemini CLI
Add to ~/.gemini/settings.json
{ "mcpServers": { "whyblame": { "command": "uvx", "args": [ "whyblame" ], "env": { "GEMINI_API_KEY": "<GEMINI_API_KEY>" } } } }Or run: gemini mcp add -s user -e GEMINI_API_KEY='<GEMINI_API_KEY>' whyblame uvx -- whyblame
Antigravity
Add to ~/.gemini/config/mcp_config.json
{ "mcpServers": { "whyblame": { "command": "uvx", "args": [ "whyblame" ], "env": { "GEMINI_API_KEY": "<GEMINI_API_KEY>" } } } }Use .agents/mcp_config.json to add it to one workspace only.
Devin Desktop (formerly Windsurf)
Add to ~/.config/devin/mcp_config.json
{ "mcpServers": { "whyblame": { "command": "uvx", "args": [ "whyblame" ], "env": { "GEMINI_API_KEY": "<GEMINI_API_KEY>" } } } }On Windows the file is %APPDATA%\devin\mcp_config.json. Use .devin/mcp_config.json to share it with a project.
Cline
Add to cline_mcp_settings.json
{ "mcpServers": { "whyblame": { "command": "uvx", "args": [ "whyblame" ], "env": { "GEMINI_API_KEY": "<GEMINI_API_KEY>" } } } }Open it from the MCP Servers icon → Configure → Configure MCP Servers.
Zed
Add to Zed settings.json
{ "context_servers": { "whyblame": { "command": "uvx", "args": [ "whyblame" ], "env": { "GEMINI_API_KEY": "<GEMINI_API_KEY>" } } } }Open it with zed: open settings file. Merge context_servers into the settings you already have.
JetBrains AI Assistant and Junie
AI Assistant
Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add
{ "mcpServers": { "whyblame": { "command": "uvx", "args": [ "whyblame" ], "env": { "GEMINI_API_KEY": "<GEMINI_API_KEY>" } } } }The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.
Junie
Add to ~/.junie/mcp/mcp.json
{ "mcpServers": { "whyblame": { "command": "uvx", "args": [ "whyblame" ], "env": { "GEMINI_API_KEY": "<GEMINI_API_KEY>" } } } }Use .junie/mcp/mcp.json to share it with a project.
Kiro
Add to ~/.kiro/settings/mcp.json
{ "mcpServers": { "whyblame": { "command": "uvx", "args": [ "whyblame" ], "env": { "GEMINI_API_KEY": "<GEMINI_API_KEY>" } } } }Use .kiro/settings/mcp.json to add it to one workspace only.
Using several servers? Build one config file with the MCP config generator.
Configuration
GEMINI_API_KEYOptional. Adds the explain_line tool: short answers that cite their evidence
About whyblame
Plain git blame points at the last commit that touched a line, which is often a reformat or rename. whyblame follows that line back through cosmetic changes to the commit that actually set its behaviour, then attaches the linked tickets and pull requests that explain it.
It runs locally as a Python package with a terminal interface, a small web UI and an MCP server over stdio or Streamable HTTP. Its check command flags guards such as raise, assert, lock and timeout code that a change removes or weakens, and a GitHub Action can post those warnings on pull requests without blocking merges.
It suits developers who inherit unfamiliar code and coding agents that might delete a check whose purpose they cannot see. Reading git history needs no API key; the explain_line tool only appears when a Gemini key is configured.
Tools this server provides (5)
Taken from the project documentation; the running server may differ.
From the tool list in its README, going by the names, 3 of 5 tools read data; 2 names don't say.
From the server's own tool labels and tool names; not verified by us.
- why_line
- The commit that set this line's behaviour, the reformats it skipped, and linked tickets and pull requests
- why_range
- The same history for a block, grouped by the commit that introduced each part
- check_changeName suggests: reads
- Lists guards that edits removed or weakened, and why they were there
- find_discussionsName suggests: reads
- Tickets and pull requests behind a line, or possibly related ones when none is linked
- explain_lineName suggests: reads
- A short cited explanation of a line, offered only when a Gemini key is configured
What it does
- Cosmetic change skipping
- Follows a line past formatting, quoting, wrapping, renames and moves to find the change that gave it its behaviour.
- Linked ticket lookup
- Attaches tickets and pull requests to a line, and searches for earlier related discussions when none is linked.
- Guard removal check
- Lists protective code such as raises, asserts, locks and timeouts that a change removes or weakens, with the commit that added it.
- GitHub Action warnings
- Runs the guard check on pull requests and posts warnings on changed lines without blocking the merge.
- Agent tools over MCP
- Exposes read-only tools for line history, range history, change checks and discussion search to AI coding clients.
- Local web UI and search
- Browse traced history in a local web interface and run full-text search over fetched tickets and pull requests.
Good for
- Finding out why a defensive check exists before removing it during a refactor
- Giving an AI coding agent history context before it edits protected code
- Reviewing a branch for removed guards before merging
- Tracing an inherited line back to the ticket that motivated it
Pricing
Open source
Open source under Apache-2.0; optional Gemini key for explanations.
whyblame FAQ
Does whyblame need an API key?
No. It reads local git history and runs on your machine. A Gemini key is optional and only enables the explain_line tool.
Which AI clients can use whyblame?
The README lists Claude Code, Codex, Gemini CLI, VS Code, Cursor, LM Studio and Claude Desktop, and says any MCP client works, including with local models.
Does the check block pull requests?
No. The GitHub Action warns on the changed line and never blocks.
Where is the index stored?
Inside the repository's git directory at .git/provenance/, so nothing appears in the working tree.
Is whyblame free?
Yes. whyblame is open source, so you can use and self-host it for free.
How do I add whyblame to Claude Code?
Run this command in your terminal: claude mcp add whyblame --env GEMINI_API_KEY='<GEMINI_API_KEY>' -- uvx whyblame
What are the best alternatives to whyblame?
The closest alternatives to whyblame are Git History, Git Insights, Carbon Forge, Git and Git Summary.
Where this comes from
- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.
