Skip to main content

What it does

The MCP integration registers git-why mcp as a local stdio MCP server. Once registered, your coding agent has eight tools available:

Setup

Run git why setup and select MCP Server from the menu. GitWhy configures the MCP server automatically. To configure manually, add the following to your agent’s MCP config:
Run this in your terminal:
To install globally (all projects):
Verify it was added:
Replace YOUR_API_KEY with the key from your GitWhy dashboard. You can also set GITWHY_API_KEY in your shell profile instead of the config file.
If you change the GITWHY_API_KEY in the config file, you must restart your coding agent for the change to take effect. The MCP server runs as a subprocess and inherits environment variables at startup — editing the config file does not update the running process.

How the agent uses MCP tools

Once configured, the agent calls GitWhy tools directly. You don’t need to tell it to use the CLI. Checking status:
Saving a context:
Browsing the context tree:
Searching (hybrid local + cloud):
Search results include a relevance score, snippet, related files, and commit SHAs. The agent can call gitwhy_get on any result to read the full context. Retrieving a context:
Syncing and sharing:
Posting to a PR:

Verify the server is running

Expected output:

See also