whygit
Read-only Git explainer: what state a repo is in, what an error means and the exact fix
whygit is a free MCP server for developer tools. It runs locally on your machine and is started by your AI client.
- Pricing
- Free
- Platforms
- CLI, macOS, Windows
- Runs
- Locally
- Version
- 0.1.2
- Listing updated
Similar MCP servers
Install
Add with the CLI
Run in a terminal
claude mcp add whygit -- uvx whygitAdd --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": {
"whygit": {
"command": "uvx",
"args": [
"whygit"
]
}
}
}Add to claude_desktop_config.json
{
"mcpServers": {
"whygit": {
"command": "uvx",
"args": [
"whygit"
]
}
}
}Settings → Developer → Edit Config, then quit and reopen Claude Desktop.
Add to ~/.cursor/mcp.json
{
"mcpServers": {
"whygit": {
"command": "uvx",
"args": [
"whygit"
]
}
}
}Use .cursor/mcp.json in a project to share it with the project.
Add to ~/.copilot/mcp-config.json
{
"mcpServers": {
"whygit": {
"type": "stdio",
"command": "uvx",
"args": [
"whygit"
]
}
}
}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 whygit -- uvx whygitOr add to config.toml
Add to ~/.codex/config.toml
[mcp_servers.whygit]
command = "uvx"
args = ["whygit"]Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"whygit": {
"command": "uvx",
"args": [
"whygit"
]
}
}
}Gemini CLI and Antigravity
Gemini CLI
Add to ~/.gemini/settings.json
{ "mcpServers": { "whygit": { "command": "uvx", "args": [ "whygit" ] } } }Or run: gemini mcp add -s user whygit uvx -- whygit
Antigravity
Add to ~/.gemini/config/mcp_config.json
{ "mcpServers": { "whygit": { "command": "uvx", "args": [ "whygit" ] } } }Use .agents/mcp_config.json to add it to one workspace only.
Devin Desktop (formerly Windsurf)
Add to ~/.config/devin/mcp_config.json
{ "mcpServers": { "whygit": { "command": "uvx", "args": [ "whygit" ] } } }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": { "whygit": { "command": "uvx", "args": [ "whygit" ] } } }Open it from the MCP Servers icon → Configure → Configure MCP Servers.
Zed
Add to Zed settings.json
{ "context_servers": { "whygit": { "command": "uvx", "args": [ "whygit" ] } } }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": { "whygit": { "command": "uvx", "args": [ "whygit" ] } } }Junie
Add to ~/.junie/mcp/mcp.json
{ "mcpServers": { "whygit": { "command": "uvx", "args": [ "whygit" ] } } }Use .junie/mcp/mcp.json to share it with a project.
Kiro
Add to ~/.kiro/settings/mcp.json
{ "mcpServers": { "whygit": { "command": "uvx", "args": [ "whygit" ] } } }Use .kiro/settings/mcp.json to add it to one workspace only.
Using several servers? Build one config file with the MCP config generator.
About whygit
whygit is built for people meeting Git for the first time. It inspects a repository, tells you in plain English what state it is in and which commands to run, and also explains an error message you paste in. It only reads: every Git call goes through a single function that accepts only read-only subcommands, it sets GIT_OPTIONAL_LOCKS=0, never runs git fetch, and masks credentials in remote URLs. The test suite snapshots the .git directory before and after to check nothing changes.
It recognises many situations: merge conflicts, a stopped rebase, detached HEAD, diverged branches, nested repositories, files over GitHub's 100 MB limit, likely secrets such as .env or *.pem, missing user.name, a stale index.lock and dubious ownership. Error coverage includes rejected pushes, unrelated histories, GitHub login failures and publickey denials. Commands that can lose work are flagged, with a safer option listed first.
The MCP mode, whygit mcp, offers three tools: diagnose_repo, explain_git_error and explain_state. It also works as a plain CLI with --json, and needs Python 3.10 or newer and Git.
Tools this server provides (3)
Taken from the project documentation; the running server may differ.
From the tool list in its README, going by the names, 2 of 3 tools read data; 1 name doesn't say.
From the server's own tool labels and tool names; not verified by us.
- diagnose_repo
- Find every problem in a repository, most urgent first, with explanation and fix
- explain_git_errorName suggests: reads
- Explain a Git error message and the fix, using repository state if a path is given
- explain_stateName suggests: reads
- Neutral summary of branch, upstream, remotes, changes and operations in progress
What it does
- Repo diagnosis
- Lists problems most urgent first with explanation and fix.
- Error explanation
- Explains pasted Git errors using repo state when available.
- State summary
- Reports branch, upstream, ahead and behind, and changes.
- Read-only guarantee
- Refuses any Git subcommand that could modify the repo.
- Safe fix suggestions
- Marks destructive commands and lists safer ones first.
- CLI and MCP modes
- Works from the terminal or inside an assistant.
Good for
- Find out why a rebase is stuck
- Understand a rejected push
- Catch a large file or secret before pushing
- Give an assistant a reliable diagnosis instead of guesses
Pricing
Free
Free to install from PyPI
whygit FAQ
Will whygit change my repository?
No. It only runs read-only Git commands and never runs the fixes it suggests.
What does whygit need?
Python 3.10 or newer and Git, on macOS, Windows or Linux.
How do I add whygit to Claude Code?
Run claude mcp add --scope user whygit -- uvx whygit mcp.
Does whygit print my credentials?
No. Remote URLs with tokens are masked in every output.
Is whygit free?
Yes. whygit is free to use.
What are the best alternatives to whygit?
The closest alternatives to whygit are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.
Where this comes from
- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.


